mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-27 00:04:35 +00:00
Try dladdr() resolution if libbacktrace fails.
This commit is contained in:
parent
49f1277e55
commit
17fb589415
@ -321,9 +321,23 @@ static int FastCallstackDataCb( void* data, uintptr_t pc, const char* fn, int li
|
|||||||
strcpy( (char*)data, function );
|
strcpy( (char*)data, function );
|
||||||
}
|
}
|
||||||
else
|
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';
|
*(char*)data = '\0';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user