Try dladdr() resolution if libbacktrace fails.

This commit is contained in:
Bartosz Taudul 2019-03-05 20:43:47 +01:00
parent 49f1277e55
commit 17fb589415

View File

@ -321,9 +321,23 @@ static int FastCallstackDataCb( void* data, uintptr_t pc, const char* fn, int li
strcpy( (char*)data, function );
}
else
{
const char* symname = nullptr;
auto vptr = (void*)pc;
Dl_info dlinfo;
if( dladdr( vptr, &dlinfo ) )
{
symname = dlinfo.dli_sname;
}
if( symname )
{
strcpy( (char*)data, symname );
}
else
{
*(char*)data = '\0';
}
}
return 1;
}