mirror of
https://github.com/KjellKod/g3log.git
synced 2024-12-12 10:23:50 +01:00
fix issue with stacktrace_windows not allocating sufficient memory for SYMBOL_INFO struct (#334)
This commit is contained in:
parent
3ffc36a3a2
commit
9fb3e61e89
@ -110,7 +110,7 @@ namespace {
|
||||
|
||||
DWORD64 displacement64;
|
||||
DWORD displacement;
|
||||
char symbol_buffer[sizeof(SYMBOL_INFO) + 256];
|
||||
char symbol_buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME];
|
||||
SYMBOL_INFO *symbol = reinterpret_cast<SYMBOL_INFO *>(symbol_buffer);
|
||||
symbol->SizeOfStruct = sizeof(SYMBOL_INFO);
|
||||
symbol->MaxNameLen = MAX_SYM_NAME;
|
||||
@ -120,7 +120,7 @@ namespace {
|
||||
std::string lineInformation;
|
||||
std::string callInformation;
|
||||
if (SymFromAddr(GetCurrentProcess(), addr, &displacement64, symbol)) {
|
||||
callInformation.append(" ").append({std::string(symbol->Name), symbol->NameLen});
|
||||
callInformation.append(" ").append(std::string(symbol->Name, symbol->NameLen));
|
||||
if (SymGetLineFromAddr64(GetCurrentProcess(), addr, &displacement, &line)) {
|
||||
lineInformation.append("\t").append(line.FileName).append(" L: ");
|
||||
lineInformation.append(std::to_string(line.LineNumber));
|
||||
|
Loading…
Reference in New Issue
Block a user