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]

[RFA/JDWP] Implement VMVM.getClassMethod


Hi,

This pretty simple patch implements the Classpath JDWP method VMVirtualMachine.getClassMethod.

Keith

ChangeLog
2007-01-22  Keith Seitz  <keiths@redhat.com>

        * gnu/classpath/jdwp/natVMVirtualMachine.cc
        (getClassMethod): Implement.
Index: gnu/classpath/jdwp/natVMVirtualMachine.cc
===================================================================
--- gnu/classpath/jdwp/natVMVirtualMachine.cc	(revision 121059)
+++ gnu/classpath/jdwp/natVMVirtualMachine.cc	(working copy)
@@ -30,6 +30,7 @@
 #include <gnu/classpath/jdwp/VMVirtualMachine.h>
 #include <gnu/classpath/jdwp/event/EventRequest.h>
 #include <gnu/classpath/jdwp/event/VmInitEvent.h>
+#include <gnu/classpath/jdwp/exception/InvalidMethodException.h>
 #include <gnu/classpath/jdwp/exception/JdwpInternalErrorException.h>
 #include <gnu/classpath/jdwp/util/MethodResult.h>
 
@@ -307,9 +308,14 @@
 
 gnu::classpath::jdwp::VMMethod *
 gnu::classpath::jdwp::VMVirtualMachine::
-getClassMethod (MAYBE_UNUSED jclass klass, MAYBE_UNUSED jlong id)
+getClassMethod (jclass klass, jlong id)
 {
-  return NULL;
+  jmethodID method = reinterpret_cast<jmethodID> (id);
+  _Jv_MethodBase *bmeth = _Jv_FindInterpreterMethod (klass, method);
+  if (bmeth != NULL)
+    return new gnu::classpath::jdwp::VMMethod (klass, id);
+
+  throw new gnu::classpath::jdwp::exception::InvalidMethodException (id);
 }
 
 java::util::ArrayList *

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