+2007-01-25 Keith Seitz <keiths@redhat.com>
+
+ * 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.
+
2007-01-25 Andrew Haley <aph@redhat.com>
* configure, Makefile.in, include/config.h.in: Rebuilt.
// 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.
#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 *
/* jvmti-int.h -- Internal JVMTI definitions
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2007 Free Software Foundation, Inc.
This file is part of GNU Classpath.
For speed, this function should only be called after
JVMTI_REQUESTED_EVENT is checked. */
extern void _Jv_JVMTI_PostEvent (jvmtiEvent type, jthread event_thread, ...);
+// Returns the jvmtiEnv used by the JDWP backend
+extern jvmtiEnv *_Jv_GetJDWP_JVMTIEnv (void);
+
#endif /* __GCJ_JVMTI_INT_H__ */