mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-25 21:40:33 +05:00
Catch exceptions in Demangle()
This commit is contained in:
parent
2bd9acdd9e
commit
c9e764a32f
@ -15,10 +15,22 @@ namespace ngcore
|
|||||||
// windows does demangling in typeid(T).name()
|
// windows does demangling in typeid(T).name()
|
||||||
NGCORE_API std::string Demangle(const char* typeinfo) { return typeinfo; }
|
NGCORE_API std::string Demangle(const char* typeinfo) { return typeinfo; }
|
||||||
#else
|
#else
|
||||||
NGCORE_API std::string Demangle(const char* typeinfo) { int status; return abi::__cxa_demangle(typeinfo,
|
NGCORE_API std::string Demangle(const char* typeinfo)
|
||||||
nullptr,
|
{
|
||||||
nullptr,
|
int status=0;
|
||||||
&status); }
|
try
|
||||||
|
{
|
||||||
|
char *s = abi::__cxa_demangle(typeinfo, nullptr, nullptr, &status);
|
||||||
|
std::string result{s};
|
||||||
|
free(s);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
catch( const std::exception & e )
|
||||||
|
{
|
||||||
|
GetLogger("utils")->warn("{}:{} cannot demangle {}, status: {}, error:{}", __FILE__, __LINE__, typeinfo, status, e.what());
|
||||||
|
}
|
||||||
|
return typeinfo;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
double seconds_per_tick = [] () noexcept
|
double seconds_per_tick = [] () noexcept
|
||||||
|
Loading…
Reference in New Issue
Block a user