mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-10 08:17:51 -06:00
Improve Windows crash log (#2736)
* Show RVA of each call stack so we can locate the symbol with pdb file * CI upload pdb file
This commit is contained in:
parent
3f3bd08a70
commit
016d3a74eb
3 changed files with 30 additions and 5 deletions
7
.github/workflows/build_orca.yml
vendored
7
.github/workflows/build_orca.yml
vendored
|
@ -224,6 +224,13 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: OrcaSlicer_Windows_V${{ env.ver }}
|
name: OrcaSlicer_Windows_V${{ env.ver }}
|
||||||
path: ${{ github.workspace }}/build/OrcaSlicer*.exe
|
path: ${{ github.workspace }}/build/OrcaSlicer*.exe
|
||||||
|
|
||||||
|
- name: Upload artifacts Win PDB
|
||||||
|
if: matrix.os == 'windows-latest'
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: OrcaSlicer_Windows_V${{ env.ver }}_pdb
|
||||||
|
path: ${{ github.workspace }}/build/src/Release/*.pdb
|
||||||
# Ubuntu
|
# Ubuntu
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
|
|
@ -91,8 +91,26 @@ void CBaseException::ShowLoadModules()
|
||||||
|
|
||||||
void CBaseException::ShowCallstack(HANDLE hThread, const CONTEXT* context)
|
void CBaseException::ShowCallstack(HANDLE hThread, const CONTEXT* context)
|
||||||
{
|
{
|
||||||
OutputString(_T("Show CallStack:\r\n"));
|
OutputString(_T("Show CallStack:\n"));
|
||||||
LPSTACKINFO phead = StackWalker(hThread, context);
|
LPSTACKINFO phead = StackWalker(hThread, context);
|
||||||
|
|
||||||
|
// Show RVA of each call stack, so we can locate the symbol using pdb file
|
||||||
|
// To show the symbol, load the <szFaultingModule> in WinDBG with pdb file, then type the following commands:
|
||||||
|
// > lm which gives you the start address of each module, as well as module names
|
||||||
|
// > !dh <module name> list all module headers. Find the <virtual address> of the section given by
|
||||||
|
// the <section> output in the crash log
|
||||||
|
// > ln <module start address> + <section virtual address> + <offset> reveals the debug symbol
|
||||||
|
OutputString(_T("\nLogical Address:\n"));
|
||||||
|
TCHAR szFaultingModule[MAX_PATH];
|
||||||
|
DWORD section, offset;
|
||||||
|
for (LPSTACKINFO ps = phead; ps != nullptr; ps = ps->pNext) {
|
||||||
|
if (GetLogicalAddress((PVOID) ps->szFncAddr, szFaultingModule, sizeof(szFaultingModule), section, offset)) {
|
||||||
|
OutputString(_T("0x%X 0x%X:0x%X %s\n"), ps->szFncAddr, section, offset, szFaultingModule);
|
||||||
|
} else {
|
||||||
|
OutputString(_T("0x%X Unknown\n"), ps->szFncAddr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
FreeStackInformations(phead);
|
FreeStackInformations(phead);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -491,7 +491,7 @@ LPSTACKINFO CStackWalker::StackWalker(HANDLE hThread, const CONTEXT* context)
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
//调用错误一般是487(地址无效或者没有访问的权限、在符号表中未找到指定地址的相关信息)
|
//调用错误一般是487(地址无效或者没有访问的权限、在符号表中未找到指定地址的相关信息)
|
||||||
this->OutputString(_T("Call SymGetSymFromAddr64 ,Address %08x Error:%08x\r\n"), sf.AddrPC.Offset, GetLastError());
|
//this->OutputString(_T("Call SymGetSymFromAddr64 ,Address %08x Error:%08x\n"), sf.AddrPC.Offset, GetLastError());
|
||||||
|
|
||||||
StringCchCopy(pCallStack->undFullName, STACKWALK_MAX_NAMELEN, textconv_helper::A2T_("Unknown"));
|
StringCchCopy(pCallStack->undFullName, STACKWALK_MAX_NAMELEN, textconv_helper::A2T_("Unknown"));
|
||||||
}
|
}
|
||||||
|
@ -502,14 +502,14 @@ LPSTACKINFO CStackWalker::StackWalker(HANDLE hThread, const CONTEXT* context)
|
||||||
pCallStack->uFileNum = pLine->LineNumber;
|
pCallStack->uFileNum = pLine->LineNumber;
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
this->OutputString(_T("Call SymGetLineFromAddr64 ,Address %08x Error:%08x\r\n"), sf.AddrPC.Offset, GetLastError());
|
//this->OutputString(_T("Call SymGetLineFromAddr64 ,Address %08x Error:%08x\n"), sf.AddrPC.Offset, GetLastError());
|
||||||
|
|
||||||
StringCchCopy(pCallStack->szFileName, MAX_PATH, textconv_helper::A2T_("Unknown file"));
|
StringCchCopy(pCallStack->szFileName, MAX_PATH, textconv_helper::A2T_("Unknown file"));
|
||||||
pCallStack->uFileNum = -1;
|
pCallStack->uFileNum = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//这里为了将获取函数信息失败的情况与正常的情况一起输出,防止用户在查看时出现误解
|
//这里为了将获取函数信息失败的情况与正常的情况一起输出,防止用户在查看时出现误解
|
||||||
this->OutputString(_T("%08llx:%s [%s][%ld]\r\n"), pCallStack->szFncAddr, pCallStack->undFullName, pCallStack->szFileName, pCallStack->uFileNum);
|
this->OutputString(_T("%08llx:%s [%s][%ld]\n"), pCallStack->szFncAddr, pCallStack->undFullName, pCallStack->szFileName, pCallStack->uFileNum);
|
||||||
if (NULL == pHead)
|
if (NULL == pHead)
|
||||||
{
|
{
|
||||||
pHead = pCallStack;
|
pHead = pCallStack;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue