This is the mail archive of the mailing list for the GCC project.

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

[patch] java run-time stack trace

If you call printStackTrace() on a Throwable, the output is demangled
in C++-style:

   at 0x40182616: java::lang::Class::forName(java::lang::String *, java::lang::ClassLoader *) (/home/bothner/GNU/linux/lib/

We probably want:

   at 0x40182616: java.lang.Class.forName(java.lang.String, java.lang.ClassLoader) (/home/bothner/GNU/linux/lib/

This patch accomplishes that.  It does have the undesirable side-effect that
C or C++ functions are are written Java-style (i.e no * or ::):

   at 0x40186645: _Jv_FindClass(_Jv_Utf8Const, java.lang.ClassLoader) (/home/bothner/GNU/linux/lib/

but I think that is reasonable enough for a Java stack printer.

Any objections to checking this in (now, before the branch)?

I believe glibc includes a demangler.  It would be better to use that
when available but that requires some configury magic.

2001-02-07  Per Bothner  <>

	* java/lang/ (CPlusPlusDemangler):  Pass -s java to
	c++filt to select java-style output.

RCS file: /cvs/gcc/gcc/libjava/java/lang/,v
retrieving revision 1.9
diff -u -r1.9
---	2000/12/22 06:19:24	1.9
+++	2001/02/08 03:46:46
@@ -57,7 +57,7 @@
   CPlusPlusDemangler (PrintWriter writer) throws IOException
     p = writer;
-    proc = Runtime.getRuntime ().exec ("c++filt");
+    proc = Runtime.getRuntime ().exec ("c++filt -s java");
     procOut = proc.getOutputStream ();
     procIn = proc.getInputStream ();

	--Per Bothner

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