1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 20:33:52 +00:00

Display base function is symbol as '[ - self - ]'.

This commit is contained in:
Bartosz Taudul 2020-05-25 21:37:17 +02:00
parent 39ce605711
commit 898a10ef82
2 changed files with 5 additions and 3 deletions

View File

@ -962,7 +962,8 @@ void SourceView::RenderSymbolView( const Worker& worker, View& view )
ImGui::SameLine(); ImGui::SameLine();
ImGui::SetNextItemWidth( -1 ); ImGui::SetNextItemWidth( -1 );
ImGui::PushStyleVar( ImGuiStyleVar_FramePadding, ImVec2( 0, 0 ) ); ImGui::PushStyleVar( ImGuiStyleVar_FramePadding, ImVec2( 0, 0 ) );
if( ImGui::BeginCombo( "##functionList", worker.GetString( sym->name ), ImGuiComboFlags_HeightLarge ) ) const auto currSymName = m_symAddr == m_baseAddr ? "[ - self - ]" : worker.GetString( sym->name );
if( ImGui::BeginCombo( "##functionList", currSymName, ImGuiComboFlags_HeightLarge ) )
{ {
uint32_t totalSamples = 0; uint32_t totalSamples = 0;
const auto& symStat = worker.GetSymbolStats(); const auto& symStat = worker.GetSymbolStats();
@ -1046,7 +1047,8 @@ void SourceView::RenderSymbolView( const Worker& worker, View& view )
auto isym = worker.GetSymbolData( v.first ); auto isym = worker.GetSymbolData( v.first );
assert( isym ); assert( isym );
ImGui::PushID( v.first ); ImGui::PushID( v.first );
if( ImGui::Selectable( worker.GetString( isym->name ), v.first == m_symAddr, ImGuiSelectableFlags_SpanAllColumns ) ) const auto symName = v.first == m_baseAddr ? "[ - self - ]" : worker.GetString( isym->name );
if( ImGui::Selectable( symName, v.first == m_symAddr, ImGuiSelectableFlags_SpanAllColumns ) )
{ {
m_symAddr = v.first; m_symAddr = v.first;
} }

View File

@ -11995,7 +11995,7 @@ void View::DrawStatistics()
break; break;
} }
const auto sn = iv.symAddr == v.symAddr ? "[self time]" : name; const auto sn = iv.symAddr == v.symAddr ? "[ - self - ]" : name;
if( iv.excl == 0 ) if( iv.excl == 0 )
{ {
ImGui::TextUnformatted( sn ); ImGui::TextUnformatted( sn );