1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-30 12:53:51 +00:00

Don't display operands, if none.

This commit is contained in:
Bartosz Taudul 2020-05-01 16:15:33 +02:00
parent 47b8f052bd
commit bb4b08e8cf

View File

@ -2141,49 +2141,52 @@ void SourceView::RenderAsmLine( const AsmLine& line, uint32_t ipcnt, uint32_t ip
if( var.port != -1 ) TextFocused( "Ports:", PortList[var.port] ); if( var.port != -1 ) TextFocused( "Ports:", PortList[var.port] );
ImGui::Separator(); ImGui::Separator();
TextFocused( "ISA set:", IsaList[var.isaSet] ); TextFocused( "ISA set:", IsaList[var.isaSet] );
TextDisabledUnformatted( "Operands:" ); if( var.descNum > 0 )
ImGui::SameLine();
bool first = true;
for( int i=0; i<var.descNum; i++ )
{ {
const char* t = "?"; TextDisabledUnformatted( "Operands:" );
switch( var.desc[i].type ) ImGui::SameLine();
bool first = true;
for( int i=0; i<var.descNum; i++ )
{ {
case 0: const char* t = "?";
t = "Imm"; switch( var.desc[i].type )
break;
case 1:
t = "Reg";
break;
case 2:
t = var.desc[i].width == 0 ? "AGen" : "Mem";
break;
default:
assert( false );
break;
}
if( first )
{
first = false;
if( var.desc[i].width == 0 )
{ {
ImGui::TextUnformatted( t ); case 0:
t = "Imm";
break;
case 1:
t = "Reg";
break;
case 2:
t = var.desc[i].width == 0 ? "AGen" : "Mem";
break;
default:
assert( false );
break;
}
if( first )
{
first = false;
if( var.desc[i].width == 0 )
{
ImGui::TextUnformatted( t );
}
else
{
ImGui::Text( "%s%i", t, var.desc[i].width );
}
} }
else else
{ {
ImGui::Text( "%s%i", t, var.desc[i].width ); ImGui::SameLine( 0, 0 );
} if( var.desc[i].width == 0 )
} {
else ImGui::Text( ", %s", t );
{ }
ImGui::SameLine( 0, 0 ); else
if( var.desc[i].width == 0 ) {
{ ImGui::Text( ", %s%i", t, var.desc[i].width );
ImGui::Text( ", %s", t ); }
}
else
{
ImGui::Text( ", %s%i", t, var.desc[i].width );
} }
} }
} }