Map source location to assembly instructions.

This commit is contained in:
Bartosz Taudul 2020-04-02 02:01:58 +02:00
parent 9f0a6b8231
commit 387fdb30b0
2 changed files with 15 additions and 1 deletions

View File

@ -5542,7 +5542,20 @@ void Worker::ProcessCodeInformation( const QueueCodeInformation& ev )
if( ev.line != 0 )
{
assert( m_data.codeAddressToLocation.find( ev.ptr ) == m_data.codeAddressToLocation.end() );
m_data.codeAddressToLocation.emplace( ev.ptr, PackFileLine( fit->second.idx, ev.line ) );
const auto packed = PackFileLine( fit->second.idx, ev.line );
m_data.codeAddressToLocation.emplace( ev.ptr, packed );
auto lit = m_data.locationCodeAddressList.find( packed );
if( lit == m_data.locationCodeAddressList.end() )
{
m_data.locationCodeAddressList.emplace( packed, Vector<uint64_t>( ev.ptr ) );
}
else
{
const bool needSort = lit->second.back() > ev.ptr;
lit->second.push_back( ev.ptr );
if( needSort ) pdqsort_branchless( lit->second.begin(), lit->second.end() );
}
}
m_pendingCustomStrings.erase( fit );

View File

@ -298,6 +298,7 @@ private:
uint64_t symbolCodeSize = 0;
unordered_flat_map<uint64_t, uint64_t> codeAddressToLocation;
unordered_flat_map<uint64_t, Vector<uint64_t>> locationCodeAddressList;
};
struct MbpsBlock