From 31a1517d2fd73651473ac210d7ab6e89a6ebbf66 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 27 Mar 2020 17:59:41 +0100 Subject: [PATCH] Display disassembly of inlined symbols. --- server/TracyView.cpp | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index e54b56d7..5d121cff 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -11373,6 +11373,7 @@ void View::DrawStatistics() uint32_t line = 0; bool isInline = false; uint32_t symlen = 0; + auto codeAddr = v.symAddr; auto sit = symMap.find( v.symAddr ); if( sit != symMap.end() ) @@ -11398,6 +11399,21 @@ void View::DrawStatistics() continue; } + if( symlen == 0 ) + { + uint32_t offset; + const auto parentAddr = m_worker.GetSymbolForAddress( v.symAddr, offset ); + if( parentAddr != 0 ) + { + auto pit = symMap.find( parentAddr ); + if( pit != symMap.end() ) + { + codeAddr = parentAddr; + symlen = pit->second.size.Val(); + } + } + } + if( isInline ) { TextDisabledUnformatted( ICON_FA_CARET_RIGHT ); @@ -11437,14 +11453,14 @@ void View::DrawStatistics() { if( SourceFileValid( file, m_worker.GetCaptureTime() ) ) { - SetTextEditorFile( file, line, v.symAddr ); + SetTextEditorFile( file, line, codeAddr, v.symAddr ); } else if( symlen != 0 ) { uint32_t len; - if( m_worker.GetSymbolCode( v.symAddr, len ) ) + if( m_worker.GetSymbolCode( codeAddr, len ) ) { - SetTextEditorFile( nullptr, 0, v.symAddr ); + SetTextEditorFile( nullptr, 0, codeAddr, v.symAddr ); } else { @@ -11479,7 +11495,15 @@ void View::DrawStatistics() TextDisabledUnformatted( buf ); } ImGui::NextColumn(); - if( symlen != 0 ) TextDisabledUnformatted( MemSizeToString( symlen ) ); + if( symlen != 0 ) + { + if( isInline ) + { + TextDisabledUnformatted( "<" ); + ImGui::SameLine(); + } + TextDisabledUnformatted( MemSizeToString( symlen ) ); + } ImGui::NextColumn(); } }