From cad65ab52f6b896aab3d58596b2149d9483fa2fa Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 20 Nov 2021 15:56:41 +0100 Subject: [PATCH] Handle magic dbghelp line numbers. https://github.com/Microsoft/microsoft-pdb/issues/16 https://docs.microsoft.com/en-us/archive/blogs/jmstall/line-hidden-and-0xfeefee-sequence-points --- client/TracyCallstack.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/TracyCallstack.cpp b/client/TracyCallstack.cpp index 01202c76..8acca57d 100644 --- a/client/TracyCallstack.cpp +++ b/client/TracyCallstack.cpp @@ -309,7 +309,7 @@ CallstackSymbolData DecodeSymbolAddress( uint64_t ptr ) DBGHELP_LOCK; #endif const auto res = SymGetLineFromAddr64( GetCurrentProcess(), ptr, &displacement, &line ); - if( res == 0 ) + if( res == 0 || line.LineNumber >= 0xF00000 ) { sym.file = "[unknown]"; sym.line = 0; @@ -376,7 +376,8 @@ CallstackSymbolData DecodeCodeAddress( uint64_t ptr ) #endif if( !done ) { - if( SymGetLineFromAddr64( proc, ptr, &displacement, &line ) == 0 ) + const auto res = SymGetLineFromAddr64( proc, ptr, &displacement, &line ); + if( res == 0 || line.LineNumber >= 0xF00000 ) { sym.file = "[unknown]"; sym.line = 0; @@ -451,7 +452,8 @@ CallstackEntryData DecodeCallstackPtr( uint64_t ptr ) { const char* filename; - if( SymGetLineFromAddr64( proc, ptr, &displacement, &line ) == 0 ) + const auto res = SymGetLineFromAddr64( proc, ptr, &displacement, &line ); + if( res == 0 || line.LineNumber >= 0xF00000 ) { filename = "[unknown]"; cb_data[write].line = 0;