Fix gdb.base/watch-vfork.exp: Watchpoint triggers after vfork (sw) (timeout) with Linux 2.6.32 and older version
Commit Message
>
>>
>> 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.
@@ -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);
}