From 414f467c6ef5ef314c081b82d88fad9f0c81dc4f Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 19 Aug 2022 12:50:47 +0200 Subject: [PATCH] More jump targets to normalize. --- server/TracySourceView.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp index 3b0246c5..844c60d4 100644 --- a/server/TracySourceView.cpp +++ b/server/TracySourceView.cpp @@ -3909,12 +3909,14 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr uint32_t jumpOffset; uint64_t jumpBase; const char* jumpName = nullptr; + const char* normalized = nullptr; if( line.jumpAddr != 0 ) { jumpOffset = 0; jumpBase = worker.GetSymbolForAddress( line.jumpAddr, jumpOffset ); auto jumpSym = jumpBase == 0 ? worker.GetSymbolData( line.jumpAddr ) : worker.GetSymbolData( jumpBase ); if( jumpSym ) jumpName = worker.GetString( jumpSym->name ); + if( jumpName ) normalized = view.GetShortenName() != ShortenName::Never ? ShortenZoneName( ShortenName::OnlyNormalize, jumpName ) : jumpName; } if( ImGui::IsItemHovered() ) @@ -3938,7 +3940,7 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr TextDisabledUnformatted( "External target:" ); } ImGui::SameLine(); - ImGui::Text( "%s+%" PRIu32, jumpName, jumpOffset ); + ImGui::Text( "%s+%" PRIu32, normalized, jumpOffset ); if( jumpBase == m_baseAddr ) { uint32_t srcline; @@ -4077,7 +4079,7 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr TextDisabledUnformatted( "External target:" ); } ImGui::SameLine(); - ImGui::Text( "%s+%" PRIu32, jumpName, jumpOffset ); + ImGui::Text( "%s+%" PRIu32, normalized, jumpOffset ); if( jumpBase == m_baseAddr ) { uint32_t srcline; @@ -4239,7 +4241,6 @@ 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();