mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-18 12:08:38 +00:00
Report host registers, code bytes and memory at a crash
The crash report named the lifted function and printed the guest registers, but the lifted code keeps guest registers in host locals and writes them back only at calls, so the dump showed stale values and the faulting instruction stayed unknown. Logs from #1005, #967 and #998 could not be traced further than the function. The report now adds the x86 registers of the faulting thread (Windows and Linux), 64 bytes of machine code around rip with the offset into the lifted function, so the instruction can be found in a local build of the same version, 64 bytes of memory around every register value that points at readable memory, and the first 128 bytes of the guest stack. --probe-kernel checks the new lines with a child that faults with known values in rbx and x19. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7e440be7ca
commit
06d70d0dfa
5 files changed
+149
-5
No files matched your search
@@ -957,6 +957,10 @@ static void fault_handler(int sig, siginfo_t *si, void *uc) {
|
||||
}
|
||||
if (sig == SIGSEGV || sig == SIGBUS)
|
||||
c.access = (err & 16) ? 8 : (err & 2) ? 1 : 0, c.addr = (uint64_t)(uintptr_t)si->si_addr;
|
||||
static const int gr[16] = {REG_RAX, REG_RCX, REG_RDX, REG_RBX, REG_RSP, REG_RBP, REG_RSI, REG_RDI,
|
||||
REG_R8, REG_R9, REG_R10, REG_R11, REG_R12, REG_R13, REG_R14, REG_R15};
|
||||
for (int i = 0; i < 16; i++) c.gpr[i] = (uint64_t)u->uc_mcontext.gregs[gr[i]];
|
||||
c.has_regs = 1;
|
||||
crash_fn(&c);
|
||||
}
|
||||
signal(sig, SIG_DFL); // returns into the faulting instruction, which faults again with the default action
|
||||
|
||||
Reference in new issue
Block a user