Send symbol base address.

This commit is contained in:
Bartosz Taudul
2020-02-25 23:03:40 +01:00
parent 85ffe0ea04
commit 3402d16548
5 changed files with 12 additions and 9 deletions

View File

@@ -243,10 +243,8 @@ CallstackEntryData DecodeCallstackPtr( uint64_t ptr )
si->SizeOfStruct = sizeof( SYMBOL_INFO );
si->MaxNameLen = 1024;
if( SymFromAddr( proc, ptr, nullptr, si ) == 0 )
{
GetModuleName( ptr, si->Name, si->NameLen );
}
const auto symValid = SymFromAddr( proc, ptr, nullptr, si ) != 0;
if( !symValid ) GetModuleName( ptr, si->Name, si->NameLen );
IMAGEHLP_LINE64 line;
DWORD displacement = 0;
@@ -277,6 +275,8 @@ CallstackEntryData DecodeCallstackPtr( uint64_t ptr )
file[fsz] = '\0';
cb_data[write].file = file;
cb_data[write].symAddr = symValid ? si->Address : 0;
}
#ifndef __CYGWIN__
@@ -286,10 +286,8 @@ CallstackEntryData DecodeCallstackPtr( uint64_t ptr )
{
auto& cb = cb_data[i];
if( SymFromInlineContext( proc, ptr, ctx, nullptr, si ) == 0 )
{
GetModuleName( ptr, si->Name, si->NameLen );
}
const auto symInlineValid = SymFromInlineContext( proc, ptr, ctx, nullptr, si ) != 0;
if( !symInlineValid ) GetModuleName( ptr, si->Name, si->NameLen );
auto name = (char*)tracy_malloc( si->NameLen + 1 );
memcpy( name, si->Name, si->NameLen );
@@ -314,6 +312,8 @@ CallstackEntryData DecodeCallstackPtr( uint64_t ptr )
file[fsz] = '\0';
cb.file = file;
cb.symAddr = symInlineValid ? si->Address : 0;
ctx++;
}
}