This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
Re: java/1413: gdb loses java type information
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: nobody at sources dot redhat dot com
- Cc: gdb-prs at sources dot redhat dot com,
- Date: 9 Oct 2003 19:18:01 -0000
- Subject: Re: java/1413: gdb loses java type information
- Reply-to: Daniel Jacobowitz <drow at mvista dot com>
The following reply was made to PR java/1413; it has been noted by GNATS.
From: Daniel Jacobowitz <drow@mvista.com>
To: Tom Tromey <tromey@redhat.com>, gdb-gnats@sources.redhat.com
Cc:
Subject: Re: java/1413: gdb loses java type information
Date: Thu, 9 Oct 2003 15:17:44 -0400
On Thu, Oct 09, 2003 at 07:08:00PM -0000, Tom Tromey wrote:
> Jim> Are there cases where treating every object according to its dynamic
> Jim> type would change the semantics of an expression, aside from making
> Jim> more expressions permissible (while still never accepting non-typesafe
> Jim> expressions)?
>
> The only case I can think of is when a class has a field with the
> same name as a field in one of its ancestors.
>
> This is pretty unusual though. I don't know of a situation like this
> in libgcj, for instance -- whereas I run into the other debugging
> problem very frequently.
However - here's my concern - that is exactly the case where this is a
problem. If I expect to get the dynamic type's field, and due to a
programming error I've omitted a cast, so I get the static type's
field, and yet GDB prints out the dynamic type's member.... oops!
If this case can occur in Java inheritance, which I assume it can, then
I don't think this is a good choice. However a shortcut for printing
out the variable with its runtime type would be nice.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer