From 7365dea255bd442cb1a09769c1e17c3a6f7ef77a Mon Sep 17 00:00:00 2001 From: simplyWiri Date: Sun, 28 Aug 2022 22:05:53 +1000 Subject: [PATCH] Add ability to right click and jump to assembly location in symbol view from source --- server/TracySourceView.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp index 844c60d4..fe199b09 100644 --- a/server/TracySourceView.cpp +++ b/server/TracySourceView.cpp @@ -3293,7 +3293,10 @@ void SourceView::RenderLine( const Tokenizer::Line& line, int lineNum, const Add if( !mouseHandled && ( ImGui::IsMouseClicked( 0 ) || ImGui::IsMouseClicked( 1 ) ) ) { m_displayMode = DisplayMixed; - SelectLine( lineNum, worker, ImGui::IsMouseClicked( 1 ) ); + auto targetAddresses = worker->GetAddressesForLocation( m_source.idx(), lineNum ); + auto hasTarget = targetAddresses && !targetAddresses->empty(); + auto midAddress = hasTarget ? targetAddresses->operator[]( targetAddresses->size() / 2 ) : 0; + SelectLine( lineNum, worker, ImGui::IsMouseClicked( 1 ), midAddress ); } else {