Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLectem <lectem@gmail.com>2021-12-08 23:30:06 +0300
committerLectem <lectem@gmail.com>2021-12-08 23:30:06 +0300
commit17855cbac55f1164aa882fcd20135770db0a03d7 (patch)
treefc3be4ab42f654fca13895bae21f223543e73fb6
parent14392a6e0e74d665042e55dda610a5a5bdbbc054 (diff)
Call SymLoadModuleEx for modules loaded after init
This fixes issue #293. Symbols are not loaded if the module is loaded dynamically after the SymInitialize call. This may stall the symbol resolver thread a bit the first time a module is loaded.
-rw-r--r--client/TracyCallstack.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/client/TracyCallstack.cpp b/client/TracyCallstack.cpp
index 0dff7c81..0e0af4a9 100644
--- a/client/TracyCallstack.cpp
+++ b/client/TracyCallstack.cpp
@@ -296,6 +296,8 @@ static const char* GetModuleName( uint64_t addr )
const auto res = GetModuleFileNameA( mod[i], name, 1021 );
if( res > 0 )
{
+ // since this is the first time we encounter this module, load its symbols (needed for modules loaded after SymInitialize)
+ SymLoadModuleEx(proc, NULL, name, NULL, (DWORD64)info.lpBaseOfDll, info.SizeOfImage, NULL, 0);
auto ptr = name + res;
while( ptr > name && *ptr != '\\' && *ptr != '/' ) ptr--;
if( ptr > name ) ptr++;