summaryrefslogtreecommitdiff
path: root/libjava/jvmti.cc
diff options
context:
space:
mode:
authorkseitz <kseitz@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-28 02:15:12 +0000
committerkseitz <kseitz@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-28 02:15:12 +0000
commit1c243862a860de6b5f737776486d39b1b01d2007 (patch)
treef282f5ddea71f48497a4039392fed5ec28964f5a /libjava/jvmti.cc
parentc4f8e01fdac5dd7343fab916f393f73220538a6c (diff)
downloadgcc-1c243862a860de6b5f737776486d39b1b01d2007.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@118100 138bc75d-0d04-0410-961f-82ee72b054a4
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 d1ad6e3fcb0..c1bdc788411 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