]> mj.ucw.cz Git - moe.git/commitdiff
Detect breakpoint instructions, which are reported as syscall #-1.
authorMartin Mares <mj@ucw.cz>
Sun, 24 Aug 2008 21:59:24 +0000 (23:59 +0200)
committerMartin Mares <mj@ucw.cz>
Sun, 24 Aug 2008 21:59:24 +0000 (23:59 +0200)
box/box.c

index 2aaec6ae92a6621e7207998e1f0b38d5437fe3a3..a9a9ec5682ee8d2b09d7ac46e1f26fdbb4d1b47f 100644 (file)
--- a/box/box.c
+++ b/box/box.c
@@ -901,6 +901,8 @@ boxkeeper(void)
              static int stop_count = -1;
              if (ptrace(PTRACE_GETREGS, box_pid, NULL, &u) < 0)
                die("ptrace(PTRACE_GETREGS): %m");
+             if (u.regs.orig_eax < 0)          /* Process issued a breakpoint instruction */
+               err("SG: Breakpoint");
              stop_count++;
              if (!stop_count)                  /* Traceme request */
                msg(">> Traceme request caught\n");