mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 22:44:34 +00:00
Try dladdr() resolution if libbacktrace fails.
This commit is contained in:
parent
49f1277e55
commit
17fb589415
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user