Created On:  01 February 2011

Problem:

  • Product Name: VisiBroker for C
  • Product Version: All
  • Product Component: C Compiler generated symbols
  • Platform/OS Version: All
C compilers may mangle the function prototypes during compilation. These mangled function prototypes are usually encountered when examining execution/core stacks. Demangling will make the stacks more readable.

Resolution:

c filt demangling tool is available for Unix-like platforms. For windows, MingGW or cygwin can provide this tool. c filt will do inverse mapping or ā€œdemangleā€ the symbols.
An example of using c filt in Solaris 10:

1.     For this example we want to demangle a single symbol.

__1cLVISDelegateS_verify_connection6MpnMCORBA_Object_C_v_

We will then pipe this symbol to c filt.

$ echo __1cLVISDelegateS_verify_connection6MpnMCORBA_Object_C_v_ | c filt
void VISDelegate::_verify_connection(CORBA_Object*,unsigned char)

2.     To demangle multiple symbols(e.g. pstack output or thread core stack) we can pass the symbols in a file to c filt.

$ pstack core > pstack.txt
$ c filt pstack.txt
or just pipe directly
$ pstack core | c filt
Other platforms may implement the usage of c filt differently. It is best to consult the man page of the tool on the platform being used.