This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[RFA/JDWP] Fix method flags for compiled classes
- From: Kyle Galloway <kgallowa at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: Fri, 11 May 2007 15:06:04 -0400
- Subject: [RFA/JDWP] Fix method flags for compiled classes
Currently, the modifiers for a method for JDWP are determined by the
underlying java class, not the actual way in which the method is being
run. If a class, a part of the class libraries for example, has been
precompiled and is being run as native code, for JDWPs purposes, this is
a native method. This patch checks if the class for a method is
non-interpreted, and if so, marks the method as native. This prevents
eclipse fro attempting to do things like getting the line table which
cannot be done for native methods.
ChangeLog
207-05-11 Kyle Galloway <kgallowa@redhat.com>
* gnu/classpath/jdwp/natVMMethod.cc (getModifiers): Check for native
classes,
and mark methods as native appropriately.
Questions/Comments/Concerns?
Thanks,
Kyle
Index: gnu/classpath/jdwp/natVMMethod.cc
===================================================================
--- gnu/classpath/jdwp/natVMMethod.cc (revision 124570)
+++ gnu/classpath/jdwp/natVMMethod.cc (working copy)
@@ -14,6 +14,7 @@
#include <jvmti.h>
#include "jvmti-int.h"
+#include <java/lang/reflect/Modifier.h>
#include <gnu/classpath/jdwp/VMMethod.h>
#include <gnu/classpath/jdwp/exception/AbsentInformationException.h>
#include <gnu/classpath/jdwp/exception/InvalidMethodException.h>
@@ -65,6 +66,12 @@
jmethodID method = reinterpret_cast<jmethodID> (_methodId);
jint flags;
env->GetMethodModifiers (method, &flags);
+
+ // If this class is compiled, as far as JDWP is concerned, its methods are
+ // native. This will set the native flag for these methods.
+ if (!_Jv_IsInterpretedClass (getDeclaringClass ()))
+ flags |= java::lang::reflect::Modifer::NATIVE;
+
return flags;
}