diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp index 702c62c2..9156915d 100644 --- a/server/TracySourceView.cpp +++ b/server/TracySourceView.cpp @@ -744,7 +744,11 @@ uint64_t SourceView::RenderSymbolAsmView( uint32_t iptotal, unordered_flat_mapAddLine( wpos + ImVec2( xoff + JumpSeparation * ( mjl - v.second.level ), y0 + th2 ), wpos + ImVec2( xoff + JumpSeparation * ( mjl - v.second.level ), y1 + th2 ), col, thickness ); @@ -922,21 +929,39 @@ uint64_t SourceView::RenderSymbolAsmView( uint32_t iptotal, unordered_flat_map> ipData; ipData.reserve( ipcount.size() ); - for( size_t i=0; isecond > maxIpCount ) maxIpCount = it->second; - ipData.emplace_back( i, it->second ); + for( size_t i=0; isecond > maxIpCount ) maxIpCount = it->second; + ipData.emplace_back( i, it->second ); + } + } + else + { + for( size_t i=0; isecond > maxIpCount ) maxIpCount = it->second; + ipData.emplace_back( i, it->second ); + } } pdqsort_branchless( ipData.begin(), ipData.end(), []( const auto& l, const auto& r ) { return l.first < r.first; } ); const auto step = uint32_t( m_asm.size() * 2 / rect.GetHeight() ); - const auto x14 = round( rect.Min.x + rect.GetWidth() * 0.4f ); - const auto x34 = round( rect.Min.x + rect.GetWidth() * 0.6f ); + const auto x40 = round( rect.Min.x + rect.GetWidth() * 0.4f ); + const auto x60 = round( rect.Min.x + rect.GetWidth() * 0.6f ); auto it = ipData.begin(); while( it != ipData.end() ) @@ -950,7 +975,19 @@ uint64_t SourceView::RenderSymbolAsmView( uint32_t iptotal, unordered_flat_mapAddRectFilled( ImVec2( x14, ly ), ImVec2( x34, ly+3 ), color ); + draw->AddRectFilled( ImVec2( x40, ly ), ImVec2( x60, ly+3 ), color ); + } + + if( selJumpStart != 0 ) + { + const auto yStart = rect.Min.y + float( selJumpLineStart ) / m_asm.size() * rect.GetHeight(); + const auto yEnd = rect.Min.y + float( selJumpLineEnd ) / m_asm.size() * rect.GetHeight(); + const auto yTarget = rect.Min.y + float( selJumpLineTarget ) / m_asm.size() * rect.GetHeight(); + const auto x50 = round( rect.Min.x + rect.GetWidth() * 0.5f ) - 1; + const auto x25 = round( rect.Min.x + rect.GetWidth() * 0.25f ); + const auto x75 = round( rect.Min.x + rect.GetWidth() * 0.75f ); + draw->AddLine( ImVec2( x50, yStart ), ImVec2( x50, yEnd ), 0xFF00FF00 ); + draw->AddLine( ImVec2( x25, yTarget ), ImVec2( x75, yTarget ), 0xFF00FF00 ); } }