* [RFA/JDWP] Fix method flags for compiled classes
@ 2007-05-11 19:07 Kyle Galloway
2007-05-15 20:34 ` Tom Tromey
0 siblings, 1 reply; 3+ messages in thread
From: Kyle Galloway @ 2007-05-11 19:07 UTC (permalink / raw)
To: Java Patch List
[-- Attachment #1: Type: text/plain, Size: 758 bytes --]
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
[-- Attachment #2: methodmods.patch --]
[-- Type: text/x-patch, Size: 919 bytes --]
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;
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFA/JDWP] Fix method flags for compiled classes
2007-05-11 19:07 [RFA/JDWP] Fix method flags for compiled classes Kyle Galloway
@ 2007-05-15 20:34 ` Tom Tromey
2007-05-17 18:53 ` Kyle Galloway
0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2007-05-15 20:34 UTC (permalink / raw)
To: Kyle Galloway; +Cc: Java Patch List
>>>>> "Kyle" == Kyle Galloway <kgallowa@redhat.com> writes:
Kyle> Currently, the modifiers for a method for JDWP are determined by the
Kyle> underlying java class, not the actual way in which the method is being
Kyle> run. If a class, a part of the class libraries for example, has been
Kyle> precompiled and is being run as native code, for JDWPs purposes, this is
Kyle> a native method. This patch checks if the class for a method is
Kyle> non-interpreted, and if so, marks the method as native. This prevents
Kyle> eclipse fro attempting to do things like getting the line table which
Kyle> cannot be done for native methods.
Ok, thanks.
Tom
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFA/JDWP] Fix method flags for compiled classes
2007-05-15 20:34 ` Tom Tromey
@ 2007-05-17 18:53 ` Kyle Galloway
0 siblings, 0 replies; 3+ messages in thread
From: Kyle Galloway @ 2007-05-17 18:53 UTC (permalink / raw)
To: tromey; +Cc: Java Patch List
Tom Tromey wrote:
>>>>>> "Kyle" == Kyle Galloway <kgallowa@redhat.com> writes:
>>>>>>
>
> Kyle> Currently, the modifiers for a method for JDWP are determined by the
> Kyle> underlying java class, not the actual way in which the method is being
> Kyle> run. If a class, a part of the class libraries for example, has been
> Kyle> precompiled and is being run as native code, for JDWPs purposes, this is
> Kyle> a native method. This patch checks if the class for a method is
> Kyle> non-interpreted, and if so, marks the method as native. This prevents
> Kyle> eclipse fro attempting to do things like getting the line table which
> Kyle> cannot be done for native methods.
>
> Ok, thanks.
>
This too has been committed.
- Kyle
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-05-17 18:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-11 19:07 [RFA/JDWP] Fix method flags for compiled classes Kyle Galloway
2007-05-15 20:34 ` Tom Tromey
2007-05-17 18:53 ` Kyle Galloway
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).