From 8c260c9d12127a77778b578d2ec8ea07eb209417 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 4 Apr 2020 14:29:07 +0200 Subject: [PATCH] Draw jump outs from symbols. --- server/TracySourceView.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp index e05b8631..f81bffa3 100644 --- a/server/TracySourceView.cpp +++ b/server/TracySourceView.cpp @@ -731,7 +731,22 @@ void SourceView::RenderAsmLine( const AsmLine& line, uint32_t ipcnt, uint32_t ip } if( m_showJumps ) { + const auto JumpArrow = JumpArrowBase * ty / 15;; ImGui::SameLine( 0, 2*ty + JumpArrow + m_maxJumpLevel * JumpSeparation ); + auto jit = m_jumpOut.find( line.addr ); + if( jit != m_jumpOut.end() ) + { + const auto ts = ImGui::CalcTextSize( " " ); + const auto th2 = floor( ts.y / 2 ); + const auto th4 = floor( ts.y / 4 ); + const auto& mjl = m_maxJumpLevel; + const auto col = GetHsvColor( line.jumpAddr, 6 ); + const auto xoff = ( iptotal == 0 ? 0 : ( 7 * ts.x + ts.y ) ) + 19 * ts.x + ( m_asmShowSourceLocation ? 36 * ts.x : 0 ); + + draw->AddLine( wpos + ImVec2( xoff + JumpSeparation * mjl + th2, th2 ), wpos + ImVec2( xoff + JumpSeparation * mjl + th2 + JumpArrow / 2, th2 ), col ); + draw->AddLine( wpos + ImVec2( xoff + JumpSeparation * mjl + th2, th2 ), wpos + ImVec2( xoff + JumpSeparation * mjl + th2 + th4, th2 - th4 ), col ); + draw->AddLine( wpos + ImVec2( xoff + JumpSeparation * mjl + th2, th2 ), wpos + ImVec2( xoff + JumpSeparation * mjl + th2 + th4, th2 + th4 ), col ); + } } else {