Display target location for local jumps.

This commit is contained in:
Bartosz Taudul 2022-04-06 01:23:35 +02:00
parent a763991a00
commit e34d79c0c7
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -3733,6 +3733,21 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr
}
ImGui::SameLine();
ImGui::Text( "%s+%" PRIu32, jumpName, jumpOffset );
if( jumpBase == m_baseAddr )
{
uint32_t srcline;
const auto srcidx = worker.GetLocationForAddress( line.jumpAddr, srcline );
if( srcline != 0 )
{
const auto fileName = worker.GetString( srcidx );
const auto fileColor = GetHsvColor( srcidx.Idx(), 0 );
TextDisabledUnformatted( "Target location:" );
ImGui::SameLine();
SmallColorBox( fileColor );
ImGui::SameLine();
ImGui::Text( "%s:%i", fileName, srcline );
}
}
}
ImGui::Separator();
}
@ -3857,6 +3872,21 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr
}
ImGui::SameLine();
ImGui::Text( "%s+%" PRIu32, jumpName, jumpOffset );
if( jumpBase == m_baseAddr )
{
uint32_t srcline;
const auto srcidx = worker.GetLocationForAddress( line.jumpAddr, srcline );
if( srcline != 0 )
{
const auto fileName = worker.GetString( srcidx );
const auto fileColor = GetHsvColor( srcidx.Idx(), 0 );
TextDisabledUnformatted( "Target location:" );
ImGui::SameLine();
SmallColorBox( fileColor );
ImGui::SameLine();
ImGui::Text( "%s:%i", fileName, srcline );
}
}
ImGui::EndTooltip();
SetFont();
}