Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Yao Qi <qiyaoltc@gmail.com>
Cc: John Baldwin <jhb@freebsd.org>, gdb-patches@sourceware.org
Subject: Re: [PATCH v2] Fix PR gdb/18653: gdb disturbs inferior's inherited signal dispositions
Date: Fri, 12 Aug 2016 09:08:00 -0000	[thread overview]
Message-ID: <debcfa12-bd68-8b40-e3d1-ffa2fced8024@redhat.com> (raw)
In-Reply-To: <86inv6cs8o.fsf@gmail.com>

On 08/12/2016 09:21 AM, Yao Qi wrote:
> Pedro Alves <palves@redhat.com> writes:
> 
>> +      else
>> +	{
>> +	  int m;
>> +
>> +	  fprintf (out, "sigaction={sa_handler=", i);
> 
> The redundant "i" causes a compilation warning,
> 
> gdb/testsuite/gdb.base/signals-state-child.c:77:4: warning: too many arguments for format [-Wformat-extra-args]
>     fprintf (out, "sigaction={sa_handler=", i);
>     ^
> 
> The patch blow fixes this.  With this patch applied, the test case can
> be compiled successfully.  

Thanks.  It's simply that v1 used it like this:

+      if (oldact.sa_handler == SIG_DFL)
+	fprintf (out, "%d: SIG_DFL\n", i);
+      else if (oldact.sa_handler == SIG_IGN)
+	fprintf (out, "%d: SIG_IGN\n", i);

and in v2 the signal number printing go split to a separate fprintf:

+      fprintf (out, "signal %d: ", i);

... I missed the 'i' that was left behind.

Please push.

> However test fails,
> 
> shell diff -s /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/outputs/gdb.base/signals-state-child/standalone.txt /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/outputs/gdb.base/signals-state-child/gdb.txt^M
> 13c13^M
> < signal 13: sigaction={sa_handler=SIG_DFL, sa_mask=0000000000000000000000000000000000000000000000000000000000000000, sa_flags=0}, masked=0^M
> ---^M
>> signal 13: sigaction={sa_handler=SIG_IGN, sa_mask=0000000000000000000000000000000000000000000000000000000000000000, sa_flags=0}, masked=0^M
> 25c25^M
> < signal 25: sigaction={sa_handler=SIG_DFL, sa_mask=0000000000000000000000000000000000000000000000000000000000000000, sa_flags=0}, masked=0^M
> ---^M
>> signal 25: sigaction={sa_handler=SIG_IGN, sa_mask=0000000000000000000000000000000000000000000000000000000000000000, sa_flags=0}, masked=0^M
> (gdb) FAIL: gdb.base/signals-state-child.exp: signals states are identical
> 

First thing to check is whether running the standalone vs through-gdb check
outside dejagnu also shows differences. 

I realize now that NSIG is not the right upper bound, since it
doesn't cover the realtime signals.  Maybe it should be _NSIG if
available.  But that shouldn't explain this particular problem,
since NSIG is 32.

Thanks,
Pedro Alves


  reply	other threads:[~2016-08-12  9:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-04 17:37 [PATCH] " Pedro Alves
2016-08-05  0:08 ` John Baldwin
2016-08-05  1:04   ` Pedro Alves
2016-08-05 10:57     ` [PATCH v2] " Pedro Alves
2016-08-08 17:28       ` John Baldwin
2016-08-12  8:21       ` Yao Qi
2016-08-12  9:08         ` Pedro Alves [this message]
2016-08-22 14:28       ` Yao Qi
2016-08-22 14:34         ` Pedro Alves
2016-08-23 13:20           ` Yao Qi

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=debcfa12-bd68-8b40-e3d1-ffa2fced8024@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jhb@freebsd.org \
    --cc=qiyaoltc@gmail.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