mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-12 19:31:47 +00:00
Extract jump name retrieval.
This commit is contained in:
parent
05894f6f14
commit
ac9b97319a
@ -3025,6 +3025,17 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr
|
|||||||
ImGui::TextUnformatted( buf );
|
ImGui::TextUnformatted( buf );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t jumpOffset;
|
||||||
|
uint64_t jumpBase;
|
||||||
|
const char* jumpName = nullptr;
|
||||||
|
if( line.jumpAddr != 0 )
|
||||||
|
{
|
||||||
|
jumpOffset = 0;
|
||||||
|
jumpBase = worker.GetSymbolForAddress( line.jumpAddr, jumpOffset );
|
||||||
|
auto jumpSym = jumpBase == 0 ? worker.GetSymbolData( line.jumpAddr ) : worker.GetSymbolData( jumpBase );
|
||||||
|
if( jumpSym ) jumpName = worker.GetString( jumpSym->name );
|
||||||
|
}
|
||||||
|
|
||||||
if( ImGui::IsItemHovered() )
|
if( ImGui::IsItemHovered() )
|
||||||
{
|
{
|
||||||
if( asmVar )
|
if( asmVar )
|
||||||
@ -3274,35 +3285,29 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr
|
|||||||
TextColoredUnformatted( ImVec4( 0.5f, 0.5, 1, 1 ), "}" );
|
TextColoredUnformatted( ImVec4( 0.5f, 0.5, 1, 1 ), "}" );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( line.jumpAddr != 0 )
|
if( jumpName )
|
||||||
{
|
{
|
||||||
uint32_t offset = 0;
|
ImGui::SameLine();
|
||||||
const auto base = worker.GetSymbolForAddress( line.jumpAddr, offset );
|
ImGui::Spacing();
|
||||||
auto sym = base == 0 ? worker.GetSymbolData( line.jumpAddr ) : worker.GetSymbolData( base );
|
ImGui::SameLine();
|
||||||
if( sym )
|
if( jumpBase == m_baseAddr )
|
||||||
{
|
{
|
||||||
ImGui::SameLine();
|
ImGui::TextDisabled( "-> [%s+%" PRIu32"]", jumpName, jumpOffset );
|
||||||
ImGui::Spacing();
|
if( ImGui::IsItemHovered() )
|
||||||
ImGui::SameLine();
|
|
||||||
if( base == m_baseAddr )
|
|
||||||
{
|
{
|
||||||
ImGui::TextDisabled( "-> [%s+%" PRIu32"]", worker.GetString( sym->name ), offset );
|
m_highlightAddr = line.jumpAddr;
|
||||||
if( ImGui::IsItemHovered() )
|
if( ImGui::IsItemClicked() )
|
||||||
{
|
{
|
||||||
m_highlightAddr = line.jumpAddr;
|
m_targetAddr = line.jumpAddr;
|
||||||
if( ImGui::IsItemClicked() )
|
m_selectedAddresses.clear();
|
||||||
{
|
m_selectedAddresses.emplace( line.jumpAddr );
|
||||||
m_targetAddr = line.jumpAddr;
|
|
||||||
m_selectedAddresses.clear();
|
|
||||||
m_selectedAddresses.emplace( line.jumpAddr );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
ImGui::TextDisabled( "[%s+%" PRIu32"]", worker.GetString( sym->name ), offset );
|
{
|
||||||
if( ImGui::IsItemClicked() ) jumpOut = line.jumpAddr;
|
ImGui::TextDisabled( "[%s+%" PRIu32"]", jumpName, jumpOffset );
|
||||||
}
|
if( ImGui::IsItemClicked() ) jumpOut = line.jumpAddr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user