diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp index 02e5c03c..287c7538 100644 --- a/server/TracySourceView.cpp +++ b/server/TracySourceView.cpp @@ -617,6 +617,7 @@ void SourceView::RenderSymbolSourceView( uint32_t iptotal, unordered_flat_mapAddLine( wpos + ImVec2( 0, ty+2 ), wpos + ImVec2( w, ty+2 ), 0x08FFFFFF ); @@ -921,7 +926,11 @@ void SourceView::RenderAsmLine( const AsmLine& line, uint32_t ipcnt, uint32_t ip auto draw = ImGui::GetWindowDrawList(); const auto w = ImGui::GetWindowWidth(); const auto wpos = ImGui::GetCursorScreenPos(); - if( m_selectedAddresses.find( line.addr ) != m_selectedAddresses.end() ) + if( m_selectedAddressesHover.find( line.addr ) != m_selectedAddressesHover.end() ) + { + draw->AddRectFilled( wpos, wpos + ImVec2( w, ty+1 ), 0x22FFFFFF ); + } + else if( m_selectedAddresses.find( line.addr ) != m_selectedAddresses.end() ) { draw->AddRectFilled( wpos, wpos + ImVec2( w, ty+1 ), 0xFF333322 ); } @@ -1137,4 +1146,20 @@ void SourceView::SelectAsmLines( uint32_t file, uint32_t line, const Worker& wor } } +void SourceView::SelectAsmLinesHover( uint32_t file, uint32_t line, const Worker& worker ) +{ + assert( m_selectedAddressesHover.empty() ); + auto addresses = worker.GetAddressesForLocation( file, line ); + if( addresses ) + { + for( auto& v : *addresses ) + { + if( v >= m_baseAddr && v < m_baseAddr + m_codeLen ) + { + m_selectedAddressesHover.emplace( v ); + } + } + } +} + } diff --git a/server/TracySourceView.hpp b/server/TracySourceView.hpp index 42c83429..e0ba1129 100644 --- a/server/TracySourceView.hpp +++ b/server/TracySourceView.hpp @@ -68,6 +68,7 @@ private: void SelectLine( uint32_t line, const Worker* worker, bool changeAsmLine = true, uint64_t targetAddr = 0 ); void SelectAsmLines( uint32_t file, uint32_t line, const Worker& worker, bool changeAsmLine = true, uint64_t targetAddr = 0 ); + void SelectAsmLinesHover( uint32_t file, uint32_t line, const Worker& worker ); ImFont* m_font; const char* m_file; @@ -95,6 +96,7 @@ private: unordered_flat_map m_sourceFiles; unordered_flat_set m_selectedAddresses; + unordered_flat_set m_selectedAddressesHover; uint32_t m_maxLine; int m_maxMnemonicLen;