aboutsummaryrefslogtreecommitdiff
path: root/libjava/jvmti.cc
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2006-10-28 02:15:12 +0000
committerKeith Seitz <kseitz@gcc.gnu.org>2006-10-28 02:15:12 +0000
commitf356a436f04c20db31d307e2e31e4dab21d0543b (patch)
treef282f5ddea71f48497a4039392fed5ec28964f5a /libjava/jvmti.cc
parent62baeb4f013e6f0a682f043dbd8720a558dec462 (diff)
downloadgcc-f356a436f04c20db31d307e2e31e4dab21d0543b.zip
gcc-f356a436f04c20db31d307e2e31e4dab21d0543b.tar.gz
gcc-f356a436f04c20db31d307e2e31e4dab21d0543b.tar.bz2
java-stack.h (ncodeMap): Declare.
* include/java-stack.h (ncodeMap): Declare. (_Jv_StackTrace): Make _Jv_GetMethodDeclaringClass friend. * java/lang/Class.h (_Jv_GetMethodDeclaringClass): Declare. * java/lang/natClass.cc (_Jv_GetMethodDeclaringClass): New function. * stacktrace.cc (ncodeMap): Redefine from file global to global for class _Jv_StackTrace. (_Jv_StackTrace::UpdateNCodeMap): Add interpreted classes, too, so that _Jv_GetMethodDeclaringClass can find them all. (_Jv_StackTrace::ClassForFrame): Exclude interpreted classes. * jvmti.cc (_Jv_JVMTI_GetMethodDeclaringClass): New function. (_Jv_JVMTI_Interface): Define GetMethodDeclaringClass function. From-SVN: r118100
Diffstat (limited to 'libjava/jvmti.cc')
-rw-r--r--libjava/jvmti.cc20
1 files changed, 19 insertions, 1 deletions
diff --git a/libjava/jvmti.cc b/libjava/jvmti.cc
index d1ad6e3..c1bdc78 100644
--- a/libjava/jvmti.cc
+++ b/libjava/jvmti.cc
@@ -466,6 +466,24 @@ _Jv_JVMTI_IsMethodSynthetic (MAYBE_UNUSED jvmtiEnv *env, jmethodID method,
}
static jvmtiError JNICALL
+_Jv_JVMTI_GetMethodDeclaringClass (MAYBE_UNUSED jvmtiEnv *env,
+ jmethodID method,
+ jclass *declaring_class_ptr)
+{
+ REQUIRE_PHASE (env, JVMTI_PHASE_LIVE);
+ NULL_CHECK (declaring_class_ptr);
+
+ jclass klass = _Jv_GetMethodDeclaringClass (method);
+ if (klass != NULL)
+ {
+ *declaring_class_ptr = klass;
+ return JVMTI_ERROR_NONE;
+ }
+
+ return JVMTI_ERROR_INVALID_METHODID;
+}
+
+static jvmtiError JNICALL
_Jv_JVMTI_GetClassLoaderClasses (MAYBE_UNUSED jvmtiEnv *env,
jobject init_loader,
jint *count_ptr,
@@ -1287,7 +1305,7 @@ struct _Jv_jvmtiEnv _Jv_JVMTI_Interface =
_Jv_JVMTI_GetFieldModifiers, // GetFieldModifiers
_Jv_JVMTI_IsFieldSynthetic, // IsFieldSynthetic
UNIMPLEMENTED, // GetMethodName
- UNIMPLEMENTED, // GetMethodDeclaringClass
+ _Jv_JVMTI_GetMethodDeclaringClass, // GetMethodDeclaringClass
_Jv_JVMTI_GetMethodModifiers, // GetMethodModifers
RESERVED, // reserved67
UNIMPLEMENTED, // GetMaxLocals