Page 1 of 1

Inside STL queues, etc...

Posted: Thu Nov 06, 2008 11:06 pm
by namnori
How can I look inside a queue/vector/etc. inside the debugger? Is it not possible to look in local variables and see what objects (and relevant data) are inside a container?

Re: Inside STL queues, etc...

Posted: Fri Nov 07, 2008 8:24 am
by eranif
Well, this is actually a gdb limitation and nothing I can do about it. If you find a way to do this on command line, let me know
and I will incorporate it into CodeLite

Eran

Re: Inside STL queues, etc...

Posted: Fri Nov 07, 2008 1:12 pm
by sdolim
This might help:

http://www.stanford.edu/~afn/gdb_stl_utils/

(Just found it via Google. I haven't tried it.)

Re: Inside STL queues, etc...

Posted: Fri Nov 07, 2008 1:22 pm
by sdolim
This looks like a more recent attempt:
http://www.yolinux.com/TUTORIALS/src/db ... s-1.03.txt
Works with g++ 4.3.

Example of use here:
http://www.yolinux.com/TUTORIALS/GDB-Commands.html
Scroll down to "De-Referencing STL Containers".

Re: Inside STL queues, etc...

Posted: Thu Nov 13, 2008 11:30 pm
by namnori
sdolim wrote:This looks like a more recent attempt:
http://www.yolinux.com/TUTORIALS/src/db ... s-1.03.txt
Works with g++ 4.3.

Example of use here:
http://www.yolinux.com/TUTORIALS/GDB-Commands.html
Scroll down to "De-Referencing STL Containers".
Thanks for the responses, eranif, sdolim. That looks good! Is it possible to use it in CodeLite?

I also have another question: auto-complete (in a class, for example) only seems to work for variables in the local scope. If I have a variable as part of a class (which should be global within the class) and try to access it in a method, auto-complete doesn't seem to work?

Re: Inside STL queues, etc...

Posted: Fri Nov 14, 2008 3:27 am
by eranif
namnori wrote:I also have another question: auto-complete (in a class, for example) only seems to work for variables in the local scope. If I have a variable as part of a class (which should be global within the class) and try to access it in a method, auto-complete doesn't seem to work?
Well, it does, for me at least.
Can you provide an example for such case (matbe you find a rare case where it does not) ?

Have u tried:
- Saving your file
- retagging the project
Eran

Re: Inside STL queues, etc...

Posted: Fri Nov 14, 2008 11:57 am
by sdolim
namnori wrote:That looks good! Is it possible to use it in CodeLite?
Right now I think you would have to use it manually. Source the script in your .gdbinit file, and use the gdb console in the Output pane to enter the commands yourself. Eran can correct me if I'm wrong.