This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] Fix JVMTI method signatures


Hi,

The attached patch "fixes" JVMTI method signatures returned from the GetMethodName function. Currently, gcj reports objects in signatures using '.' to separate package names, i.e., "Ljava.lang.Object;". JDWP requires this to be "Ljava/lang/Object;".

I've double-checked a JVMTI agent with Sun's HotSpot VM, and it, too, uses the dotted notation for this. [Not to mention that Eclipse simply will not work with "Ljava.lang.Object;"...]

QCC?
Keith

ChangeLog
2007-07-20  Keith Seitz  <keiths@redhat.com>

        * jvmti.cc (_Jv_JVMTI_GetMethodName): When computing the method's
        signature, convert '.' into '/'.
Index: jvmti.cc
===================================================================
--- jvmti.cc	(revision 125863)
+++ jvmti.cc	(working copy)
@@ -937,7 +937,10 @@
 	    _Jv_Free (*name_ptr);
 	  return JVMTI_ERROR_OUT_OF_MEMORY;
 	}
-      strncpy (*signature_ptr, method->signature->chars (), len);
+
+      char *chars = method->signature->chars ();
+      for (int i = 0; i < len; ++i)
+	(*signature_ptr)[i] = (chars[i] == '.') ? '/' : chars[i];
       (*signature_ptr)[len] = '\0';
     }
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]