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: 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


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