Inside STL queues, etc...

General questions regarding the usage of CodeLite
namnori
CodeLite Curious
Posts: 2
Joined: Thu Nov 06, 2008 11:01 pm
Contact:

Inside STL queues, etc...

Post 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?
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Inside STL queues, etc...

Post 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
Make sure you have read the HOW TO POST thread
sdolim
CodeLite Veteran
Posts: 69
Joined: Fri Oct 24, 2008 10:29 pm
Contact:

Re: Inside STL queues, etc...

Post by sdolim »

This might help:

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

(Just found it via Google. I haven't tried it.)
sdolim
CodeLite Veteran
Posts: 69
Joined: Fri Oct 24, 2008 10:29 pm
Contact:

Re: Inside STL queues, etc...

Post 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".
namnori
CodeLite Curious
Posts: 2
Joined: Thu Nov 06, 2008 11:01 pm
Contact:

Re: Inside STL queues, etc...

Post 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?
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Inside STL queues, etc...

Post 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
Make sure you have read the HOW TO POST thread
sdolim
CodeLite Veteran
Posts: 69
Joined: Fri Oct 24, 2008 10:29 pm
Contact:

Re: Inside STL queues, etc...

Post 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.
Post Reply