User forums > Using Code::Blocks

see content of a vector in debugging

<< < (13/26) > >>

killerbot:
Finally I got to trying the patch, but it doesn't work for me.

This is what I have done :

1) Put your gdb_types.script instead of the CB's official one (with the tointeger being replaced by the real supported command)
2) copied "stl-views-1.0.3.gdb" to /usr/local/share/codeblocks
3) compiler/debugger settings : added "source stl-views-1.0.3.gdb" to the "Debugger initiliazation commands"
4) created console app with your main.cpp
5) but both watches (v / vv) don't show anythin at al (not even the ... repitition of 0)
6) When I do manually "Send user command to debugger" : "pvector v" , then I can see in the debug log pane : "Undefined command: "pvector".  Try "help"."

What part am I missing ??


EDIT : the answer I saw in the debugger log pane was incorrectly copy/pasted in here : modified my post to contain the correct answer which is "Undefined command: "pvector".  Try "help"."
"

oBFusCATed:

--- Quote from: killerbot on June 13, 2009, 09:06:26 pm ---6) When I do manually "Send user command to debugger" : "pvector v" , then I can see in the debug log pane : "pvector v"

--- End quote ---

So If I understand correctly, the pvector v command is emmiting something like (writting from memory because I'm not infront of my pc at the moment)


--- Code: ---elem 0: $1 = 1
elem 0: $2 = 2
Vector size = 2
Vector capacity = 2
Element type int*

--- End code ---

What gcc and gdb do you use?
I'm using gcc 4.3.3 and gdb 6.8 on gentoo amd64 bit
I think, I've read that the stl-views file has some modifications for gcc-4.3.x series.
If you are using older compiler, that might cause the problem. :(

ollydbg:
I have a problem "Squirrel function call failed". As in the debuger (debug) panel, I can see the returned string from gdb. see the screen shot:

killerbot:
I edited my post above, I made a copy/paste error on what answer I see in the debug pan upon isseing "pvector v".
It is "Undefined command: "pvector".  Try "help"."

GCC: 4.3.1
GDB : 6.8

ollydbg:

--- Quote from: killerbot on June 14, 2009, 10:23:12 am ---I edited my post above, I made a copy/paste error on what answer I see in the debug pan upon isseing "pvector v".
It is "Undefined command: "pvector".  Try "help"."

GCC: 4.3.1
GDB : 6.8

--- End quote ---

This means the extend gdb command script file was not load correctly.
"source stl-views-1.0.3.gdb"

If this file loaded correctly, you can type "pvector", then here is the log output.


--- Code: ---> pvector
Prints std::vector<T> information.
Syntax: pvector <vector> <idx1> <idx2>
Note: idx, idx1 and idx2 must be in acceptable range [0..<vector>.size()-1].
Examples:
pvector v - Prints vector content, size, capacity and T typedef
pvector v 0 - Prints element[idx] from vector
pvector v 1 2 - Prints elements in range [idx1..idx2] from vector
>>>>>>cb_gdb:
--- End code ---


Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version