Replace code location queries with callstack frame ones.

This commit is contained in:
Bartosz Taudul 2022-10-11 21:40:45 +02:00
parent c9adadf86a
commit 4d0768ba9d
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -4166,10 +4166,15 @@ void Worker::AddSymbolCode( uint64_t ptr, const char* data, size_t sz )
size_t cnt = cs_disasm( handle, (const uint8_t*)code, sz, ptr, 0, &insn ); size_t cnt = cs_disasm( handle, (const uint8_t*)code, sz, ptr, 0, &insn );
if( cnt > 0 ) if( cnt > 0 )
{ {
m_pendingCodeInformation += cnt;
for( size_t i=0; i<cnt; i++ ) for( size_t i=0; i<cnt; i++ )
{ {
Query( ServerQueryCodeLocation, insn[i].address ); const auto addr = insn[i].address;
const auto ptr = PackPointer( addr );
if( m_data.callstackFrameMap.find( ptr ) == m_data.callstackFrameMap.end() )
{
m_pendingCallstackFrames++;
Query( ServerQueryCallstackFrame, addr );
}
} }
cs_free( insn, cnt ); cs_free( insn, cnt );
} }