public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [RFA] Implement VMVM.getSourceFile
@ 2007-02-17 17:06 Keith Seitz
  2007-03-03 18:36 ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: Keith Seitz @ 2007-02-17 17:06 UTC (permalink / raw)
  To: Java Patch List

[-- Attachment #1: Type: text/plain, Size: 615 bytes --]

Hi,

The following patch implements the JDWP function 
VMVirtualMachine.getSourceFile. It's pretty straightforward: I've simply 
added an accessor method to _Jv_InterpClass to get at the necessary data.

Ok?

Keith

ChangeLog
  2007-02-16  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.

[-- Attachment #2: getsourcefile.patch --]
[-- Type: text/x-patch, Size: 2111 bytes --]

Index: include/java-interp.h
===================================================================
--- include/java-interp.h	(revision 122057)
+++ include/java-interp.h	(working copy)
@@ -305,6 +305,7 @@
 #endif
 
   friend _Jv_MethodBase ** _Jv_GetFirstMethod (_Jv_InterpClass *klass);
+  friend jstring _Jv_GetInterpClassSourceFile (jclass);
 };
 
 extern inline _Jv_MethodBase **
Index: java/lang/Class.h
===================================================================
--- java/lang/Class.h	(revision 122057)
+++ java/lang/Class.h	(working copy)
@@ -255,6 +255,7 @@
 // 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);
@@ -553,6 +554,7 @@
 #ifdef INTERPRETER
   friend _Jv_MethodBase *(::_Jv_FindInterpreterMethod) (jclass klass,
 							jmethodID desired_method);
+  friend jstring ::_Jv_GetInterpClassSourceFile (jclass);
 #endif
   friend jbyte (::_Jv_GetClassState) (jclass klass);
 
Index: java/lang/natClass.cc
===================================================================
--- java/lang/natClass.cc	(revision 122057)
+++ java/lang/natClass.cc	(working copy)
@@ -2023,3 +2023,15 @@
   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;
+}
Index: gnu/classpath/jdwp/natVMVirtualMachine.cc
===================================================================
--- gnu/classpath/jdwp/natVMVirtualMachine.cc	(revision 122065)
+++ gnu/classpath/jdwp/natVMVirtualMachine.cc	(working copy)
@@ -628,9 +644,9 @@
 
 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFA] Implement VMVM.getSourceFile
  2007-02-17 17:06 [RFA] Implement VMVM.getSourceFile Keith Seitz
@ 2007-03-03 18:36 ` Tom Tromey
  2007-03-13 19:28   ` Keith Seitz
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2007-03-03 18:36 UTC (permalink / raw)
  To: Keith Seitz; +Cc: Java Patch List

>>>>> "Keith" == Keith Seitz <keiths@redhat.com> writes:

Keith> The following patch implements the JDWP function
Keith> VMVirtualMachine.getSourceFile. It's pretty straightforward: I've
Keith> simply added an accessor method to _Jv_InterpClass to get at the
Keith> necessary data.

Keith> Ok?

Ok, thanks.

Tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFA] Implement VMVM.getSourceFile
  2007-03-03 18:36 ` Tom Tromey
@ 2007-03-13 19:28   ` Keith Seitz
  0 siblings, 0 replies; 3+ messages in thread
From: Keith Seitz @ 2007-03-13 19:28 UTC (permalink / raw)
  To: Java Patch List

Tom Tromey wrote:

> Keith> Ok?
> 
> Ok, thanks.

Done.

Keith

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-03-13 19:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-17 17:06 [RFA] Implement VMVM.getSourceFile Keith Seitz
2007-03-03 18:36 ` Tom Tromey
2007-03-13 19:28   ` Keith Seitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).