Skip to content

Commit 64aad9e

Browse files
committed
Load all kernel symbols, mark non-code sections with null name.
1 parent d5064aa commit 64aad9e

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

‎public/client/TracyCallstack.cpp‎

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ static void InitKernelSymbols()
831831
}
832832
if( addr == 0 ) continue;
833833
ptr++;
834-
if( *ptr != 'T' && *ptr != 't' ) continue;
834+
const bool valid = *ptr == 'T' || *ptr == 't';
835835
ptr += 2;
836836
const auto namestart = ptr;
837837
while( *ptr != '\t' && *ptr != '\n' ) ptr++;
@@ -846,16 +846,21 @@ static void InitKernelSymbols()
846846
modend = ptr;
847847
}
848848

849-
auto strname = (char*)tracy_malloc_fast( nameend - namestart + 1 );
850-
memcpy( strname, namestart, nameend - namestart );
851-
strname[nameend-namestart] = '\0';
852-
849+
char* strname = nullptr;
853850
char* strmod = nullptr;
854-
if( modstart )
851+
852+
if( valid )
855853
{
856-
strmod = (char*)tracy_malloc_fast( modend - modstart + 1 );
857-
memcpy( strmod, modstart, modend - modstart );
858-
strmod[modend-modstart] = '\0';
854+
strname = (char*)tracy_malloc_fast( nameend - namestart + 1 );
855+
memcpy( strname, namestart, nameend - namestart );
856+
strname[nameend-namestart] = '\0';
857+
858+
if( modstart )
859+
{
860+
strmod = (char*)tracy_malloc_fast( modend - modstart + 1 );
861+
memcpy( strmod, modstart, modend - modstart );
862+
strmod[modend-modstart] = '\0';
863+
}
859864
}
860865

861866
auto sym = tmpSym.push_next();

0 commit comments

Comments
 (0)