1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Display complementary assembly address tooltips.

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

View File

@ -2723,6 +2723,34 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr
{ {
TextDisabledUnformatted( buf ); TextDisabledUnformatted( buf );
} }
if( ImGui::IsItemHovered() )
{
if( m_font ) ImGui::PopFont();
ImGui::BeginTooltip();
if( m_asmCountBase >= 0 )
{
TextDisabledUnformatted( "Absolute address:" );
ImGui::SameLine();
ImGui::Text( "%" PRIx64, line.addr );
TextDisabledUnformatted( "Relative address:" );
ImGui::SameLine();
ImGui::Text( "+%" PRIx64, line.addr - m_baseAddr );
}
else if( m_asmRelative )
{
TextDisabledUnformatted( "Absolute address:" );
ImGui::SameLine();
ImGui::Text( "%" PRIx64, line.addr );
}
else
{
TextDisabledUnformatted( "Relative address:" );
ImGui::SameLine();
ImGui::Text( "+%" PRIx64, line.addr - m_baseAddr );
}
ImGui::EndTooltip();
if( m_font ) ImGui::PushFont( m_font );
if( ImGui::IsItemClicked( 0 ) ) if( ImGui::IsItemClicked( 0 ) )
{ {
m_asmCountBase = asmIdx; m_asmCountBase = asmIdx;
@ -2731,6 +2759,7 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr
{ {
m_asmCountBase = -1; m_asmCountBase = -1;
} }
}
const auto stw = ImGui::CalcTextSize( " " ).x; const auto stw = ImGui::CalcTextSize( " " ).x;
bool lineHovered = false; bool lineHovered = false;