diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp index c7396500..34cddf4f 100644 --- a/server/TracySourceView.cpp +++ b/server/TracySourceView.cpp @@ -36,6 +36,7 @@ SourceView::SourceView( ImFont* font ) , m_codeLen( 0 ) , m_highlightAddr( 0 ) , m_asmRelative( false ) + , m_asmBytes( false ) , m_asmShowSourceLocation( true ) , m_calcInlineStats( true ) , m_showJumps( true ) @@ -178,6 +179,7 @@ bool SourceView::Disassemble( uint64_t symAddr, const Worker& worker ) if( cnt > 0 ) { if( insn[cnt-1].address - symAddr + insn[cnt-1].size < len ) m_disasmFail = insn[cnt-1].address - symAddr; + int bytesMax = 0; int mLenMax = 0; m_asm.reserve( cnt ); for( size_t i=0; i mLenMax ) mLenMax = mLen; + if( op.size > bytesMax ) bytesMax = op.size; uint32_t mLineMax = 0; uint32_t srcline; @@ -273,6 +276,7 @@ bool SourceView::Disassemble( uint64_t symAddr, const Worker& worker ) } cs_free( insn, cnt ); m_maxMnemonicLen = mLenMax + 2; + m_maxAsmBytes = bytesMax; if( !m_jumpTable.empty() ) { struct JumpRange @@ -944,6 +948,10 @@ uint64_t SourceView::RenderSymbolAsmView( uint32_t iptotal, unordered_flat_mapAddLine( wpos + ImVec2( xoff + JumpSeparation * mjl + th2, th2 ), wpos + ImVec2( xoff + JumpSeparation * mjl + th2 + JumpArrow / 2, th2 ), col ); draw->AddLine( wpos + ImVec2( xoff + JumpSeparation * mjl + th2, th2 ), wpos + ImVec2( xoff + JumpSeparation * mjl + th2 + th4, th2 - th4 ), col ); diff --git a/server/TracySourceView.hpp b/server/TracySourceView.hpp index 34e3bdb3..76282c30 100644 --- a/server/TracySourceView.hpp +++ b/server/TracySourceView.hpp @@ -93,8 +93,10 @@ private: int32_t m_disasmFail; DecayValue m_highlightAddr; bool m_asmRelative; + bool m_asmBytes; bool m_asmShowSourceLocation; bool m_calcInlineStats; + uint8_t m_maxAsmBytes; std::vector m_lines; std::vector m_asm;