From 2a2ebbc8f0542e5fac7f11a63660e480ba305d5c Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 21 Apr 2004 15:39:57 +0000 Subject: [PATCH] Change the debugger attachment code to send the STOP signal to the forked process before using ptrace() to continue it, instead of asking ptrace to deliver it, as that doesn't seem to work on some versions of linux. CCMAIL: 77824-done@bugs.kde.org git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2380 --- coregrind/vg_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/coregrind/vg_main.c b/coregrind/vg_main.c index 5ffca110a2..9da5b98d27 100644 --- a/coregrind/vg_main.c +++ b/coregrind/vg_main.c @@ -350,7 +350,8 @@ void VG_(start_debugger) ( Int tid ) if ((res = VG_(waitpid)(pid, &status, 0)) == pid && WIFSTOPPED(status) && WSTOPSIG(status) == SIGSTOP && ptrace(PTRACE_SETREGS, pid, NULL, ®s) == 0 && - ptrace(PTRACE_DETACH, pid, NULL, SIGSTOP) == 0) { + kill(pid, SIGSTOP) == 0 && + ptrace(PTRACE_DETACH, pid, NULL, 0) == 0) { Char pidbuf[15]; Char file[30]; Char buf[100]; -- 2.47.2