Print register data in asm lines.

This commit is contained in:
Bartosz Taudul 2020-05-01 19:15:46 +02:00
parent f4b06ed1fc
commit 4390aa1015
2 changed files with 37 additions and 0 deletions

View File

@ -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;

View File

@ -81,6 +81,11 @@ private:
rd
};
enum { ReadBit = 0x100 };
enum { WriteBit = 0x200 };
enum { ReuseBit = 0x400 };
enum { RegMask = 0x0FF };
struct AsmLine
{
uint64_t addr;