mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-23 06:44:35 +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;
|
uint32_t len;
|
||||||
auto code = worker.GetSymbolCode( symAddr, len );
|
auto code = worker.GetSymbolCode( symAddr, len );
|
||||||
if( !code ) return false;
|
if( !code ) return false;
|
||||||
|
m_disasmFail = -1;
|
||||||
csh handle;
|
csh handle;
|
||||||
cs_err rval = CS_ERR_ARCH;
|
cs_err rval = CS_ERR_ARCH;
|
||||||
switch( 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 );
|
size_t cnt = cs_disasm( handle, (const uint8_t*)code, len, symAddr, 0, &insn );
|
||||||
if( cnt > 0 )
|
if( cnt > 0 )
|
||||||
{
|
{
|
||||||
|
if( insn[cnt-1].address - symAddr + insn[cnt-1].size < len ) m_disasmFail = insn[cnt-1].address - symAddr;
|
||||||
int mLenMax = 0;
|
int mLenMax = 0;
|
||||||
m_asm.reserve( cnt );
|
m_asm.reserve( cnt );
|
||||||
for( size_t i=0; i<cnt; i++ )
|
for( size_t i=0; i<cnt; i++ )
|
||||||
|
@ -89,6 +89,7 @@ private:
|
|||||||
DecayValue<uint32_t> m_hoveredSource;
|
DecayValue<uint32_t> m_hoveredSource;
|
||||||
int m_displayMode;
|
int m_displayMode;
|
||||||
uint32_t m_codeLen;
|
uint32_t m_codeLen;
|
||||||
|
int32_t m_disasmFail;
|
||||||
DecayValue<uint64_t> m_highlightAddr;
|
DecayValue<uint64_t> m_highlightAddr;
|
||||||
bool m_asmRelative;
|
bool m_asmRelative;
|
||||||
bool m_asmShowSourceLocation;
|
bool m_asmShowSourceLocation;
|
||||||
|
Loading…
Reference in New Issue
Block a user