2018-04-09 13:52:39 +00:00
|
|
|
#include <common/demangle.h>
|
2017-12-08 01:34:52 +00:00
|
|
|
|
2018-05-25 18:13:48 +00:00
|
|
|
#if _MSC_VER
|
|
|
|
|
|
|
|
std::string demangle(const char * name, int & status)
|
|
|
|
{
|
|
|
|
status = 0;
|
|
|
|
return name;
|
|
|
|
}
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <cxxabi.h>
|
2017-12-08 01:34:52 +00:00
|
|
|
|
|
|
|
std::string demangle(const char * name, int & status)
|
|
|
|
{
|
|
|
|
std::string res;
|
|
|
|
|
|
|
|
char * demangled_str = abi::__cxa_demangle(name, 0, 0, &status);
|
|
|
|
if (demangled_str)
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
res = demangled_str;
|
|
|
|
}
|
|
|
|
catch (...)
|
|
|
|
{
|
|
|
|
free(demangled_str);
|
|
|
|
throw;
|
|
|
|
}
|
|
|
|
free(demangled_str);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
res = name;
|
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
2018-05-25 18:13:48 +00:00
|
|
|
|
|
|
|
#endif
|