Skip to content

Commit

Permalink
Show as much information as possible in crash log
Browse files Browse the repository at this point in the history
  • Loading branch information
Noisyfox committed Oct 11, 2023
1 parent a24a132 commit a8700d5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/StackWalker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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;
}

//这里为了将获取函数信息失败的情况与正常的情况一起输出,防止用户在查看时出现误解
Expand Down

0 comments on commit a8700d5

Please sign in to comment.