Implement scanning for source files missing in cache.

This commit is contained in:
Bartosz Taudul 2022-03-30 16:07:15 +02:00
parent e086488928
commit a335efe9e6
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
2 changed files with 34 additions and 0 deletions

View File

@ -8765,4 +8765,36 @@ uint64_t Worker::GetHwSampleCount() const
return cnt; return cnt;
} }
void Worker::CacheSourceFiles()
{
const auto execTime = GetExecutableTime();
for( auto& sl : m_data.sourceLocationPayload )
{
const char* file = GetString( sl->file );
if( m_data.sourceFileCache.find( file ) == m_data.sourceFileCache.end() )
{
if( SourceFileValid( file, execTime != 0 ? execTime : GetCaptureTime() ) ) CacheSourceFromFile( file );
}
}
for( auto& sl : m_data.sourceLocation )
{
const char* file = GetString( sl.second.file );
if( m_data.sourceFileCache.find( file ) == m_data.sourceFileCache.end() )
{
if( SourceFileValid( file, execTime != 0 ? execTime : GetCaptureTime() ) ) CacheSourceFromFile( file );
}
}
for( auto& sym : m_data.symbolMap )
{
const char* file = GetString( sym.second.file );
if( m_data.sourceFileCache.find( file ) == m_data.sourceFileCache.end() )
{
if( SourceFileValid( file, execTime != 0 ? execTime : GetCaptureTime() ) ) CacheSourceFromFile( file );
}
}
}
} }

View File

@ -658,6 +658,8 @@ public:
void DoPostponedWork(); void DoPostponedWork();
void DoPostponedWorkAll(); void DoPostponedWorkAll();
void CacheSourceFiles();
private: private:
void Network(); void Network();
void Exec(); void Exec();