Line stats may not exist, even if the line has attributed cost.

One scenario for this to happen is when there's children calls data in the
symbol.
This commit is contained in:
Bartosz Taudul 2023-03-01 19:28:58 +01:00
parent 897aec5b06
commit b89bfd44f1
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -3558,11 +3558,11 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr
if( hw ) PrintHwSampleTooltip( cycles, retired, cacheRef, cacheMiss, branchRetired, branchMiss, false );
const auto& stats = *worker.GetSymbolStats( symAddrParents );
if( !stats.parents.empty() )
const auto stats = worker.GetSymbolStats( symAddrParents );
if( stats && !stats->parents.empty() )
{
ImGui::Separator();
TextFocused( "Entry call stacks:", RealToString( stats.parents.size() ) );
TextFocused( "Entry call stacks:", RealToString( stats->parents.size() ) );
ImGui::SameLine();
TextDisabledUnformatted( "(middle click to view)" );
}
@ -3622,7 +3622,7 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr
m_asmSampleSelect.clear();
m_asmGroupSelect = -1;
}
else if( !stats.parents.empty() && ImGui::IsMouseClicked( 2 ) )
else if( stats && !stats->parents.empty() && ImGui::IsMouseClicked( 2 ) )
{
view.ShowSampleParents( symAddrParents, false );
}