[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Pretty Printing STL Container in debugger

Thanks for the fast reply Anton. When I test with gdb I can inspect the
content of the vecotor. As already mentioned in my last mail, I also see
the same output (e.g. "std::vector of length 3, capacity 4 = {2, 12,
0}") in the CDT Variables View in its lower part.
What I am missing is the stuff in the upper part where I should be able
to expand the vector and see all its contained items as children under
the vector.
>From the graphic http://wiki.eclipse.org/Image:FullPrettyPrint.png I do
have the correct result in the lower part but I miss the upper part. My
upper part looks like the one in
http://wiki.eclipse.org/Image:NoPrettyPrint.png . So I do have parts of
the pretty-print while the more important part is missing.

Lukas


On Mit, 2011-12-07 at 11:42 +0100, xgsa wrote:
> You can try to look how it works in gdb from command line (just set a 
> break after your vector is filled and make print command). If it works 
> fine you should check your Eclipse settings (for example, "C/C++ --> 
> Debug --> GDB --> Enable pretty printers in variable/expression tree" 
> setting or check that you set up right .gdbinit file in your debug 
> configuration). If gdb does not print your vector too, check your pretty 
> printers (maybe they are incompatible with your version of STL) and 
> their setup in .gdbinit.
> 
> And one more note: if you use STLPorts instead of standard STL you need 
> a special version of pretty printers for it.
> 
> Anton.
> 
> -------- Original message --------
> > Hi,
> >
> > I just tried to "see" contents of stl containers in the cdt debugger
> > (using gdb). I used the instructions from
> > http://wiki.eclipse.org/CDT/User/FAQ#How_can_I_inspect_the_contents_of_STL_containers.3F
> >
> > To some the lower part of the Variables view I can now see container
> > content (e.g. "std::vector of length 3, capacity 4 = {2, 12, 0}").
> > However, in the upper part, I cannot expand the vector to see its three
> > child elements as shown in the second picture in
> > http://wiki.eclipse.org/CDT/User/FAQ#How_can_I_inspect_the_contents_of_STL_containers.3F
> >
> > I'm using CDT 8.0 and gdb 7.3-2011.08.
> >
> > Is this a cdt bug or is there something wrong with my setup or the
> > description at above link?
> >
> >
> > Thanks for pointing me to the right direction.
> >
> > Lukas
> >
> > _______________________________________________
> > cdt-dev mailing list
> > cdt-dev@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/cdt-dev
> >
> >
> 
> 
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev