From 59a49f0698645f35da5b4b7095f88ce88ced6d02 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Thu, 2 Apr 2020 00:53:27 +0200 Subject: [PATCH] Jump from assembly to source line. --- server/TracySourceView.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp index 5d022a39..d16da098 100644 --- a/server/TracySourceView.cpp +++ b/server/TracySourceView.cpp @@ -505,9 +505,18 @@ void SourceView::RenderAsmLine( const AsmLine& line, uint32_t ipcnt, uint32_t ip { if( m_font ) ImGui::PopFont(); ImGui::BeginTooltip(); - ImGui::Text( "%s:%i", worker.GetString( idx ), srcline ); + const auto fileName = worker.GetString( idx ); + ImGui::Text( "%s:%i", fileName, srcline ); ImGui::EndTooltip(); if( m_font ) ImGui::PushFont( m_font ); + + if( !m_lines.empty() && m_file == fileName && ImGui::IsItemClicked() ) + { + m_currentAddr = line.addr; + m_targetLine = srcline; + m_selectedLine = srcline; + m_showAsm = false; + } } } ImGui::SameLine( 0, ty );