Re: Variable objects and STL containers

Mark Kettenis
2008-02-05T11:31:45Z

> From: Vladimir Prus <ghost@cs.msu.su>
> Date: Tue, 05 Feb 2008 09:16:53 +0300
>
> 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.

That means that you actually have to call functions in the inferior,
which might modify state you don't want to modify. And of course it
doesn't work at all for core dumps.

> 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]
>
> I'm working on making those element the children of the variable object,
> but it's not done yet.

Still this means that you'll need to write python code for each and
every STL implementation, and play catchup whenever the implementation
is changed. I guess the only way to get this to work is to connvince
the GCC people to maintain the python code together with libstdc++.