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: Tom Tromey <tromey at redhat dot com>
- To: nobody at sources dot redhat dot com
- Cc: gdb-prs at sources dot redhat dot com,
- Date: 8 Oct 2003 22:28:00 -0000
- Subject: Re: java/1413: gdb loses java type information
- Reply-to: Tom Tromey <tromey at redhat dot com>
The following reply was made to PR java/1413; it has been noted by GNATS.
From: Tom Tromey <tromey@redhat.com>
To: Jim Blandy <jimb@redhat.com>
Cc: gdb-gnats@sources.redhat.com
Subject: Re: java/1413: gdb loses java type information
Date: 08 Oct 2003 16:19:30 -0600
>> However, "p $1[0]" ought to work, and it is weird
>> that it does not, given that gdb has just reported
>> that $1 has an array type.
Jim> I think you're misinterpreting GDB's behavior here. y and $1 have
Jim> identical values and types (java.lang.Object). It's only when GDB
Jim> prints the value that it looks up its dynamic type and uses that in
Jim> the name. It's not the case that GDB produces a value with the
Jim> dynamic type, but then forgets the type.
Fair enough.
I still think it would be more helpful if gdb let me treat an object
according to its actual type, as opposed to its declared type. As it
is, I wind up having to use casts quite a lot, as java containers
always use Object as the type of the containee.
Tom