aboutsummaryrefslogtreecommitdiff
path: root/libjava/gnu/classpath
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2007-01-24 22:35:43 +0000
committerKeith Seitz <kseitz@gcc.gnu.org>2007-01-24 22:35:43 +0000
commitc65110e44cc6aed93ee2e576d864e09a3bea59e3 (patch)
tree874463166f6483e4843e88cde9edd85e028c874c /libjava/gnu/classpath
parentc3a7e886eec8b9e4362eaa72bef97597df579bdf (diff)
downloadgcc-c65110e44cc6aed93ee2e576d864e09a3bea59e3.zip
gcc-c65110e44cc6aed93ee2e576d864e09a3bea59e3.tar.gz
gcc-c65110e44cc6aed93ee2e576d864e09a3bea59e3.tar.bz2
* gnu/classpath/jdwp/natVMVirtualMachine.cc
(getAllClassMethods): Implement. From-SVN: r121142
Diffstat (limited to 'libjava/gnu/classpath')
-rw-r--r--libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc34
1 files changed, 32 insertions, 2 deletions
diff --git a/libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc b/libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc
index 84b75ec..afdfbc7 100644
--- a/libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc
+++ b/libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc
@@ -301,9 +301,39 @@ getClassStatus (MAYBE_UNUSED jclass klass)
JArray<gnu::classpath::jdwp::VMMethod *> *
gnu::classpath::jdwp::VMVirtualMachine::
-getAllClassMethods (MAYBE_UNUSED jclass klass)
+getAllClassMethods (jclass klass)
{
- return NULL;
+ jint count;
+ jmethodID *methods;
+ jvmtiError err = _jdwp_jvmtiEnv->GetClassMethods (klass, &count, &methods);
+ if (err != JVMTI_ERROR_NONE)
+ {
+ char *error;
+ jstring msg;
+ if (_jdwp_jvmtiEnv->GetErrorName (err, &error) != JVMTI_ERROR_NONE)
+ {
+ msg = JvNewStringLatin1 (error);
+ _jdwp_jvmtiEnv->Deallocate ((unsigned char *) error);
+ }
+ else
+ msg = JvNewStringLatin1 ("out of memory");
+
+ using namespace gnu::classpath::jdwp::exception;
+ throw new JdwpInternalErrorException (msg);
+ }
+
+ JArray<VMMethod *> *result
+ = (JArray<VMMethod *> *) JvNewObjectArray (count,
+ &VMMethod::class$, NULL);
+ VMMethod **rmeth = elements (result);
+ for (int i = 0; i < count; ++i)
+ {
+ jlong id = reinterpret_cast<jlong> (methods[i]);
+ rmeth[i] = getClassMethod (klass, id);
+ }
+
+ _jdwp_jvmtiEnv->Deallocate ((unsigned char *) methods);
+ return result;
}
gnu::classpath::jdwp::VMMethod *