Demangling of method names and addr2line/c++filt

Andrew Haley
Fri Feb 14 13:39:00 GMT 2003

Ranjit Mathew writes:
 > The problem is that we need to strip out (or not) an underscore
 > *depending on the actual source* of the mangled symbol:
 >   1. dladdr - gets from the exported labels, stripping allowed.
 >   2. addr2name.awk - uses nm, therefore, same as that for dladdr.

I don't know that anyone really uses this.  I don't want to delete it
though, because it is potentiallu useful.

 >   3. addr2line - uses debug info, therefore stripping not allowed
 >      (if target prefixes underscore to method name labels).
 > Note that for dladdr and addr2name.awk it is "stripping allowed" and
 > not "strip", as what is done by default by c++filt is target-dependent
 > and likely to be the correct behaviour.
 > The final logic then simply looks like:
 >   if ( usingAddr2Line && (USER_LABEL_PREFIX[0]=='_'))
 >     /* Explicitly pass "-n" to c++filt */
 > IMHO, this looks like the safest approach.
 > If this is OK, I can work towards a patch for this.



More information about the Java mailing list