Printing stl::list objects in gdb

M

Michael Jasn

Hi all,

I am trying to print the contents of a std::list<Point> in gdb
(actually ddd). I have this function

void BezierCurveEvaluator::evaluateCurve(const std::vector<Point>&
ptvCtrlPts)

When I break into the function and say,

(gdb) print ptvCtrlPts

I get:

$1 = (vector<Point,std::allocator<Point> > &) @0x80b4f78:
{<_Vector_base<Point,std::allocator<Point> >> =
{<_Vector_alloc_base<Point,std::allocator<Point>,true>> = {_M_start =
0x80b67d8, _M_finish = 0x80b6800, _M_end_of_storage = 0x80b6818}, <No
data fields>}, <No data fields>}

which does not look very friendly :)

Are there some tricks to force gdb to print the contents of a list, or
for that matter, any other STL container?


Thanks gurus.
 
J

Jack Klein

Hi all,

I am trying to print the contents of a std::list<Point> in gdb
(actually ddd). I have this function

This is a question about your debugger, not the language. The C++
standard does not define debuggers or how they operate. Try one of
the gnu.gcc.* support groups, or a group for your particular platform.
 
M

Michael Jasn

This is a question about your debugger, not the language. The C++
standard does not define debuggers or how they operate. Try one of
the gnu.gcc.* support groups, or a group for your particular platform.

Thanks for pointing me to the right group, Jack.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,010
Latest member
MerrillEic

Latest Threads

Top