mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-25 23:44:35 +00:00
Add context menu to left-click on item in symbol statistics list.
The context menu contains two items: 1. "View symbol", which shows the symbol code / disassembly. This was previously available by right-clicking on the source file name. 2. "Sample entry call stacks", which brings up the list window that was previously available with left-click on the entry line. This change intends to make the symbol view easier to discover.
This commit is contained in:
parent
384646b03b
commit
3e41052853
@ -424,7 +424,33 @@ void View::DrawSamplesStatistics( Vector<SymList>& data, int64_t timeRange, Accu
|
||||
ImGui::TextUnformatted( normalized );
|
||||
TooltipNormalizedName( name, normalized );
|
||||
}
|
||||
if( clicked ) ShowSampleParents( v.symAddr, !m_statSeparateInlines );
|
||||
if( clicked ) ImGui::OpenPopup( "menuPopup" );
|
||||
if( ImGui::BeginPopup( "menuPopup" ) )
|
||||
{
|
||||
uint32_t len;
|
||||
const bool sfv = SourceFileValid( file, m_worker.GetCaptureTime(), *this, m_worker ) || ( symlen != 0 && m_worker.GetSymbolCode( codeAddr, len ) );
|
||||
if( !sfv ) ImGui::BeginDisabled();
|
||||
if( ImGui::MenuItem( " " ICON_FA_FILE_LINES " View symbol" ) )
|
||||
{
|
||||
if( SourceFileValid( file, m_worker.GetCaptureTime(), *this, m_worker ) )
|
||||
{
|
||||
ViewSymbol( file, line, codeAddr, v.symAddr );
|
||||
if( !m_statSeparateInlines ) m_sourceView->CalcInlineStats( false );
|
||||
}
|
||||
else if( symlen != 0 )
|
||||
{
|
||||
uint32_t len;
|
||||
if( m_worker.GetSymbolCode( codeAddr, len ) )
|
||||
{
|
||||
ViewSymbol( nullptr, 0, codeAddr, v.symAddr );
|
||||
if( !m_statSeparateInlines ) m_sourceView->CalcInlineStats( false );
|
||||
}
|
||||
}
|
||||
}
|
||||
if( !sfv ) ImGui::EndDisabled();
|
||||
if( ImGui::MenuItem( ICON_FA_ARROW_DOWN_SHORT_WIDE " Sample entry call stacks" ) ) ShowSampleParents( v.symAddr, !m_statSeparateInlines );
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
ImGui::PopID();
|
||||
}
|
||||
if( parentName )
|
||||
@ -618,7 +644,33 @@ void View::DrawSamplesStatistics( Vector<SymList>& data, int64_t timeRange, Accu
|
||||
ImGui::TextUnformatted( normalized );
|
||||
TooltipNormalizedName( sn, normalized );
|
||||
}
|
||||
if( clicked ) ShowSampleParents( iv.symAddr, false );
|
||||
if( clicked ) ImGui::OpenPopup( "menuPopup" );
|
||||
if( ImGui::BeginPopup( "menuPopup" ) )
|
||||
{
|
||||
uint32_t len;
|
||||
const bool sfv = SourceFileValid( file, m_worker.GetCaptureTime(), *this, m_worker ) || ( symlen != 0 && m_worker.GetSymbolCode( codeAddr, len ) );
|
||||
if( !sfv ) ImGui::BeginDisabled();
|
||||
if( ImGui::MenuItem( " " ICON_FA_FILE_LINES " View symbol" ) )
|
||||
{
|
||||
if( SourceFileValid( file, m_worker.GetCaptureTime(), *this, m_worker ) )
|
||||
{
|
||||
ViewSymbol( file, line, codeAddr, iv.symAddr );
|
||||
if( !m_statSeparateInlines ) m_sourceView->CalcInlineStats( true );
|
||||
}
|
||||
else if( symlen != 0 )
|
||||
{
|
||||
uint32_t len;
|
||||
if( m_worker.GetSymbolCode( codeAddr, len ) )
|
||||
{
|
||||
ViewSymbol( nullptr, 0, codeAddr, iv.symAddr );
|
||||
if( !m_statSeparateInlines ) m_sourceView->CalcInlineStats( true );
|
||||
}
|
||||
}
|
||||
}
|
||||
if( !sfv ) ImGui::EndDisabled();
|
||||
if( ImGui::MenuItem( ICON_FA_ARROW_DOWN_SHORT_WIDE " Sample entry call stacks" ) ) ShowSampleParents( iv.symAddr, false );
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
ImGui::PopID();
|
||||
}
|
||||
if( sn == parentName )
|
||||
|
Loading…
Reference in New Issue
Block a user