From a8700d5028c6b2ca971b41258de041e677cbed7a Mon Sep 17 00:00:00 2001 From: Noisyfox Date: Wed, 11 Oct 2023 11:38:24 +0800 Subject: [PATCH] Show as much information as possible in crash log --- src/StackWalker.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/StackWalker.cpp b/src/StackWalker.cpp index f625d23e732..2d20cbd0dac 100644 --- a/src/StackWalker.cpp +++ b/src/StackWalker.cpp @@ -492,7 +492,8 @@ LPSTACKINFO CStackWalker::StackWalker(HANDLE hThread, const CONTEXT* context) { //调用错误一般是487(地址无效或者没有访问的权限、在符号表中未找到指定地址的相关信息) this->OutputString(_T("Call SymGetSymFromAddr64 ,Address %08x Error:%08x\r\n"), sf.AddrPC.Offset, GetLastError()); - continue; + + StringCchCopy(pCallStack->undFullName, STACKWALK_MAX_NAMELEN, textconv_helper::A2T_("Unknown")); } if (SymGetLineFromAddr64(m_hProcess, sf.AddrPC.Offset, (DWORD*)&dwDisplayment, pLine)) @@ -502,7 +503,9 @@ LPSTACKINFO CStackWalker::StackWalker(HANDLE hThread, const CONTEXT* context) }else { this->OutputString(_T("Call SymGetLineFromAddr64 ,Address %08x Error:%08x\r\n"), sf.AddrPC.Offset, GetLastError()); - continue; + + StringCchCopy(pCallStack->szFileName, MAX_PATH, textconv_helper::A2T_("Unknown file")); + pCallStack->uFileNum = -1; } //这里为了将获取函数信息失败的情况与正常的情况一起输出,防止用户在查看时出现误解