User forums > Using Code::Blocks

see content of a vector in debugging

<< < (8/26) > >>

ollydbg:
Wonderful Job!!!!

I tested it and it can work on vector<int>.
Thank you very much!!!!!

Here is a screen shot.


By the way, I'm not fully understand what the sentence means. :(

--- Quote ---Can someone explain what is the format of the string that the Parse_MyClass function should emit?
There are no docs and looking at the source of the parser won't help me
--- End quote ---

Where is the term "Parse_MyClass" function?


Edit:
I can't upload attachment any more, because my upload folder is full. So I have to upload the image to an external site. :(

oBFusCATed:

--- Quote from: ollydbg on June 11, 2009, 03:38:45 am ---Where is the term "Parse_MyClass" function?

--- End quote ---

This is fictional name, when you write a debug script you need to provide to functions Evaluate_MyClass and Parse_MyClass.

btw: It works on the vector<struct>, too :)

The vector<vector<> > case requires script binding for

--- Code: ---local cmd_result = ExecuteDebuggerCmd("pvector $1");
or
local parsed_value = DebuggerEvaluateVariable("$1"); // $1 is a gdb variable I think

--- End code ---
This way when I iterate the elements of the vector, I can evaluate and then parse them if they are complex

MortenMacFly:

--- Quote from: oBFusCATed on June 10, 2009, 11:47:11 pm ---OK, I've achieved 99% success.

--- End quote ---
Nice work! :-)

Anyways (taking the risk of nut-picking): Please name script bindings with names that really tell what they do. I have renamed the "tointeger" function intol "wxString_ToLong". Because that's what is actually happening. And only that.

oBFusCATed:
No problem, my idea with the naming was to replicate the build-in tonumber function of squirrel. And I have no problems with the new name (except that it will be good if you sync the wxaui branch to trunk, because that is what I'm using).

What about the other two scripting functions that are required? Are they hard to implement?
The former will be used to implement squirrel version of the stl-views file, at the moment that is not possible.
The latter will be used in parsing of complex structures.

At the moment (I think) if the vector is part of a struct it won't be parsed, when the tree item of the struct is expanded:


--- Code: ---struct
{
    std::string s;
    std::vector<int> v;
} a;

In the watches
a
 |-- s   <--- not parsed as string
 |-- v   <--- not parsed as vector

--- End code ---

BTW: the std::list will require two commands to be parsed
1. plist list (to find its T type)
2. plist list T to get the structure

MortenMacFly:

--- Quote from: oBFusCATed on June 11, 2009, 09:35:37 am ---No problem, my idea with the naming was to replicate [...]

--- End quote ---
I have updated the script binding even more. I had started to do it several month ago and had in mind to bind the wxString functions. If you want to, place your ToLong function into the "right" place now. ;-)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version