This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix gdb.base/watch-vfork.exp: Watchpoint triggers after vfork (sw) (timeout) with Linux 2.6.32 and older version
- From: Hui Zhu <hui_zhu at mentor dot com>
- To: Pedro Alves <palves at redhat dot com>, gdb-patches ml <gdb-patches at sourceware dot org>
- Date: Fri, 4 Jul 2014 00:24:18 +0800
- Subject: Re: [PATCH] Fix gdb.base/watch-vfork.exp: Watchpoint triggers after vfork (sw) (timeout) with Linux 2.6.32 and older version
- Authentication-results: sourceware.org; auth=none
- References: <533D17E2 dot 9070402 at mentor dot com> <538636AF dot 9040208 at redhat dot com> <539020AB dot 8050105 at mentor dot com> <53902DAA dot 4090602 at redhat dot com> <5394460F dot 7060201 at mentor dot com>
OK with that change.
Thanks for your help. Committed as
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c077881afaedb9b74063bee992b3e472b4b6e9ca
Best,
Hui
Hi Pedro,
After this patch, I still got fail with this test in Linux 2.6.32.
The cause this:
signo = WSTOPSIG (status);
#In linux 2.6.32, signo will be SIGSTOP.
if (signo != 0
&& !signal_pass_state (gdb_signal_from_host (signo)))
signo = 0;
#SIGSTOP will send to child and make it stop.
ptrace (PTRACE_DETACH, child_pid, 0, signo);
So I make a patch to fix it.
Thanks,
Hui
2014-07-04 Hui Zhu <hui@codesourcery.com>
* linux-nat.c(linux_child_follow_fork): Add check if signo
is SIGSTOP.
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -472,8 +472,9 @@ holding the child stopped. Try \"set de
int signo;
signo = WSTOPSIG (status);
- if (signo != 0
- && !signal_pass_state (gdb_signal_from_host (signo)))
+ if (signo == SIGSTOP
+ || (signo != 0
+ && !signal_pass_state (gdb_signal_from_host (signo))))
signo = 0;
ptrace (PTRACE_DETACH, child_pid, 0, signo);
}