diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index aac2d9bf..f339f913 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -8765,4 +8765,36 @@ uint64_t Worker::GetHwSampleCount() const 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 ); + } + } +} + } diff --git a/server/TracyWorker.hpp b/server/TracyWorker.hpp index b678f026..e99d696b 100644 --- a/server/TracyWorker.hpp +++ b/server/TracyWorker.hpp @@ -658,6 +658,8 @@ public: void DoPostponedWork(); void DoPostponedWorkAll(); + void CacheSourceFiles(); + private: void Network(); void Exec();