mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-12 19:31:47 +00:00
Allow GetSymbolStats() to fail gracefully.
This commit is contained in:
parent
9b53792f20
commit
39361f71a1
@ -13292,7 +13292,7 @@ void View::DrawAnnotationList()
|
|||||||
void View::DrawSampleParents()
|
void View::DrawSampleParents()
|
||||||
{
|
{
|
||||||
const auto symbol = m_worker.GetSymbolData( m_sampleParents.symAddr );
|
const auto symbol = m_worker.GetSymbolData( m_sampleParents.symAddr );
|
||||||
const auto stats = m_worker.GetSymbolStats( m_sampleParents.symAddr );
|
const auto stats = *m_worker.GetSymbolStats( m_sampleParents.symAddr );
|
||||||
assert( !stats.parents.empty() );
|
assert( !stats.parents.empty() );
|
||||||
|
|
||||||
bool show = true;
|
bool show = true;
|
||||||
|
@ -2349,12 +2349,18 @@ const Worker::SourceLocationZones& Worker::GetZonesForSourceLocation( int16_t sr
|
|||||||
return it != m_data.sourceLocationZones.end() ? it->second : empty;
|
return it != m_data.sourceLocationZones.end() ? it->second : empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
const SymbolStats& Worker::GetSymbolStats( uint64_t symAddr ) const
|
const SymbolStats* Worker::GetSymbolStats( uint64_t symAddr ) const
|
||||||
{
|
{
|
||||||
assert( AreCallstackSamplesReady() );
|
assert( AreCallstackSamplesReady() );
|
||||||
auto it = m_data.symbolStats.find( symAddr );
|
auto it = m_data.symbolStats.find( symAddr );
|
||||||
assert( it != m_data.symbolStats.end() );
|
if( it == m_data.symbolStats.end() )
|
||||||
return it->second;
|
{
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return &it->second;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -448,7 +448,7 @@ public:
|
|||||||
|
|
||||||
const unordered_flat_map<uint64_t, SymbolData>& GetSymbolMap() const { return m_data.symbolMap; }
|
const unordered_flat_map<uint64_t, SymbolData>& GetSymbolMap() const { return m_data.symbolMap; }
|
||||||
const unordered_flat_map<uint64_t, SymbolStats>& GetSymbolStats() const { return m_data.symbolStats; }
|
const unordered_flat_map<uint64_t, SymbolStats>& GetSymbolStats() const { return m_data.symbolStats; }
|
||||||
const SymbolStats& GetSymbolStats( uint64_t symAddr ) const;
|
const SymbolStats* GetSymbolStats( uint64_t symAddr ) const;
|
||||||
bool AreCallstackSamplesReady() const { return m_data.callstackSamplesReady; }
|
bool AreCallstackSamplesReady() const { return m_data.callstackSamplesReady; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user