diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/dynarec/arm64/dynarec_arm64_00.c | 28 | ||||
| -rw-r--r-- | src/dynarec/rv64/dynarec_rv64_00_3.c | 28 | ||||
| -rw-r--r-- | src/emu/x64int3.c | 8 | ||||
| -rw-r--r-- | src/include/debug.h | 1 | ||||
| -rw-r--r-- | src/main.c | 10 | ||||
| -rw-r--r-- | src/tools/rcfile.c | 1 |
6 files changed, 43 insertions, 33 deletions
diff --git a/src/dynarec/arm64/dynarec_arm64_00.c b/src/dynarec/arm64/dynarec_arm64_00.c index 59cbe4ad..d1c44bab 100644 --- a/src/dynarec/arm64/dynarec_arm64_00.c +++ b/src/dynarec/arm64/dynarec_arm64_00.c @@ -2122,23 +2122,21 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin } } } else { - #if 1 INST_NAME("INT 3"); - // check if TRAP signal is handled - TABLE64(x1, (uintptr_t)my_context); - MOV32w(x2, offsetof(box64context_t, signals[SIGTRAP])); - LDRx_REG(x3, x1, x2); - //LDRx_U12(x3, x1, offsetof(box64context_t, signals[SIGTRAP])); - CMPSx_U12(x3, 0); - B_NEXT(cEQ); - GETIP(ip); - STORE_XEMU_CALL(xRIP); - CALL(native_int3, -1); - LOAD_XEMU_CALL(xRIP); + if(!box64_ignoreint3) { + // check if TRAP signal is handled + TABLE64(x1, (uintptr_t)my_context); + MOV32w(x2, offsetof(box64context_t, signals[SIGTRAP])); + LDRx_REG(x3, x1, x2); + //LDRx_U12(x3, x1, offsetof(box64context_t, signals[SIGTRAP])); + CMPSx_U12(x3, 0); + B_NEXT(cEQ); + GETIP(ip); + STORE_XEMU_CALL(xRIP); + CALL(native_int3, -1); + LOAD_XEMU_CALL(xRIP); + } break; - #else - DEFAULT; - #endif } break; case 0xCD: diff --git a/src/dynarec/rv64/dynarec_rv64_00_3.c b/src/dynarec/rv64/dynarec_rv64_00_3.c index fa074293..f11f68c0 100644 --- a/src/dynarec/rv64/dynarec_rv64_00_3.c +++ b/src/dynarec/rv64/dynarec_rv64_00_3.c @@ -374,22 +374,20 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int } } } else { - #if 1 - INST_NAME("INT 3"); - // check if TRAP signal is handled - LD(x1, xEmu, offsetof(x64emu_t, context)); - MOV64x(x2, offsetof(box64context_t, signals[SIGTRAP])); - ADD(x2, x2, x1); - LD(x3, x2, 0); - CBZ_NEXT(x3); - GETIP(ip); - STORE_XEMU_CALL(x3); - CALL(native_int3, -1); - LOAD_XEMU_CALL(); + if(!box64_ignoreint3) { + INST_NAME("INT 3"); + // check if TRAP signal is handled + LD(x1, xEmu, offsetof(x64emu_t, context)); + MOV64x(x2, offsetof(box64context_t, signals[SIGTRAP])); + ADD(x2, x2, x1); + LD(x3, x2, 0); + CBZ_NEXT(x3); + GETIP(ip); + STORE_XEMU_CALL(x3); + CALL(native_int3, -1); + LOAD_XEMU_CALL(); + } break; - #else - DEFAULT; - #endif } break; case 0xCD: diff --git a/src/emu/x64int3.c b/src/emu/x64int3.c index c287d18d..4a5792ff 100644 --- a/src/emu/x64int3.c +++ b/src/emu/x64int3.c @@ -358,10 +358,12 @@ void x64Int3(x64emu_t* emu, uintptr_t* addr) } return; } - if(1 && my_context->signals[SIGTRAP]) + if(!box64_ignoreint3 && my_context->signals[SIGTRAP]) emit_signal(emu, SIGTRAP, (void*)R_RIP, 128); - else - printf_log(LOG_INFO, "%04d|Warning, ignoring unsupported Int 3 call @%p\n", GetTID(), (void*)R_RIP); + else { + printf_log(LOG_DEBUG, "%04d|Warning, ignoring unsupported Int 3 call @%p\n", GetTID(), (void*)R_RIP); + R_RIP = *addr; + } //emu->quit = 1; } diff --git a/src/include/debug.h b/src/include/debug.h index 177404da..70502586 100644 --- a/src/include/debug.h +++ b/src/include/debug.h @@ -12,6 +12,7 @@ extern uintptr_t box64_load_addr; extern int box64_dynarec_test; extern int box64_maxcpu; extern int box64_mmap32; +extern int box64_ignoreint3; #ifdef DYNAREC extern int box64_dynarec_dump; extern int box64_dynarec_trace; diff --git a/src/main.c b/src/main.c index 267c84bd..f6b52ad4 100644 --- a/src/main.c +++ b/src/main.c @@ -55,6 +55,7 @@ int box64_maxcpu = 0; int box64_mmap32 = 1; #else int box64_mmap32 = 0; +int box64_ignoreint3 = 0; #endif #ifdef DYNAREC int box64_dynarec = 1; @@ -980,6 +981,15 @@ void LoadLogEnv() else printf_log(LOG_INFO, "Will not use 32bits address in priority for external MMAP (when 32bits process are detected)\n"); } + p = getenv("BOX64_IGNOREINT3"); + if(p) { + if(strlen(p)==1) { + if(p[0]>='0' && p[0]<='0'+1) + box64_ignoreint3 = p[0]-'0'; + } + if(box64_ignoreint3) + printf_log(LOG_INFO, "Will silently ignore INT3 in the code\n"); + } box64_pagesize = sysconf(_SC_PAGESIZE); if(!box64_pagesize) box64_pagesize = 4096; diff --git a/src/tools/rcfile.c b/src/tools/rcfile.c index 15cb6955..42cf647c 100644 --- a/src/tools/rcfile.c +++ b/src/tools/rcfile.c @@ -87,6 +87,7 @@ CENTRYBOOL(BOX64_NOSIGILL, no_sigill) \ ENTRYBOOL(BOX64_SHOWSEGV, box64_showsegv) \ ENTRYBOOL(BOX64_SHOWBT, box64_showbt) \ ENTRYBOOL(BOX64_MMAP32, box64_mmap32) \ +ENTRYBOOL(BOX64_MMAP32, box64_ignoreint3) \ ENTRYBOOL(BOX64_X11THREADS, box64_x11threads) \ ENTRYBOOL(BOX64_X11GLX, box64_x11glx) \ ENTRYDSTRING(BOX64_LIBGL, box64_libGL) \ |