Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: daniel_i_l on April 01, 2009, 07:22:43 pm

Title: std vector debugging
Post by: daniel_i_l on April 01, 2009, 07:22:43 pm
I recently started using C::B and like it a lot.  One thing has been bothering me though.  Is there anyway to see the contents of a std vector in the debugger?  After a lot of experimenting I found two partial solutions:
1) Apparently the gdb_types script is supposed to support std vectors.  It didn't work for me so I edited it so that the function Evaluate_StlVector is defined as
function Evaluate_StlVector(type, a_str, start, count)
{
return _T("p *(") + a_str + _T("._M_impl._M_start)");
}
and the Parse_StlVector just returns the a_str string.
This gives me the first element of the list in the toolpoint but the "watches" window doesn't.  How can I get this output to be displayed in the watches window?

2) On the "yolinux" site I found a gdbinit file that supports vectors.  But when I put the "pvector" command (as explained on that site) in the gdb_types file or into the command line during a debugging session I get an error saying that the command doesn't exist.  How can I get C::B to read the gdbinit file?  I tried putting it in my home directory and in the project directory with no results.

Is there another, or better way to add std vector support?
Thanks.
Title: Re: std vector debugging
Post by: ollydbg on June 17, 2009, 06:12:11 pm
We are discuss on this topic and find a nice solution. see here:

http://forums.codeblocks.org/index.php/topic,10667.msg73032.html#msg73032