Merge pull request #1216 from Sonicadvance1/fix_32bit_sigsegv

x86: Fixes siginfo_t si_addr for SIGBUS/SIGSEGV
This commit is contained in:
Ryan Houdek authored and GitHub committed 2021-08-22 22:26:27 -07:00
commit 6b87839437
1 file changed
+6
@@ -274,6 +274,12 @@ bool Dispatcher::HandleGuestSignal(int Signal, void *info, void *ucontext, Guest
switch (Signal) {
case SIGSEGV:
case SIGBUS:
// Macro expansion to get the si_addr
// This is the address trying to be accessed, not the RIP
guest_siginfo->_sifields._sigfault.addr = static_cast<uint32_t>(reinterpret_cast<uintptr_t>(HostSigInfo->si_addr));
break;
case SIGFPE:
case SIGILL:
// Macro expansion to get the si_addr
// Can't really give a real result here. Pull from the context for now
guest_siginfo->_sifields._sigfault.addr = Frame->State.rip;