Properly check if symbol code is available.

This commit is contained in:
Bartosz Taudul 2020-08-14 12:38:56 +02:00
parent aa72cb6ab9
commit 5e559322a0

View File

@ -242,21 +242,23 @@ bool View::ViewDispatch( const char* fileName, int line, uint64_t symAddr )
} }
else else
{ {
const auto& symMap = m_worker.GetSymbolMap(); uint64_t baseAddr = 0;
auto sit = symMap.find( symAddr ); if( m_worker.HasSymbolCode( symAddr ) )
auto baseAddr = symAddr; {
uint32_t symlen = 0; baseAddr = symAddr;
if( sit != symMap.end() ) symlen = sit->second.size.Val(); }
if( symlen == 0 ) else
{ {
const auto parentAddr = m_worker.GetSymbolForAddress( symAddr ); const auto parentAddr = m_worker.GetSymbolForAddress( symAddr );
if( parentAddr != 0 ) if( parentAddr != 0 )
{ {
auto pit = symMap.find( parentAddr ); if( m_worker.HasSymbolCode( parentAddr ) )
if( pit != symMap.end() ) baseAddr = parentAddr; {
baseAddr = parentAddr;
} }
} }
if( symlen != 0 || line != 0 ) }
if( baseAddr != 0 || line != 0 )
{ {
ViewSymbol( fileName, line, baseAddr, symAddr ); ViewSymbol( fileName, line, baseAddr, symAddr );
return true; return true;