about summary refs log tree commit diff stats
path: root/src/emu/x64run.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/x64run.c')
-rw-r--r--src/emu/x64run.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/emu/x64run.c b/src/emu/x64run.c
index fecb1311..614bf91c 100644
--- a/src/emu/x64run.c
+++ b/src/emu/x64run.c
@@ -1488,6 +1488,7 @@ x64emurun:
             STEP2;
             break;
         case 0xCC:                      /* INT 3 */
+            R_RIP = addr;   // update RIP
             #ifndef TEST_INTERPRETER
             x64Int3(emu, &addr);
             if(emu->quit) goto fini;    // R_RIP is up to date when returning from x64Int3
@@ -1511,6 +1512,7 @@ x64emurun:
                 printf_log(LOG_DEBUG, "INT 29 called => __fastfail(0x%x)\n", R_ECX);
                 emit_interruption(emu, 0x29, (void*)R_RIP);
             } else if (tmp8u==0x80) {
+                R_RIP = addr;
                 // 32bits syscall
                 #ifndef TEST_INTERPRETER
                 x86Syscall(emu);
@@ -1518,9 +1520,17 @@ x64emurun:
                 #else
                 test->notest = 1;
                 #endif
+            } else if (tmp8u==0x03) {
+                R_RIP = addr;
+                #ifndef TEST_INTERPRETER
+                emit_signal(emu, SIGTRAP, NULL, 3);
+                STEP2;
+                #else
+                test->notest = 1;
+                #endif
             } else {
                 #ifndef TEST_INTERPRETER
-                emit_signal(emu, SIGSEGV, (void*)R_RIP, 0);
+                emit_interruption(emu, tmp8u, (void*)R_RIP);
                 STEP2;
                 #else
                 test->notest = 1;
@@ -1533,6 +1543,7 @@ x64emurun:
                 goto fini;
             }
             emu->old_ip = R_RIP;
+            R_RIP = addr;
             #ifndef TEST_INTERPRETER
             CHECK_FLAGS(emu);
             if(ACCESS_FLAG(F_OF))