public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Hui Zhu <hui_zhu@mentor.com>
To: Pedro Alves <palves@redhat.com>,
	gdb-patches ml	<gdb-patches@sourceware.org>
Subject: Re: [PATCH] Fix gdb.base/watch-vfork.exp: Watchpoint triggers after vfork (sw) (timeout) with Linux 2.6.32 and older version
Date: Thu, 03 Jul 2014 16:24:00 -0000	[thread overview]
Message-ID: <53B583B2.1040407@mentor.com> (raw)
In-Reply-To: <5394460F.7060201@mentor.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);
  	    }

  parent reply	other threads:[~2014-07-03 16:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-03  8:12 Hui Zhu
2014-05-28 19:19 ` Pedro Alves
2014-06-04  8:43   ` Hui Zhu
2014-06-04 16:11     ` Pedro Alves
2014-06-05  7:48   ` Hui Zhu
2014-06-05  8:43     ` Pedro Alves
2014-06-08 11:16       ` Hui Zhu
2014-06-09 13:58         ` [pushed] Fix a bunch of fork related regressions. (was: Re: [PATCH] Fix gdb.base/watch-vfork.exp: Watchpoint triggers after vfork (sw) (timeout) with Linux 2.6.32 and older version) Pedro Alves
2014-07-03 16:24         ` Hui Zhu [this message]
2014-07-04 17:51           ` [PATCH] Handle signals sent to a fork/vfork child before it has a chance to first run (Re: " Pedro Alves
2014-07-05  6:08             ` Hui Zhu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53B583B2.1040407@mentor.com \
    --to=hui_zhu@mentor.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).