GCC subscribes to a relatively-new cross-vendor ABI for C++, sometimes called the IA64 ABI because it happens to be the native ABI for that platform. It is summarized at http://www.codesourcery.com/cxx-abi/ along with the current specification.
For users of GCC greater than or equal to 3.x, entry points are available in <cxxabi.h>, which notes, "It is not normally necessary for user programs to include this header, or use the entry points directly. However, this header is available should that be needed."
| char* abi::__cxa_demangle | ( | const char * | mangled_name, | |
| char * | output_buffer, | |||
| size_t * | length, | |||
| int * | status | |||
| ) |
New ABI-mandated entry point in the C++ runtime library for demangling.
| mangled_name | A NUL-terminated character string containing the name to be demangled. | |
| output_buffer | A region of memory, allocated with malloc, of *length bytes, into which the demangled name is stored. If output_buffer is not long enough, it is expanded using realloc. output_buffer may instead be NULL; in that case, the demangled name is placed in a region of memory allocated with malloc. | |
| length | If length is non-NULL, the length of the buffer containing the demangled name is placed in *length. | |
| status | *status is set to one of the following values:
|
free.
<libiberty/demangle.h> and libiberty.a) in GCC 3.1 and later, but that requires explicit installation (--enable-install-libiberty) and uses a different API, although the ABI is unchanged.
1.5.1