mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-23 06:44:35 +00:00
Retrieve symbol address on old androids.
This commit is contained in:
parent
74aa3f861e
commit
fe80a7ed46
@ -526,6 +526,7 @@ CallstackEntryData DecodeCallstackPtr( uint64_t ptr )
|
|||||||
auto vptr = (void*)ptr;
|
auto vptr = (void*)ptr;
|
||||||
char** sym = nullptr;
|
char** sym = nullptr;
|
||||||
ptrdiff_t symoff = 0;
|
ptrdiff_t symoff = 0;
|
||||||
|
void* symaddr = nullptr;
|
||||||
|
|
||||||
Dl_info dlinfo;
|
Dl_info dlinfo;
|
||||||
if( dladdr( vptr, &dlinfo ) )
|
if( dladdr( vptr, &dlinfo ) )
|
||||||
@ -533,6 +534,7 @@ CallstackEntryData DecodeCallstackPtr( uint64_t ptr )
|
|||||||
symloc = dlinfo.dli_fname;
|
symloc = dlinfo.dli_fname;
|
||||||
symname = dlinfo.dli_sname;
|
symname = dlinfo.dli_sname;
|
||||||
symoff = (char*)ptr - (char*)dlinfo.dli_saddr;
|
symoff = (char*)ptr - (char*)dlinfo.dli_saddr;
|
||||||
|
symaddr = dlinfo.dli_saddr;
|
||||||
|
|
||||||
if( symname && symname[0] == '_' )
|
if( symname && symname[0] == '_' )
|
||||||
{
|
{
|
||||||
@ -580,10 +582,12 @@ CallstackEntryData DecodeCallstackPtr( uint64_t ptr )
|
|||||||
loc[loclen + addrlen] = '\0';
|
loc[loclen + addrlen] = '\0';
|
||||||
cb.file = loc;
|
cb.file = loc;
|
||||||
|
|
||||||
|
cb.symAddr = (uint64_t)symaddr;
|
||||||
|
|
||||||
if( sym ) free( sym );
|
if( sym ) free( sym );
|
||||||
if( demangled ) free( demangled );
|
if( demangled ) free( demangled );
|
||||||
|
|
||||||
return { &cb, 1 };
|
return { &cb, 1, CopyString( symloc ? symloc : "[unknown]" ) };
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user