Rename GetModuleName and call it before sym* use

This commit is contained in:
Lectem 2021-12-12 14:32:24 +01:00
parent 17855cbac5
commit 5d0466b729

View File

@ -253,7 +253,7 @@ const char* GetKernelModulePath( uint64_t addr )
return it->path; return it->path;
} }
static const char* GetModuleName( uint64_t addr ) static const char* GetModuleNameAndPrepareSymbols( uint64_t addr )
{ {
if( ( addr >> 63 ) != 0 ) if( ( addr >> 63 ) != 0 )
{ {
@ -435,6 +435,9 @@ CallstackEntryData DecodeCallstackPtr( uint64_t ptr )
#ifdef TRACY_DBGHELP_LOCK #ifdef TRACY_DBGHELP_LOCK
DBGHELP_LOCK; DBGHELP_LOCK;
#endif #endif
const auto moduleName = GetModuleNameAndPrepareSymbols(ptr);
#if !defined TRACY_NO_CALLSTACK_INLINES #if !defined TRACY_NO_CALLSTACK_INLINES
BOOL doInline = FALSE; BOOL doInline = FALSE;
DWORD ctx = 0; DWORD ctx = 0;
@ -463,7 +466,6 @@ CallstackEntryData DecodeCallstackPtr( uint64_t ptr )
si->SizeOfStruct = sizeof( SYMBOL_INFO ); si->SizeOfStruct = sizeof( SYMBOL_INFO );
si->MaxNameLen = MaxNameSize; si->MaxNameLen = MaxNameSize;
const auto moduleName = GetModuleName( ptr );
const auto symValid = SymFromAddr( proc, ptr, nullptr, si ) != 0; const auto symValid = SymFromAddr( proc, ptr, nullptr, si ) != 0;
IMAGEHLP_LINE64 line; IMAGEHLP_LINE64 line;