News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

std vector debugging

Started by daniel_i_l, April 01, 2009, 07:22:43 PM

Previous topic - Next topic

daniel_i_l

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.

ollydbg

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.