]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
jvmti-int.h (_Jv_GetJDWP_JVMTIEnv): Declare.
authorKeith Seitz <keiths@redhat.com>
Thu, 25 Jan 2007 21:05:18 +0000 (21:05 +0000)
committerKeith Seitz <kseitz@gcc.gnu.org>
Thu, 25 Jan 2007 21:05:18 +0000 (21:05 +0000)
        * 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.

From-SVN: r121185

libjava/ChangeLog
libjava/gnu/classpath/jdwp/natVMMethod.cc
libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc
libjava/include/jvmti-int.h

index eb99fdf10601fb3114e44f043a21f4f90ced6467..37d61bcbb29609d6c9fd8a3094e875c4d1ae21b9 100644 (file)
@@ -1,3 +1,12 @@
+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.
index 7dea47477312527841d7f79d820ea3dd10a2d963..07d5622c70453ad164a5d9a83d765239a7bb629e 100644 (file)
@@ -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 *
index afdfbc72cef98ceee14b82c5109fbbbf2ef5a7a2..ef4fe281d2f87da1e7ff65b842aa09f89e045701 100644 (file)
@@ -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 ()
 {
index f88b4ce0a3a64d985707c9f2190f79f2ee8d30fb..822163afa0dcad04ddd9e34ab46dd5e68960c411 100644 (file)
@@ -1,5 +1,5 @@
 /* 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.
 
@@ -82,4 +82,7 @@ namespace JVMTI
    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__ */