1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Support transfer of zone name in source location payload.

This commit is contained in:
Bartosz Taudul
2017-11-14 23:54:52 +01:00
committed by Bartosz Taudul
parent 9eace41f0d
commit 334224dd36
2 changed files with 25 additions and 14 deletions
+9 -4
View File
@@ -1020,14 +1020,19 @@ void View::AddSourceLocationPayload( uint64_t ptr, char* data, size_t sz )
memcpy( &line, data + 4, 4 );
data += 8;
auto end = data;
while( *end ) end++;
while( *end ) end++;
const auto func = StoreString( data, end - data );
end++;
const auto ssz = sz - ( end - start );
const auto source = StoreString( end, ssz );
SourceLocation srcloc { StringRef(), StringRef( StringRef::Idx, func.idx ), StringRef( StringRef::Idx, source.idx ), line, color };
data = end;
while( *end ) end++;
const auto source = StoreString( data, end - data );
end++;
const auto nsz = sz - ( end - start );
SourceLocation srcloc { nsz == 0 ? StringRef() : StringRef( StringRef::Idx, StoreString( end, nsz ).idx ), StringRef( StringRef::Idx, func.idx ), StringRef( StringRef::Idx, source.idx ), line, color };
auto it = m_sourceLocationPayloadMap.find( &srcloc );
if( it == m_sourceLocationPayloadMap.end() )
{