[RFC/JVMTI] GetMethodDeclaringClass

Andrew Haley aph@redhat.com
Tue Oct 17 18:53:00 GMT 2006


Keith Seitz writes:
 > Andrew Haley wrote:
 > 
 > > AFAICS we just need to make sure that all methods for interpreted
 > > classes are pushed with _Jv_PushClass.  Then to get your class,
 > > 
 > >  class = ncodeMap->get (jmethodID->ncode);
 > 
 > I thought about doing that at one time, but I was (too?) worried about 
 > an invalid jmethodID wreaking havoc.

You want to know if a jmethodID really is valid?  That it really is a
pointer to a _Jv_Method?  

 > Is there a way to guard against something like this or otherwise
 > validate the jmethodID before dereferencing it?

The only way I can think of is by keeping a cache of them.

 > Perhaps I'm being too paranoid?

Sure.  I guess you want a debugger to be robust even when the runtime
is FUBAR, but this seems a little extreme.

Andrew.



More information about the Java-patches mailing list