From 6fe3736a23e4489b4ee3c17743dbdb232aea609c Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 19 Jul 2020 23:43:52 +0200 Subject: [PATCH] When selecting function in symbol view, go to function location. --- server/TracySourceView.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp index 256eb3a0..ee385563 100644 --- a/server/TracySourceView.cpp +++ b/server/TracySourceView.cpp @@ -1060,6 +1060,22 @@ void SourceView::RenderSymbolView( const Worker& worker, View& view ) if( ImGui::Selectable( symName, v.first == m_symAddr, ImGuiSelectableFlags_SpanAllColumns ) ) { m_symAddr = v.first; + const auto sym = worker.GetSymbolData( v.first ); + const char* file; + uint32_t line; + if( sym->isInline ) + { + file = worker.GetString( sym->callFile ); + line = sym->callLine; + } + else + { + file = worker.GetString( sym->file ); + line = sym->line; + } + ParseSource( file, worker, view ); + m_targetLine = line; + SelectLine( line, &worker, true ); } ImGui::PopID(); ImGui::NextColumn();