This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: java/1413: gdb loses java type information


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]