mirror of https://github.com/OpenTTD/OpenTTD
(svn r22491) -Fix [FS#4623]: [Windows] Generate crashlogs correctly in binaries created with MinGW-w64. (JGR)
parent
1f3853249d
commit
cee94be7db
|
@ -243,11 +243,11 @@ static char *PrintModuleInfo(char *output, const char *last, HMODULE mod)
|
||||||
buffer += seprintf(buffer, last, "Registers:\n");
|
buffer += seprintf(buffer, last, "Registers:\n");
|
||||||
#ifdef _M_AMD64
|
#ifdef _M_AMD64
|
||||||
buffer += seprintf(buffer, last,
|
buffer += seprintf(buffer, last,
|
||||||
" RAX: %.16llX RBX: %.16llX RCX: %.16llX RDX: %.16llX\n"
|
" RAX: %.16I64X RBX: %.16I64X RCX: %.16I64X RDX: %.16I64X\n"
|
||||||
" RSI: %.16llX RDI: %.16llX RBP: %.16llX RSP: %.16llX\n"
|
" RSI: %.16I64X RDI: %.16I64X RBP: %.16I64X RSP: %.16I64X\n"
|
||||||
" R8: %.16llX R9: %.16llX R10: %.16llX R11: %.16llX\n"
|
" R8: %.16I64X R9: %.16I64X R10: %.16I64X R11: %.16I64X\n"
|
||||||
" R12: %.16llX R13: %.16llX R14: %.16llX R15: %.16llX\n"
|
" R12: %.16I64X R13: %.16I64X R14: %.16I64X R15: %.16I64X\n"
|
||||||
" RIP: %.16llX EFLAGS: %.8X\n",
|
" RIP: %.16I64X EFLAGS: %.8lX\n",
|
||||||
ep->ContextRecord->Rax,
|
ep->ContextRecord->Rax,
|
||||||
ep->ContextRecord->Rbx,
|
ep->ContextRecord->Rbx,
|
||||||
ep->ContextRecord->Rcx,
|
ep->ContextRecord->Rcx,
|
||||||
|
@ -548,7 +548,6 @@ static void CDECL CustomAbort(int signal)
|
||||||
|
|
||||||
/* static */ void CrashLog::InitialiseCrashLog()
|
/* static */ void CrashLog::InitialiseCrashLog()
|
||||||
{
|
{
|
||||||
#if defined(_MSC_VER)
|
|
||||||
#ifdef _M_AMD64
|
#ifdef _M_AMD64
|
||||||
CONTEXT ctx;
|
CONTEXT ctx;
|
||||||
RtlCaptureContext(&ctx);
|
RtlCaptureContext(&ctx);
|
||||||
|
@ -559,12 +558,13 @@ static void CDECL CustomAbort(int signal)
|
||||||
* alignment would be wrong in the called function. */
|
* alignment would be wrong in the called function. */
|
||||||
_safe_esp = (void *)(ctx.Rsp - 8);
|
_safe_esp = (void *)(ctx.Rsp - 8);
|
||||||
#else
|
#else
|
||||||
|
#if defined(_MSC_VER)
|
||||||
_asm {
|
_asm {
|
||||||
mov _safe_esp, esp
|
mov _safe_esp, esp
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#else
|
#else
|
||||||
asm("movl %esp, __safe_esp");
|
asm("movl %esp, __safe_esp");
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* SIGABRT is not an unhandled exception, so we need to intercept it. */
|
/* SIGABRT is not an unhandled exception, so we need to intercept it. */
|
||||||
|
|
Loading…
Reference in New Issue