diff options
-rw-r--r-- | libjava/ChangeLog | 10 | ||||
-rw-r--r-- | libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc | 4 | ||||
-rw-r--r-- | libjava/include/java-interp.h | 1 | ||||
-rw-r--r-- | libjava/java/lang/Class.h | 2 | ||||
-rw-r--r-- | libjava/java/lang/natClass.cc | 12 |
5 files changed, 27 insertions, 2 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index a7e76ca..4d349a7 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,13 @@ +2007-03-13 Keith Seitz <keiths@redhat.com> + + * include/java-interp.h (_Jv_InterpClass): Declare + friend function _Jv_GetInterpClassSourceFile. + * java/lang/Class.h (Class): Likewise. + * java/lang/natClass.cc (_Jv_GetInterpClassSourceFile): + New function. + * gnu/classpath/jdwp/natVMVirtualMachine.cc + (getSourceFile): Implement. + 2007-03-13 Thomas Fitzsimmons <fitzsim@redhat.com> * Makefile.am (AM_CXXFLAGS): Define ECJ_JAR_FILE. diff --git a/libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc b/libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc index 3ea5f9a..2229a45 100644 --- a/libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc +++ b/libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc @@ -644,9 +644,9 @@ executeMethod (MAYBE_UNUSED jobject obj, MAYBE_UNUSED Thread *thread, jstring gnu::classpath::jdwp::VMVirtualMachine:: -getSourceFile (MAYBE_UNUSED jclass clazz) +getSourceFile (jclass clazz) { - return NULL; + return _Jv_GetInterpClassSourceFile (clazz); } // A simple caching function used while single-stepping diff --git a/libjava/include/java-interp.h b/libjava/include/java-interp.h index c294cc8..ee45faa 100644 --- a/libjava/include/java-interp.h +++ b/libjava/include/java-interp.h @@ -306,6 +306,7 @@ class _Jv_InterpClass #endif friend _Jv_MethodBase ** _Jv_GetFirstMethod (_Jv_InterpClass *klass); + friend jstring _Jv_GetInterpClassSourceFile (jclass); }; extern inline _Jv_MethodBase ** diff --git a/libjava/java/lang/Class.h b/libjava/java/lang/Class.h index 80c4100..af02198 100644 --- a/libjava/java/lang/Class.h +++ b/libjava/java/lang/Class.h @@ -267,6 +267,7 @@ _Jv_Utf8Const *_Jv_GetClassNameUtf8 (jclass); // Finds a desired interpreter method in the given class or NULL if not found class _Jv_MethodBase; _Jv_MethodBase *_Jv_FindInterpreterMethod (jclass, jmethodID); +jstring _Jv_GetInterpClassSourceFile (jclass); #endif jbyte _Jv_GetClassState (jclass); @@ -568,6 +569,7 @@ private: #ifdef INTERPRETER friend _Jv_MethodBase *(::_Jv_FindInterpreterMethod) (jclass klass, jmethodID desired_method); + friend jstring ::_Jv_GetInterpClassSourceFile (jclass); #endif friend jbyte (::_Jv_GetClassState) (jclass klass); diff --git a/libjava/java/lang/natClass.cc b/libjava/java/lang/natClass.cc index 79fa599..a6b353f 100644 --- a/libjava/java/lang/natClass.cc +++ b/libjava/java/lang/natClass.cc @@ -2064,3 +2064,15 @@ _Jv_GetClassState (jclass klass) return klass->state; } +jstring +_Jv_GetInterpClassSourceFile (jclass klass) +{ + if (_Jv_IsInterpretedClass (klass)) + { + _Jv_InterpClass *iclass = + reinterpret_cast<_Jv_InterpClass *> (klass->aux_info); + return iclass->source_file_name; + } + + return NULL; +} |