Retrieve correct symbol address.

This commit is contained in:
Bartosz Taudul 2022-05-02 01:11:45 +02:00
parent 85e11c2d97
commit 579339dd24
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -6736,15 +6736,27 @@ void Worker::ProcessCodeInformation( const QueueCodeInformation& ev )
auto cit = m_checkedFileStrings.find( ref );
if( cit == m_checkedFileStrings.end() )
{
auto& symmap = GetSymbolMap();
auto it = symmap.find( ev.symAddr );
if( it == symmap.end() )
uint64_t baseAddr = 0;
if( HasSymbolCode( ev.symAddr ) )
{
baseAddr = ev.symAddr;
}
else
{
const auto parentAddr = GetSymbolForAddress( ev.symAddr );
if( parentAddr != 0 && HasSymbolCode( parentAddr ) )
{
baseAddr = parentAddr;
}
}
const SymbolData* sym = baseAddr == 0 ? nullptr : GetSymbolData( baseAddr );
if( !sym )
{
CacheSource( ref );
}
else
{
CacheSource( ref, it->second.imageName );
CacheSource( ref, sym->imageName );
}
}
}