Only show entry stacks button in symbol view when data is available.

The button was displayed unconditionally, allowing the sample entry
stacks window to be opened for symbols without any sample data. Gate it
on the availability of callstack sample statistics and a non-empty
reached map, following what the call stack window does. Checking for
statistics readiness also prevents asserting when the button is used
while a trace is still being loaded in the background.
This commit is contained in:
Bartosz Taudul
2026-07-25 18:41:55 +02:00
parent d5760a05ae
commit 34587e6b4c

View File

@@ -763,9 +763,16 @@ void SourceView::RenderSymbolView( Worker& worker, View& view, WindowConstraints
ImGui::TextDisabled( "(+%s inlined functions)", RealToString( inlineCount ) );
}
}
ImGui::SameLine();
ImGui::AlignTextToFramePadding();
if( ImGui::SmallButton( ICON_FA_ARROW_DOWN_SHORT_WIDE " Entry stacks" ) ) view.ShowSampleParents( m_symAddr, !m_calcInlineStats );
if( worker.AreCallstackSamplesReady() )
{
const auto stats = worker.GetSymbolStats( m_symAddr );
if( stats && !stats->wasReached.empty() )
{
ImGui::SameLine();
ImGui::AlignTextToFramePadding();
if( ImGui::SmallButton( ICON_FA_ARROW_DOWN_SHORT_WIDE " Entry stacks" ) ) view.ShowSampleParents( m_symAddr, !m_calcInlineStats );
}
}
if( inlineList )
{
if( m_calcInlineStats )