From 5233f8d4ad5925e5636d51746d1f2784ce14576c Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Mon, 13 Apr 2020 17:47:41 +0200 Subject: [PATCH] Mark source lines which generated assembly. --- server/TracySourceView.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp index debe9c03..272c6139 100644 --- a/server/TracySourceView.cpp +++ b/server/TracySourceView.cpp @@ -825,6 +825,24 @@ void SourceView::RenderSymbolSourceView( uint32_t iptotal, unordered_flat_map> ipData; ipData.reserve( ipcount.size() ); for( auto& v : ipcount ) ipData.emplace_back( v.first, v.second ); + for( uint32_t lineNum = 1; lineNum <= m_lines.size(); lineNum++ ) + { + if( ipcount.find( lineNum ) == ipcount.end() ) + { + auto addresses = worker.GetAddressesForLocation( m_fileStringIdx, lineNum ); + if( addresses ) + { + for( auto& addr : *addresses ) + { + if( addr >= m_baseAddr && addr < m_baseAddr + m_codeLen ) + { + ipData.emplace_back( lineNum, 0 ); + break; + } + } + } + } + } pdqsort_branchless( ipData.begin(), ipData.end(), []( const auto& l, const auto& r ) { return l.first < r.first; } ); const auto step = uint32_t( m_lines.size() * 2 / rect.GetHeight() ); @@ -842,7 +860,7 @@ void SourceView::RenderSymbolSourceView( uint32_t iptotal, unordered_flat_mapAddRectFilled( ImVec2( x14, ly ), ImVec2( x34, ly+3 ), color ); }