diff options
| author | kseitz <kseitz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-25 21:05:18 +0000 |
|---|---|---|
| committer | kseitz <kseitz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-25 21:05:18 +0000 |
| commit | 409d7eee588adc09d2e8ba1de2597ab598ad52d5 (patch) | |
| tree | 1f03282fde89cfd286c4b75b454f98b454bb2d3f /libjava/gnu | |
| parent | 8cdbd8462af095c93de9919945abc892b079f5f8 (diff) | |
| download | ppe42-gcc-409d7eee588adc09d2e8ba1de2597ab598ad52d5.tar.gz ppe42-gcc-409d7eee588adc09d2e8ba1de2597ab598ad52d5.zip | |
* include/jvmti-int.h (_Jv_GetJDWP_JVMTIEnv): Declare.
* gnu/classpath/jdwp/natVMVirtualMachine.cc
(_Jv_GetJDWP_JVMTIEnv): New function.
* gnu/classpath/jdwp/natVMMethod.cc (getName): Implement.
(getSignature): Implement.
(getModifiers): Implement.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121185 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/gnu')
| -rw-r--r-- | libjava/gnu/classpath/jdwp/natVMMethod.cc | 30 | ||||
| -rw-r--r-- | libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc | 6 |
2 files changed, 30 insertions, 6 deletions
diff --git a/libjava/gnu/classpath/jdwp/natVMMethod.cc b/libjava/gnu/classpath/jdwp/natVMMethod.cc index 7dea4747731..07d5622c704 100644 --- a/libjava/gnu/classpath/jdwp/natVMMethod.cc +++ b/libjava/gnu/classpath/jdwp/natVMMethod.cc @@ -1,6 +1,6 @@ // natVMMethod.cc -- native support for VMMethod -/* Copyright (C) 2006 Free Software Foundation +/* Copyright (C) 2006, 2007 Free Software Foundation This file is part of libgcj. @@ -11,28 +11,46 @@ details. */ #include <config.h> #include <gcj/cni.h> #include <java-interp.h> +#include <jvmti.h> +#include "jvmti-int.h" #include <gnu/classpath/jdwp/VMMethod.h> #include <gnu/classpath/jdwp/exception/JdwpInternalErrorException.h> #include <gnu/classpath/jdwp/util/LineTable.h> #include <gnu/classpath/jdwp/util/VariableTable.h> -java::lang::String* +jstring gnu::classpath::jdwp::VMMethod::getName () { - return NULL; + jvmtiEnv *env = _Jv_GetJDWP_JVMTIEnv (); + jmethodID method = reinterpret_cast<jmethodID> (_methodId); + char *name; + env->GetMethodName (method, &name, NULL, NULL); + jstring string = JvNewStringUTF (name); + env->Deallocate (reinterpret_cast<unsigned char *> (name)); + return string; } -java::lang::String* +jstring gnu::classpath::jdwp::VMMethod::getSignature () { - return NULL; + jvmtiEnv *env = _Jv_GetJDWP_JVMTIEnv (); + jmethodID method = reinterpret_cast<jmethodID> (_methodId); + char *signature; + env->GetMethodName (method, NULL, &signature, NULL); + jstring string = JvNewStringUTF (signature); + env->Deallocate (reinterpret_cast<unsigned char *> (signature)); + return string; } jint gnu::classpath::jdwp::VMMethod::getModifiers () { - return 0; + jvmtiEnv *env = _Jv_GetJDWP_JVMTIEnv (); + jmethodID method = reinterpret_cast<jmethodID> (_methodId); + jint flags; + env->GetMethodModifiers (method, &flags); + return flags; } gnu::classpath::jdwp::util::LineTable * diff --git a/libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc b/libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc index afdfbc72cef..ef4fe281d2f 100644 --- a/libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc +++ b/libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc @@ -48,6 +48,12 @@ static void JNICALL jdwpVMInitCB (jvmtiEnv *, JNIEnv *, jthread); // JVMTI environment static jvmtiEnv *_jdwp_jvmtiEnv; +jvmtiEnv * +_Jv_GetJDWP_JVMTIEnv (void) +{ + return _jdwp_jvmtiEnv; +} + void gnu::classpath::jdwp::VMVirtualMachine::initialize () { |

