Undecorate symbol name.
Provides undecoration of C++ names and decorated C names. The behavior of this function
is compiler and OS specific.
The C++ mangled name is undecorated either to its full signature (UNDECORATION_COMPLETE style)
or to [scope::]name form (UNDECORATION_NAME_ONLY style).
Example of undecoration of symbol generated by Microsoft compiler in Windows:
Style Original name Undecorated name
===================== ================== ======================================
Symbol name decorated according to Windows IA32 C calling conventions is undecorated as follows:
_foo -> foo (__cdecl convention)
_foo@4 -> foo (__stdcall convention)
@foo@12 -> foo (__fastcall convention)
Example of undecoration of symbol generated by GCC compiler on Linux:
Style Original name Undecorated name
===================== ================== ======================================
UNDECORATION_COMPLETE _ZN1A7method1ERKSt6vectorIiSaIiEE A::method1(std::vector<
int, std::allocator<int> >
const&)
Undecoration of macOS* symbols is done similarly to Linux (Remove the leading '_' and undecorate like Linux)
You should be careful if using this function, since some of the undecorated names it generates for symbols generated by the compiler may not be valid C++ symbol names. For example on Linux demangling can give names like construction vtable for std::istream-in-std::iostream
, or non-virtual thunk to std::strstream::~strstream()
, which are not valid C++ names.
- Parameters
-
[in] | symbolName | Decorated name
|
[in] | style | Undecoration style, relevant only to C++ undecoration
Values:
UNDECORATION_COMPLETE undecorate to full signature
UNDECORATION_NAME_ONLY undecorate to [scope::]name
|
- Returns
- string containing undecorated symbol name.
If undecoration fails or not supported, the function returns the unmodified original name.
- Availability:
- Mode: JIT & Probe
O/S: Windows, Linux & macOS*
CPU: All