From dc84752fab40f34d43549f5e53503a2197b0d86f Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Mon, 15 Aug 2022 21:51:11 +0200 Subject: [PATCH] Normalize symbol view symbol name. --- server/TracySourceView.cpp | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp index 4d7c15e3..d3282e3e 100644 --- a/server/TracySourceView.cpp +++ b/server/TracySourceView.cpp @@ -13,6 +13,7 @@ #include "TracyPrint.hpp" #include "TracySort.hpp" #include "TracySourceView.hpp" +#include "TracyUtility.hpp" #include "TracyView.hpp" #include "TracyWorker.hpp" @@ -1096,7 +1097,17 @@ void SourceView::RenderSymbolView( Worker& worker, View& view ) auto parent = worker.GetSymbolData( m_baseAddr ); if( parent ) { - TextFocused( ICON_FA_PUZZLE_PIECE " Symbol:", worker.GetString( parent->name ) ); + const auto symName = worker.GetString( parent->name ); + if( view.GetShortenName() == ShortenName::Never ) + { + TextFocused( ICON_FA_PUZZLE_PIECE " Symbol:", symName ); + } + else + { + const auto normalized = ShortenZoneName( ShortenName::OnlyNormalize, symName ); + TextFocused( ICON_FA_PUZZLE_PIECE " Symbol:", normalized ); + TooltipNormalizedName( symName, normalized ); + } } else { @@ -1107,7 +1118,17 @@ void SourceView::RenderSymbolView( Worker& worker, View& view ) } else { - TextFocused( ICON_FA_PUZZLE_PIECE " Symbol:", worker.GetString( sym->name ) ); + const auto symName = worker.GetString( sym->name ); + if( view.GetShortenName() == ShortenName::Never ) + { + TextFocused( ICON_FA_PUZZLE_PIECE " Symbol:", symName ); + } + else + { + const auto normalized = ShortenZoneName( ShortenName::OnlyNormalize, symName ); + TextFocused( ICON_FA_PUZZLE_PIECE " Symbol:", normalized ); + TooltipNormalizedName( symName, normalized ); + } } ImGui::SameLine(); TextDisabledUnformatted( worker.GetString( sym->imageName ) );