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++;
}
}

View File

@ -27,6 +27,7 @@ struct CallstackEntry
const char* name;
const char* file;
uint32_t line;
uint64_t symAddr;
};
struct CallstackEntryData

View File

@ -2233,6 +2233,7 @@ void Profiler::SendCallstackFrame( uint64_t ptr )
MemWrite( &item.callstackFrame.name, (uint64_t)frame.name );
MemWrite( &item.callstackFrame.file, (uint64_t)frame.file );
MemWrite( &item.callstackFrame.line, frame.line );
MemWrite( &item.callstackFrame.symAddr, frame.symAddr );
AppendData( &item, QueueDataSize[(int)QueueType::CallstackFrame] );

View File

@ -9,7 +9,7 @@ namespace tracy
constexpr unsigned Lz4CompressBound( unsigned isize ) { return isize + ( isize / 255 ) + 16; }
enum : uint32_t { ProtocolVersion = 26 };
enum : uint32_t { ProtocolVersion = 27 };
enum : uint32_t { BroadcastVersion = 0 };
using lz4sz_t = uint32_t;

View File

@ -309,6 +309,7 @@ struct QueueCallstackFrame
uint64_t name;
uint64_t file;
uint32_t line;
uint64_t symAddr;
};
struct QueueCrashReport