This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: casting in gdb
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Michael Elizabeth Chastain <mec at shout dot net>
- Cc: jacqueslen at sympatico dot ca, gdb at sources dot redhat dot com
- Date: Sun, 15 Dec 2002 11:06:47 -0500
- Subject: Re: casting in gdb
- References: <200212150547.gBF5lg511015@duracef.shout.net>
On Sat, Dec 14, 2002 at 11:47:42PM -0600, Michael Elizabeth Chastain wrote:
> I'm playing with the idea that gdb should know more about the C++
> standard library types, in the same spirit that gdb knows that a C "char
> *" usually points to a string terminated with '\0'. I would like gdb
> to understood more about std::string, std::vector, std:map, and so on.
>
> Daniel J, what do you think?
I think there's a pretty big problem with approaching the problem from
this side. You can't do it by teaching GDB more about the _types_.
You have to teach it more about the _implementation_. i.e. every time
you do this it is tied to a particular STL implementation.
I'm not saying that it's a bad idea, just that you need to look at it
from the other side first.
That said, we need generic facilities for target-specific type handling;
that would be really nice. Do we care that this means "MyVector[0]"
will make a function call and "std::vector[0]" won't? I don't think we
will.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer