From d3cb8ccef2dd1182ee21be3f2c116c156f3b0d4c Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Mon, 15 Aug 2022 22:44:31 +0200 Subject: [PATCH] Normalize jump names in assembly lines. --- server/TracySourceView.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp index 347aca83..ae1736c3 100644 --- a/server/TracySourceView.cpp +++ b/server/TracySourceView.cpp @@ -4204,14 +4204,18 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr if( jumpName ) { + const auto normalized = view.GetShortenName() != ShortenName::Never ? ShortenZoneName( ShortenName::OnlyNormalize, jumpName ) : jumpName; ImGui::SameLine(); ImGui::Spacing(); ImGui::SameLine(); if( jumpBase == m_baseAddr ) { - ImGui::TextDisabled( " -> [%s+%" PRIu32"]", jumpName, jumpOffset ); + ImGui::TextDisabled( " -> [%s+%" PRIu32"]", normalized, jumpOffset ); if( ImGui::IsItemHovered() ) { + UnsetFont(); + TooltipNormalizedName( jumpName, normalized ); + SetFont(); m_highlightAddr = line.jumpAddr; if( ImGui::IsItemClicked() ) { @@ -4223,8 +4227,14 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr } else { - ImGui::TextDisabled( " [%s+%" PRIu32"]", jumpName, jumpOffset ); - if( ImGui::IsItemClicked() ) jumpOut = line.jumpAddr; + ImGui::TextDisabled( " [%s+%" PRIu32"]", normalized, jumpOffset ); + if( ImGui::IsItemHovered() ) + { + UnsetFont(); + TooltipNormalizedName( jumpName, normalized ); + SetFont(); + if( ImGui::IsItemClicked() ) jumpOut = line.jumpAddr; + } } }