libgcj/1907: symbol demangling by Throwable.printStackTrace

Per Bothner bothner@bothner.com
Wed Feb 7 21:46:00 GMT 2001


>Number:         1907
>Category:       libgcj
>Synopsis:       symbol demangling by Throwable.printStackTrace
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Feb 07 21:46:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Per Bothner
>Release:        2.97 20010207 (experimental)
>Organization:
self
>Environment:
System: Linux kelso.bothner.com 2.4.0-test11 #1 Wed Nov 29 14:11:55 PST 2000 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: /home/bothner/GNU/gcc/configure --enable-threads=posix --prefix=/home/bothner/GNU/linux --enable-shared --enable-languages=c++,java
>Description:
The implementation of printStackTrace (PrintWriter) in java/lang/Throwable.java
has various problems in how it handles symbol demangling:
(1) Filtering through an external program is unreliable (though at least
there is a backup to print stack trace without demangling).

(2) Having a *target* library use a *host* program for filtering is
especially wrong.

(3) We want Java style demangling for Java methods, but it would be
nice to have C++ style demangling for C++ methods.

(4) Glibc has (I believe) support for name demangling - it would
save space if we could use it.
>How-To-Repeat:
	Look at the code.
>Fix:
The solution to (1) and (2) these problems is to write a native method that
calls cplus_demangle, from the target version of libiberty.

We can solve (3) because we can selectively (on a line-by-line bases)
decide whether to use Java or C++ style output.  This gets a little
tricky with CNI native methods:  They should be written in Java style,
but then how do we distinguish Java and C++ methods - we cannot look
at the file extension.  Perhaps we really needs some distinction is
the mangled name to signfify a Java method.

For (4) we need configuration magic to determine if the C library
has a compatible cplus_demangle.

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the Gcc-bugs mailing list