Display jump target in asm instruction tooltip.

This commit is contained in:
Bartosz Taudul 2021-04-29 20:27:32 +02:00
parent ac9b97319a
commit 854439cdb1
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -3043,11 +3043,25 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr
const auto& var = *asmVar; const auto& var = *asmVar;
if( m_font ) ImGui::PopFont(); if( m_font ) ImGui::PopFont();
ImGui::BeginTooltip(); ImGui::BeginTooltip();
if( opdesc != 0 ) if( jumpName || opdesc != 0 )
{ {
ImGui::TextUnformatted( OpDescList[opdesc] ); if( opdesc != 0 ) ImGui::TextUnformatted( OpDescList[opdesc] );
if( jumpName )
{
if( jumpBase == m_baseAddr )
{
TextDisabledUnformatted( "Local target:" );
}
else
{
TextDisabledUnformatted( "External target:" );
}
ImGui::SameLine();
ImGui::Text( "%s+%" PRIu32, jumpName, jumpOffset );
}
ImGui::Separator(); ImGui::Separator();
} }
TextFocused( "Throughput:", RealToString( var.tp ) ); TextFocused( "Throughput:", RealToString( var.tp ) );
ImGui::SameLine(); ImGui::SameLine();
TextDisabledUnformatted( "(cycles per instruction, lower is better)" ); TextDisabledUnformatted( "(cycles per instruction, lower is better)" );
@ -3154,6 +3168,23 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr
ImGui::EndTooltip(); ImGui::EndTooltip();
if( m_font ) ImGui::PushFont( m_font ); if( m_font ) ImGui::PushFont( m_font );
} }
else if( jumpName )
{
if( m_font ) ImGui::PopFont();
ImGui::BeginTooltip();
if( jumpBase == m_baseAddr )
{
TextDisabledUnformatted( "Local target:" );
}
else
{
TextDisabledUnformatted( "External target:" );
}
ImGui::SameLine();
ImGui::Text( "%s+%" PRIu32, jumpName, jumpOffset );
ImGui::EndTooltip();
if( m_font ) ImGui::PushFont( m_font );
}
if( m_cpuArch == CpuArchX86 || m_cpuArch == CpuArchX64 ) if( m_cpuArch == CpuArchX86 || m_cpuArch == CpuArchX64 )
{ {
if( line.readX86[0] != RegsX86::invalid || line.writeX86[0] != RegsX86::invalid ) if( line.readX86[0] != RegsX86::invalid || line.writeX86[0] != RegsX86::invalid )