diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp index 55528a7c..1bf5dd47 100644 --- a/server/TracySourceView.cpp +++ b/server/TracySourceView.cpp @@ -2095,6 +2095,10 @@ void SourceView::RenderAsmLine( const AsmLine& line, uint32_t ipcnt, uint32_t ip { TextColoredUnformatted( ImVec4( 1, 0.25f, 0.25f, 1 ), buf ); } + else if( line.regData[0] != 0 ) + { + TextColoredUnformatted( ImVec4( 1, 0.5f, 1, 1 ), buf ); + } else { ImGui::TextUnformatted( buf ); @@ -2263,6 +2267,34 @@ void SourceView::RenderAsmLine( const AsmLine& line, uint32_t ipcnt, uint32_t ip } } + if( line.regData[0] != 0 ) + { + ImGui::SameLine(); + ImGui::Spacing(); + ImGui::SameLine(); + TextColoredUnformatted( ImVec4( 0.5f, 0.5, 1, 1 ), "{" ); + ImGui::SameLine( 0, 0 ); + int idx = 0; + for(;;) + { + ImVec4 col; + if( line.regData[idx] == 0 ) break; + if( ( line.regData[idx] & ( WriteBit | ReadBit ) ) == ( WriteBit | ReadBit ) ) col = ImVec4( 1, 1, 0.5f, 1 ); + else if( line.regData[idx] & WriteBit ) col = ImVec4( 1, 0.5f, 0.5f, 1 ); + else if( line.regData[idx] & ReadBit ) col = ImVec4( 0.5f, 1, 0.5f, 1 ); + else col = ImVec4( 0.5f, 0.5f, 0.5f, 1 ); + if( idx > 0 ) + { + ImGui::SameLine( 0, 0 ); + TextColoredUnformatted( ImVec4( 0.5f, 0.5, 1, 1 ), ", " ); + ImGui::SameLine( 0, 0 ); + } + TextColoredUnformatted( col, s_regNameX86[line.regData[idx++] & RegMask] ); + } + ImGui::SameLine( 0, 0 ); + TextColoredUnformatted( ImVec4( 0.5f, 0.5, 1, 1 ), "}" ); + } + if( line.jumpAddr != 0 ) { uint32_t offset = 0; diff --git a/server/TracySourceView.hpp b/server/TracySourceView.hpp index ea5992b2..ab3311fb 100644 --- a/server/TracySourceView.hpp +++ b/server/TracySourceView.hpp @@ -81,6 +81,11 @@ private: rd }; + enum { ReadBit = 0x100 }; + enum { WriteBit = 0x200 }; + enum { ReuseBit = 0x400 }; + enum { RegMask = 0x0FF }; + struct AsmLine { uint64_t addr;