Re: Variable objects and STL containers

Nick Roberts
2008-02-05T06:34:26Z

> > 2) _M_impl, _M_start are gcc internals and I guess they could change (like
> > CLI!) Is it meaningful to ask on the gcc list for a formal interface
> > to these details?
>
> Technically, there is formal interface, called iterators, provided by the
> C++ standard. I don't have the slightest confidence in gdb not falling over
> if you try to use them, though.

Are iterators available to GDB, or just the executable? I only seem able to
access those methods which are used by my program, e.g.,

(gdb) p v.size ()
$3 = 3

but

(gdb) p v.rbegin ()
Cannot evaluate function -- may be inlined

> We discussed using Python scripting for that; in fact, I have a patch locally
> that will make
>
> -var-evaluate-expression V
>
> for a vector print something like:
>
> [1,2,3]

Does this work for programs compiled by any compiler, or just gcc?

--
Nick http://www.inet.net.nz/~nickrob