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

@ -322,7 +322,21 @@ static int FastCallstackDataCb( void* data, uintptr_t pc, const char* fn, int li
}
else
{
*(char*)data = '\0';
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;
}