mirror of
https://github.com/ptitSeb/box86.git
synced 2025-05-08 21:08:57 +08:00
Adjusted some i386 signal translation
This commit is contained in:
parent
dcf89339b8
commit
278d8fe8d9
@ -607,10 +607,10 @@ void my_sigactionhandler_oldcode(int32_t sig, int simple, int Locks, siginfo_t*
|
||||
sigcontext->uc_mcontext.gregs[REG_TRAPNO] = ((info->si_code==SEGV_ACCERR) || (info->si_errno==0x1234) || ((uintptr_t)info->si_addr==0))?13:14;
|
||||
} else if((info->si_code==SEGV_ACCERR) && !(prot&PROT_WRITE)) {
|
||||
sigcontext->uc_mcontext.gregs[REG_ERR] = 0x0002; // write flag issue
|
||||
/*if(abs((intptr_t)info->si_addr-(intptr_t)sigcontext->uc_mcontext.gregs[REG_ESP])<16)
|
||||
if(abs((intptr_t)info->si_addr-(intptr_t)sigcontext->uc_mcontext.gregs[REG_ESP])<8)
|
||||
sigcontext->uc_mcontext.gregs[REG_TRAPNO] = 12; // stack overflow probably
|
||||
else*/
|
||||
sigcontext->uc_mcontext.gregs[REG_TRAPNO] = 13;
|
||||
else
|
||||
sigcontext->uc_mcontext.gregs[REG_TRAPNO] = 14;
|
||||
} else {
|
||||
sigcontext->uc_mcontext.gregs[REG_TRAPNO] = (info->si_code==SEGV_ACCERR)?13:14;
|
||||
//REG_ERR seems to be INT:8 CODE:8. So for write access segfault it's 0x0002 For a read it's 0x0004 (and 8 for exec). For an int 2d it could be 0x2D01 for example
|
||||
|
Loading…
x
Reference in New Issue
Block a user