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:
parent
854439cdb1
commit
de5f258b03
@ -2723,13 +2723,42 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr
|
|||||||
{
|
{
|
||||||
TextDisabledUnformatted( buf );
|
TextDisabledUnformatted( buf );
|
||||||
}
|
}
|
||||||
if( ImGui::IsItemClicked( 0 ) )
|
if( ImGui::IsItemHovered() )
|
||||||
{
|
{
|
||||||
m_asmCountBase = asmIdx;
|
if( m_font ) ImGui::PopFont();
|
||||||
}
|
ImGui::BeginTooltip();
|
||||||
else if( ImGui::IsItemClicked( 1 ) )
|
if( m_asmCountBase >= 0 )
|
||||||
{
|
{
|
||||||
m_asmCountBase = -1;
|
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 ) )
|
||||||
|
{
|
||||||
|
m_asmCountBase = asmIdx;
|
||||||
|
}
|
||||||
|
else if( ImGui::IsItemClicked( 1 ) )
|
||||||
|
{
|
||||||
|
m_asmCountBase = -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto stw = ImGui::CalcTextSize( " " ).x;
|
const auto stw = ImGui::CalcTextSize( " " ).x;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user