mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Detect disassembly failures.
This commit is contained in:
parent
c78e11872c
commit
b157d4c161
@ -150,6 +150,7 @@ bool SourceView::Disassemble( uint64_t symAddr, const Worker& worker )
|
||||
uint32_t len;
|
||||
auto code = worker.GetSymbolCode( symAddr, len );
|
||||
if( !code ) return false;
|
||||
m_disasmFail = -1;
|
||||
csh handle;
|
||||
cs_err rval = CS_ERR_ARCH;
|
||||
switch( arch )
|
||||
@ -176,6 +177,7 @@ bool SourceView::Disassemble( uint64_t symAddr, const Worker& worker )
|
||||
size_t cnt = cs_disasm( handle, (const uint8_t*)code, len, symAddr, 0, &insn );
|
||||
if( cnt > 0 )
|
||||
{
|
||||
if( insn[cnt-1].address - symAddr + insn[cnt-1].size < len ) m_disasmFail = insn[cnt-1].address - symAddr;
|
||||
int mLenMax = 0;
|
||||
m_asm.reserve( cnt );
|
||||
for( size_t i=0; i<cnt; i++ )
|
||||
|
@ -89,6 +89,7 @@ private:
|
||||
DecayValue<uint32_t> m_hoveredSource;
|
||||
int m_displayMode;
|
||||
uint32_t m_codeLen;
|
||||
int32_t m_disasmFail;
|
||||
DecayValue<uint64_t> m_highlightAddr;
|
||||
bool m_asmRelative;
|
||||
bool m_asmShowSourceLocation;
|
||||
|
Loading…
Reference in New Issue
Block a user