Use source contents callback.

This commit is contained in:
Bartosz Taudul 2022-08-17 15:42:16 +02:00
parent ed7be2faaa
commit a237f108c7
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -3883,6 +3883,21 @@ void Profiler::HandleSourceCodeQuery()
}
#endif
if( !ok && m_sourceCallback )
{
size_t sz;
char* ptr = m_sourceCallback( m_sourceCallbackData, m_queryData, sz );
if( ptr )
{
if( sz < ( TargetFrameSize - 16 ) )
{
SendLongString( (uint64_t)ptr, ptr, sz, QueueType::SourceCode );
ok = true;
}
tracy_free_fast( ptr );
}
}
if( !ok ) AckSourceCodeNotAvailable();
tracy_free_fast( m_queryData );