From de3a48f958a04a1c33d5d0d3304cea64bcaa226d Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 29 Feb 2020 19:28:42 +0100 Subject: [PATCH] Better symbol information. --- server/TracyView.cpp | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 9ae7bb6b..df967200 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -13325,13 +13325,39 @@ void View::DrawSampleParents() ImGui::PopFont(); TextDisabledUnformatted( "Location:" ); ImGui::SameLine(); + const auto callFile = m_worker.GetString( symbol->callFile ); if( symbol->callLine > 0 ) { - ImGui::Text( "%s:%i", m_worker.GetString( symbol->file ), symbol->line ); + ImGui::Text( "%s:%i", callFile, symbol->callLine ); } else { - ImGui::TextUnformatted( m_worker.GetString( symbol->file ) ); + ImGui::TextUnformatted( callFile ); + } + if( ImGui::IsItemClicked( 1 ) ) + { + if( SourceFileValid( callFile, m_worker.GetCaptureTime() ) ) + { + SetTextEditorFile( callFile, symbol->callLine ); + } + } + TextDisabledUnformatted( "Entry point:" ); + ImGui::SameLine(); + const auto file = m_worker.GetString( symbol->file ); + if( symbol->line > 0 ) + { + ImGui::Text( "%s:%i", file, symbol->line ); + } + else + { + ImGui::TextUnformatted( file ); + } + if( ImGui::IsItemClicked( 1 ) ) + { + if( SourceFileValid( file, m_worker.GetCaptureTime() ) ) + { + SetTextEditorFile( file, symbol->line ); + } } ImGui::SameLine(); ImGui::Spacing();