Add symbol code accessor.

This commit is contained in:
Bartosz Taudul 2020-03-25 22:15:22 +01:00
parent 53d0b91f26
commit 79db7f4457
2 changed files with 9 additions and 0 deletions

View File

@ -2265,6 +2265,14 @@ const SymbolData* Worker::GetSymbolData( uint64_t sym ) const
}
}
const char* Worker::GetSymbolCode( uint64_t sym, uint32_t& len ) const
{
auto it = m_data.symbolCode.find( sym );
if( it == m_data.symbolCode.end() ) return nullptr;
len = it->second.len;
return it->second.data;
}
int64_t Worker::GetZoneEnd( const ZoneEvent& ev )
{
auto ptr = &ev;

View File

@ -429,6 +429,7 @@ public:
const CallstackFrameData* GetCallstackFrame( const CallstackFrameId& ptr ) const;
uint64_t GetCanonicalPointer( const CallstackFrameId& id ) const;
const SymbolData* GetSymbolData( uint64_t sym ) const;
const char* GetSymbolCode( uint64_t sym, uint32_t& len ) const;
#ifndef TRACY_NO_STATISTICS
const VarArray<CallstackFrameId>& GetParentCallstack( uint32_t idx ) const { return *m_data.parentCallstackPayload[idx]; }