mirror of
https://github.com/wolfpld/tracy
synced 2025-04-30 04:43:53 +00:00
Assembly display is not dependant on sample data.
This commit is contained in:
parent
2a54f2df5d
commit
10ca8b5440
@ -130,25 +130,30 @@ bool SourceView::Disassemble( uint64_t symAddr, const Worker& worker )
|
|||||||
|
|
||||||
void SourceView::Render( const Worker& worker )
|
void SourceView::Render( const Worker& worker )
|
||||||
{
|
{
|
||||||
|
if( !m_asm.empty() )
|
||||||
|
{
|
||||||
|
if( SmallCheckbox( ICON_FA_MICROCHIP " Show assembly", &m_showAsm ) )
|
||||||
|
{
|
||||||
|
if( m_showAsm )
|
||||||
|
{
|
||||||
|
m_targetAddr = m_symAddr;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_targetLine = m_selectedLine;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::Spacing();
|
||||||
|
ImGui::SameLine();
|
||||||
|
TextFocused( "Code size:", MemSizeToString( m_codeLen ) );
|
||||||
|
}
|
||||||
|
|
||||||
uint32_t iptotal = 0;
|
uint32_t iptotal = 0;
|
||||||
unordered_flat_map<uint64_t, uint32_t> ipcount;
|
unordered_flat_map<uint64_t, uint32_t> ipcount;
|
||||||
auto ipmap = m_symAddr != 0 ? worker.GetSymbolInstructionPointers( m_symAddr ) : nullptr;
|
auto ipmap = m_symAddr != 0 ? worker.GetSymbolInstructionPointers( m_symAddr ) : nullptr;
|
||||||
if( ipmap )
|
if( ipmap )
|
||||||
{
|
{
|
||||||
if( !m_asm.empty() )
|
|
||||||
{
|
|
||||||
if( SmallCheckbox( ICON_FA_MICROCHIP " Show assembly", &m_showAsm ) )
|
|
||||||
{
|
|
||||||
if( m_showAsm )
|
|
||||||
{
|
|
||||||
m_targetAddr = m_symAddr;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_targetLine = m_selectedLine;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if( m_showAsm )
|
if( m_showAsm )
|
||||||
{
|
{
|
||||||
for( auto& ip : *ipmap )
|
for( auto& ip : *ipmap )
|
||||||
@ -184,27 +189,25 @@ void SourceView::Render( const Worker& worker )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
auto sym = worker.GetSymbolData( m_symAddr );
|
|
||||||
if( sym )
|
if( iptotal > 0 )
|
||||||
{
|
{
|
||||||
if( !m_asm.empty() )
|
|
||||||
{
|
|
||||||
ImGui::SameLine();
|
|
||||||
ImGui::Spacing();
|
|
||||||
ImGui::SameLine();
|
|
||||||
TextFocused( "Code size:", MemSizeToString( m_codeLen ) );
|
|
||||||
ImGui::SameLine();
|
|
||||||
ImGui::Spacing();
|
|
||||||
ImGui::SameLine();
|
|
||||||
}
|
|
||||||
TextFocused( "Samples:", RealToString( iptotal ) );
|
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
TextFocused( "Symbol:", worker.GetString( sym->name ) );
|
TextFocused( "Samples:", RealToString( iptotal ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto sym = worker.GetSymbolData( m_symAddr );
|
||||||
|
if( sym )
|
||||||
|
{
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::Spacing();
|
||||||
|
ImGui::SameLine();
|
||||||
|
TextFocused( "Symbol:", worker.GetString( sym->name ) );
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::BeginChild( "##sourceView", ImVec2( 0, 0 ), true );
|
ImGui::BeginChild( "##sourceView", ImVec2( 0, 0 ), true );
|
||||||
if( m_font ) ImGui::PushFont( m_font );
|
if( m_font ) ImGui::PushFont( m_font );
|
||||||
const auto nw = ImGui::CalcTextSize( "123,345" ).x;
|
const auto nw = ImGui::CalcTextSize( "123,345" ).x;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user