Display code size in source file view window.

This commit is contained in:
Bartosz Taudul 2020-03-26 02:23:09 +01:00
parent 6a96b5f1dc
commit 3de4283bd2
2 changed files with 7 additions and 0 deletions

View File

@ -26,6 +26,7 @@ SourceView::SourceView( ImFont* font )
, m_targetLine( 0 ) , m_targetLine( 0 )
, m_selectedLine( 0 ) , m_selectedLine( 0 )
, m_showAsm( false ) , m_showAsm( false )
, m_codeLen( 0 )
{ {
} }
@ -125,6 +126,7 @@ bool SourceView::Disassemble( uint64_t symAddr, const Worker& worker )
cs_free( insn, cnt ); cs_free( insn, cnt );
} }
cs_close( &handle ); cs_close( &handle );
m_codeLen = len;
return true; return true;
} }
@ -196,6 +198,10 @@ void SourceView::Render( const Worker& worker )
ImGui::SameLine(); ImGui::SameLine();
ImGui::Spacing(); ImGui::Spacing();
ImGui::SameLine(); ImGui::SameLine();
TextFocused( "Code size:", MemSizeToString( m_codeLen ) );
ImGui::SameLine();
ImGui::Spacing();
ImGui::SameLine();
} }
TextFocused( "Samples:", RealToString( iptotal ) ); TextFocused( "Samples:", RealToString( iptotal ) );
ImGui::SameLine(); ImGui::SameLine();

View File

@ -45,6 +45,7 @@ private:
int m_targetLine; int m_targetLine;
int m_selectedLine; int m_selectedLine;
bool m_showAsm; bool m_showAsm;
uint32_t m_codeLen;
std::vector<Line> m_lines; std::vector<Line> m_lines;
std::vector<AsmLine> m_asm; std::vector<AsmLine> m_asm;