mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Implement search for symbol base from address.
This commit is contained in:
@@ -2279,6 +2279,14 @@ const char* Worker::GetSymbolCode( uint64_t sym, uint32_t& len ) const
|
||||
return it->second.data;
|
||||
}
|
||||
|
||||
uint64_t Worker::GetSymbolForAddress( uint64_t address, uint32_t& offset ) const
|
||||
{
|
||||
auto it = std::lower_bound( m_data.symbolLoc.begin(), m_data.symbolLoc.end(), address, [] ( const auto& l, const auto& r ) { return l.addr + l.len < r; } );
|
||||
if( it == m_data.symbolLoc.end() || address < it->addr ) return 0;
|
||||
offset = address - it->addr;
|
||||
return it->addr;
|
||||
}
|
||||
|
||||
int64_t Worker::GetZoneEnd( const ZoneEvent& ev )
|
||||
{
|
||||
auto ptr = &ev;
|
||||
|
||||
Reference in New Issue
Block a user