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
{
const auto& symMap = m_worker.GetSymbolMap();
auto sit = symMap.find( symAddr );
auto baseAddr = symAddr;
uint32_t symlen = 0;
if( sit != symMap.end() ) symlen = sit->second.size.Val();
if( symlen == 0 )
uint64_t baseAddr = 0;
if( m_worker.HasSymbolCode( symAddr ) )
{
baseAddr = symAddr;
}
else
{
const auto parentAddr = m_worker.GetSymbolForAddress( symAddr );
if( parentAddr != 0 )
{
auto pit = symMap.find( parentAddr );
if( pit != symMap.end() ) baseAddr = parentAddr;
if( m_worker.HasSymbolCode( parentAddr ) )
{
baseAddr = parentAddr;
}
}
}
if( symlen != 0 || line != 0 )
if( baseAddr != 0 || line != 0 )
{
ViewSymbol( fileName, line, baseAddr, symAddr );
return true;