1
0
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:
Bartosz Taudul 2020-03-27 01:24:50 +01:00
parent 2a54f2df5d
commit 10ca8b5440

View File

@ -129,11 +129,6 @@ bool SourceView::Disassemble( uint64_t symAddr, const Worker& worker )
} }
void SourceView::Render( const Worker& worker ) void SourceView::Render( const Worker& worker )
{
uint32_t iptotal = 0;
unordered_flat_map<uint64_t, uint32_t> ipcount;
auto ipmap = m_symAddr != 0 ? worker.GetSymbolInstructionPointers( m_symAddr ) : nullptr;
if( ipmap )
{ {
if( !m_asm.empty() ) if( !m_asm.empty() )
{ {
@ -148,7 +143,17 @@ void SourceView::Render( const Worker& worker )
m_targetLine = m_selectedLine; m_targetLine = m_selectedLine;
} }
} }
ImGui::SameLine();
ImGui::Spacing();
ImGui::SameLine();
TextFocused( "Code size:", MemSizeToString( m_codeLen ) );
} }
uint32_t iptotal = 0;
unordered_flat_map<uint64_t, uint32_t> ipcount;
auto ipmap = m_symAddr != 0 ? worker.GetSymbolInstructionPointers( m_symAddr ) : nullptr;
if( ipmap )
{
if( m_showAsm ) if( m_showAsm )
{ {
for( auto& ip : *ipmap ) for( auto& ip : *ipmap )
@ -184,26 +189,24 @@ void SourceView::Render( const Worker& worker )
} }
} }
} }
if( iptotal > 0 )
{
ImGui::SameLine();
ImGui::Spacing();
ImGui::SameLine();
TextFocused( "Samples:", RealToString( iptotal ) );
}
}
auto sym = worker.GetSymbolData( m_symAddr ); auto sym = worker.GetSymbolData( m_symAddr );
if( sym ) if( sym )
{ {
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( "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 );