diff options
author | kgallowa <kgallowa@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-05-04 19:48:33 +0000 |
---|---|---|
committer | kgallowa <kgallowa@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-05-04 19:48:33 +0000 |
commit | 40c16716fbfb35087955d4663a5a15035c85714e (patch) | |
tree | 9ffa87e722d37cfbe71db832db350dec81b3fe28 /libjava | |
parent | 6cb65c76ecba38a538ceea4badece8e0716263a3 (diff) | |
download | gcc-40c16716fbfb35087955d4663a5a15035c85714e.tar.gz |
2007-05-04 Kyle Galloway <kgallowa@redhat.com>
* gnu/classpath/jdwp/natVMVirtualMachine.cc (getClassMethod): Change
to use JVMTI.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124447 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 5 | ||||
-rw-r--r-- | libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc | 23 |
2 files changed, 23 insertions, 5 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index c0a2a82a77e..427d09ea2c4 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,8 @@ +2007-05-04 Kyle Galloway <kgallowa@redhat.com> + + * gnu/classpath/jdwp/natVMVirtualMachine.cc (getClassMethod): Change + to use JVMTI. + 2007-05-03 Keith Seitz <keiths@redhat.com> * interpret.cc: Don't include ExceptionEvent.h. diff --git a/libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc b/libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc index d6edf345437..3c89b9863ec 100644 --- a/libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc +++ b/libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc @@ -510,12 +510,25 @@ gnu::classpath::jdwp::VMMethod * gnu::classpath::jdwp::VMVirtualMachine:: getClassMethod (jclass klass, jlong id) { - jmethodID method = reinterpret_cast<jmethodID> (id); - _Jv_MethodBase *bmeth = _Jv_FindInterpreterMethod (klass, method); - if (bmeth != NULL) - return new gnu::classpath::jdwp::VMMethod (klass, id); + jint count; + jmethodID *methods; + jvmtiError err = _jdwp_jvmtiEnv->GetClassMethods (klass, &count, &methods); + if (err != JVMTI_ERROR_NONE) + throw_jvmti_error (err); + + jmethodID meth_id = reinterpret_cast<jmethodID> (id); + + using namespace gnu::classpath::jdwp; + + // Check if this method is defined for the given class and if so return a + // VMMethod representing it. + for (int i = 0; i < count; i++) + { + if (methods[i] == meth_id) + return new VMMethod (klass, reinterpret_cast<jlong> (meth_id)); + } - throw new gnu::classpath::jdwp::exception::InvalidMethodException (id); + throw new exception::InvalidMethodException (id); } java::util::ArrayList * |