1
0
mirror of https://github.com/wolfpld/tracy synced 2025-05-03 06:03:51 +00:00

Get location for address from callstack frame data.

This commit is contained in:
Bartosz Taudul 2022-10-11 21:47:28 +02:00
parent 4d0768ba9d
commit ac6902501a
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -2587,16 +2587,17 @@ uint64_t Worker::GetInlineSymbolForAddress( uint64_t address ) const
StringIdx Worker::GetLocationForAddress( uint64_t address, uint32_t& line ) const StringIdx Worker::GetLocationForAddress( uint64_t address, uint32_t& line ) const
{ {
auto it = m_data.codeAddressToLocation.find( address ); auto frame = GetCallstackFrame( PackPointer( address ) );
if( it == m_data.codeAddressToLocation.end() ) if( !frame )
{ {
line = 0; line = 0;
return StringIdx(); return StringIdx();
} }
else else
{ {
const auto idx = UnpackFileLine( it->second, line ); auto subFrame = frame->data[0];
return StringIdx( idx ); line = subFrame.line;
return subFrame.file;
} }
} }