This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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: [RFA/JDWP] ReferenceTypeCommandSet.java


On Tue, 2005-07-05 at 15:32 -0400, Aaron Luchko wrote:

> There are a couple interesting points for this patch. The first is that
> upon Keith's suggestion any Command which has something to do with
> generics (in this case just queries for the generic signature) we just
> throw a NotImplementedException since we don't do any generics. This
> shouldn't cause any problems because there's always a non-generic
> counterpart though we could theoretically also return an empty string
> for the generic signature.

Generics is a 1.5 feature. Anyone have a problem with implementing JDWP 1.4 first? 1/2 :-)

> There's also a couple places I use classes from java.lang.reflect
> This is a bit of a problem as it's been pointed out if in the instance
> of a command like 
> http://java.sun.com/j2se/1.5.0/docs/guide/jpda/jdwp/jdwp-protocol.html#JDWP_ReferenceType_GetValues
> Using the Field object will cause the Class to initialize which would be
> changing the execution of the program. Tom Tromey suggested we could
> replace the java.lang.relfect classes we use by our own classes later on
> that reach into the JVM and avoid this problem.

The question is, though, is this really a problem?

In order to use ReferenceType commands, the debugger must have already
requested a reference ID for the given class. AFAICT the only way to get
a reference type ID for a class is to register for some event. Eclipse,
for example, uses class prepare events.

Anyway, the existence of a reference type ID would mean that the class
must have been loaded/initialized at some time, no?

At the very least, as Tom suggests, we could certainly use this a first
attempt, replacing when/if necessary.

Keith


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