Retrieve image name on unix.

This commit is contained in:
Bartosz Taudul 2020-02-26 02:11:51 +01:00
parent fe80a7ed46
commit 9231261d73

View File

@ -484,7 +484,12 @@ CallstackEntryData DecodeCallstackPtr( uint64_t ptr )
cb_num = 0;
backtrace_pcinfo( cb_bts, ptr, CallstackDataCb, CallstackErrorCb, nullptr );
assert( cb_num > 0 );
return { cb_data, uint8_t( cb_num ) };
const char* symloc = nullptr;
Dl_info dlinfo;
if( dladdr( (void*)ptr, &dlinfo ) ) symloc = dlinfo.dli_fname;
return { cb_data, uint8_t( cb_num ), CopyString( symloc ? symloc : "[unknown]" ) };
}
#elif TRACY_HAS_CALLSTACK == 5