MCPcopy Create free account
hub / github.com/Icinga/icinga2 / DemangleSymbolName

Method DemangleSymbolName

lib/base/utility.cpp:78–100  ·  view source on GitHub ↗

* Demangles a symbol name. * * @param sym The symbol name. * @returns A human-readable version of the symbol name. */

Source from the content-addressed store, hash-verified

76 * @returns A human-readable version of the symbol name.
77 */
78String Utility::DemangleSymbolName(const String& sym)
79{
80 String result = sym;
81
82#ifdef HAVE_CXXABI_H
83 int status;
84 char *realname = abi::__cxa_demangle(sym.CStr(), nullptr, nullptr, &status);
85
86 if (realname) {
87 result = String(realname);
88 free(realname);
89 }
90#elif defined(_MSC_VER) /* HAVE_CXXABI_H */
91 CHAR output[256];
92
93 if (UnDecorateSymbolName(sym.CStr(), output, sizeof(output), UNDNAME_COMPLETE) > 0)
94 result = output;
95#else /* _MSC_VER */
96 /* We're pretty much out of options here. */
97#endif /* _MSC_VER */
98
99 return result;
100}
101
102/**
103 * Returns a human-readable type name of a type_info object.

Callers

nothing calls this directly

Calls 2

CStrMethod · 0.80
StringClass · 0.70

Tested by

no test coverage detected