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 a546cfd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 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 @@ -501,8 +502,10 @@ LPSTACKINFO CStackWalker::StackWalker(HANDLE hThread, const CONTEXT* context)
pCallStack->uFileNum = pLine->LineNumber;
}else
{
this->OutputString(_T("Call SymGetLineFromAddr64 ,Address %08x Error:%08x\r\n"), sf.AddrPC.Offset, GetLastError());
continue;
this->OutputString(_T("Call SymGetLineFromAddr64 ,Address %08x Error:%08x\r\n"), sf.AddrPC.Offset, GetLastError());

StringCchCopy(pCallStack->szFileName, MAX_PATH, textconv_helper::A2T_("Unknown file"));
pCallStack->uFileNum = -1;
}

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

0 comments on commit a546cfd

Please sign in to comment.