|
New ABI-mandated entry point in the C++ runtime library for demangling.
- Parameters:
-
| 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:
- 0: The demangling operation succeeded.
- -1: A memory allocation failiure occurred.
- -2: mangled_name is not a valid name under the C++ ABI mangling rules.
- -3: One of the arguments is invalid.
|
- Returns:
- A pointer to the start of the NUL-terminated demangled name, or NULL if the demangling fails. The caller is responsible for deallocating this memory using
free .
The demagling is performed using the C++ ABI mangling rules, with GNU extensions. For example, this function is used in __gnu_cxx::__verbose_terminate_handler. See http://gcc.gnu.org/onlinedocs/libstdc++/18_support/howto.html#5 for other examples of use.
- Note:
- The same demangling functionality is available via libiberty (
<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.
|