The backtrace's elf symbols are not demangled, a demangler needs to be found and made available to frysk so that that can be done. Stan, I know you investigated this, can the info be summarized here so that, with a new bug, a decision can be made (and this bug closed) and a bug for the work created.
proposed demangle plan is to let libiberty do all the work: call cplus_demangle (libiberty::cplus-dem.c) which calls one of: cplus_demangle_v3 (libiberty::cp-demangle.c) java_demangle_v3 (libiberty::cp-demangle.c)
cplus_demangle and setting the demangler require header file demangle.h, which is not (yet) provided by binutils-devel. Other possibilities include http://gcc.gnu.org/ml/gcc-patches/2003-11/msg01626.html http://sources.redhat.com/ml/binutils/2003-07/msg00177.html The c++ demangler /usr/include/c++/4.1.1/cxxabi.h __cxa_demangle(const char* __mangled_name, char* __output_buffer, size_t* __length, int* __status);
Actually, seems like as long as demangle.h is included in frysk-imports and -liberty is added to GEN_GCJ_LDADD it's building. Currently it seems like -liberty needs to be added to each directory frysk-imports, frysk-sys, frysk-core, frysk-gtk and frysk-gui. I wonder if there is a way around this, Not doing so gives the error: (when not included in frysk-gtk) gcj-dbtool -a frysk-gtk.db.tmp frysk-gtk.jar libfrysk-gtk.so ../frysk-imports//libfrysk-imports.so: undefined reference to `cplus_demangle' collect2: ld returned 1 exit status make[3]: *** [fryski] Error 1
The problem with just adding a random demangle.h, is that there is no guarentee that it matches the installed libiberty.a library.
Managed to get cxa_demangle to work, the problem was that I wasn't including libstdc++ during load, (thanks to Kyle Galloway) so my little test program builds and outputs proper stuff, now to get the build system to accept it.
This code: #include <cxxabi.h> #include <stdio.h> #include <libiberty.h> /* * This is an ugly hack. In /usr/lib/ansidecl.h (included by libiberty.h) we have * #define VOLATILE volatile * This conflicts with /usr/include/c++/4.1.0/java/lang/reflect/Modifier.h: * static const jint VOLATILE = 64L; * And makes cni cry */ #undef VOLATILE #include <gcj/cni.h> #include "lib/iberty/Demangler.h" jstring lib::iberty::Demangler::demangler (const jstring mangled_string) { const char * mangled_name = (const char *) JvGetStringChars(mangled_string); int status = -1; char *dem = __cxa_demangle(mangled_name, 0, 0, &status); if(status == 0) return JvNewStringUTF(dem); else return mangled_string; } with this compile: g++ -DPACKAGE_NAME=\"frysk\" -DPACKAGE_TARNAME=\"frysk\" -DPACKAGE_VERSION=\"0.0.1.2006.12.08\" -DPACKAGE_STRING=\"frysk\ 0.0.1.2006.12.08\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"frysk\" -DVERSION=\"0.0.1.2006.12.08\" -I. -I/home/yyz/npremji/otherworkspace/frysk/frysk-imports -I/home/yyz/npremji/otherworkspace/frysk/frysk-imports -I/home/yyz/npremji/otherworkspace/frysk/frysk-imports/../frysk-imports -I. -I/home/yyz/npremji/otherworkspace/frysk/frysk-imports/../frysk-imports/elfutils/libelf -I/home/yyz/npremji/otherworkspace/frysk/frysk-imports/../frysk-imports/elfutils/libdw -I/home/yyz/npremji/otherworkspace/frysk/frysk-imports/../frysk-imports/elfutils/libdwfl -I/home/yyz/npremji/otherworkspace/frysk/frysk-imports/../frysk-imports/libunwind/include -I./../frysk-imports/libunwind/include -Werror -Wall -fPIC -I/home/yyz/npremji/otherworkspace/frysk/frysk-imports/include -g -O -c -o lib/iberty/cni/Demangler.o /home/yyz/npremji/otherworkspace/frysk/frysk-imports/lib/iberty/cni/Demangler.cxx Produces this error: /home/yyz/npremji/otherworkspace/frysk/frysk-imports/lib/iberty/cni/Demangler.cxx: In member function ‘java::lang::String* lib::iberty::Demangler::demangler(java::lang::String*)’: /home/yyz/npremji/otherworkspace/frysk/frysk-imports/lib/iberty/cni/Demangler.cxx:64: error: ‘__cxa_demangle’ was not declared in this scope make[3]: *** [lib/iberty/cni/Demangler.o] Error 1 I've also added lstdc++ to the GEN_GCJ_LDADD although I don't see it in the g++ command. I must admit I know almost nothing about linking
Fixed, took out the libiberty stuff, I don't know why I still had that, but the problem was I didn't have the line: using namespace abi. (Thanks to Andrew Cagney and Tom Tromey.) December 9, 2006 frysk-imports/lib/stdcpp/CL * TestDemangler.java: Added. * Demangler.java: Added. * cni/Demangler.cxx: Added. frysk-imports/CL * bootstrap.sh (FILE_LIST): Added lib/stdcpp. * Makefile.am (EXTRA_DIST): added lib/stdcpp/ChangeLog. (GEN_GCJ_LDADD): Added -lstdc++ frysk-core/CL frysk-gui/CL frysk-gtk/CL Makefile.am (GEN_GCJ_LDADD): Added -lstdc++
Created attachment 1455 [details] Mangled output of an fstack of eclipse java process
Created attachment 1456 [details] Demangled output of same eclipse java process
Finished, StackFrame now demangles method names so anything using this (i.e. fstack and sourcewindow) will have demangled names. December 11, 2006 frysk-core/frysk/rt/CL * StackFrame.java (toPrint): Demangle method names.