This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[RFA] Fix JVMTI method signatures
- From: Keith Seitz <keiths at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: Wed, 20 Jun 2007 18:11:38 -0700
- Subject: [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';
}