This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GDB pretty printers for iterators


On Wed, Mar 17, 2010 at 10:23:16AM -0700, Tom Tromey wrote:
> I suppose this would be a good time to say that we're doing a lot of
> work on improving C++ debugging in gdb.  One low cost way people can
> help is to file bug reports; also I'm generally interested in people's
> debugging stories and in understanding people's priorities -- what is
> more important to fix, what is less, etc.

I debug a lot of C++ code with iterators.  For me, it's OK to see
the internals because I know what they look like, and I'd prefer that
to any attempt to make things pretty that hides vital information I
need to fix the bug.  Maybe it's possible to make things pretty *and*
expose all relevant information, but an iterator is far more than simply
the value that it points to, so I don't think that just printing
"-> 2"
is going to cut it.

What I would like is to be able to reliably call the * and -> operators on
an iterator from the debugger, so that gdb can do the same kinds of
expressions that appear in source code.  In some cases this works today,
and in others it doesn't.  Having == and != work would be even better,
though this is trickier because of the need to handle any overloading properly
on pairs of iterators, conversion between const_iterator and iterator,
and other nastiness.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]