Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Taudul <wolf@nereid.pl>2022-09-16 01:30:56 +0300
committerBartosz Taudul <wolf@nereid.pl>2022-09-16 01:30:56 +0300
commit0a69ef3b9c757fed94d6fc71791e4d3989132ba5 (patch)
tree2874da9d74369f98fec2a21e1dec1b19e3293eea
parentd823a2453473618b29b34109c06caf7fcf0f6c97 (diff)
Print asm operands taking tokens into account.
-rw-r--r--server/TracySourceView.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp
index f342c943..fd991ce9 100644
--- a/server/TracySourceView.cpp
+++ b/server/TracySourceView.cpp
@@ -3913,7 +3913,28 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr
}
if( !hasJump )
{
- TextColoredUnformatted( AsmColor( 0xFFFFFFFF, inContext, isSelected ), line.operands.c_str() );
+ auto ptr = line.operands.c_str();
+ auto end = ptr + line.operands.size();
+ auto it = line.opTokens.begin();
+ while( ptr < end )
+ {
+ if( it == line.opTokens.end() )
+ {
+ ImGui::TextUnformatted( ptr, end );
+ ImGui::SameLine( 0, 0 );
+ break;
+ }
+ if( ptr < it->begin )
+ {
+ ImGui::TextUnformatted( ptr, it->begin );
+ ImGui::SameLine( 0, 0 );
+ }
+ TextColoredUnformatted( AsmColor( AsmSyntaxColors[(int)it->color], inContext, isSelected ), it->begin, it->end );
+ ImGui::SameLine( 0, 0 );
+ ptr = it->end;
+ ++it;
+ }
+ ImGui::ItemSize( ImVec2( 0, 0 ), 0 );
}
ImGui::EndGroup();