From 2df8a8134aabd09151bfb3bb04c2a201a60d10b0 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sun, 24 Aug 2008 23:59:24 +0200 Subject: [PATCH] Detect breakpoint instructions, which are reported as syscall #-1. --- box/box.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/box/box.c b/box/box.c index 2aaec6a..a9a9ec5 100644 --- 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"); -- 2.39.2