Message ID | 86inv6cs8o.fsf@gmail.com |
---|---|
State | New, archived |
Headers |
Received: (qmail 8436 invoked by alias); 12 Aug 2016 08:21:46 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 8423 invoked by uid 89); 12 Aug 2016 08:21:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, KAM_LOTSOFHASH, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=sk:wformat, sk:Wformat, Hx-languages-length:2498, **argv X-HELO: mail-pf0-f193.google.com Received: from mail-pf0-f193.google.com (HELO mail-pf0-f193.google.com) (209.85.192.193) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 12 Aug 2016 08:21:35 +0000 Received: by mail-pf0-f193.google.com with SMTP id i6so1174125pfe.0 for <gdb-patches@sourceware.org>; Fri, 12 Aug 2016 01:21:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=5NUooqIbtSG21I0NFt7rXHWLVynAEcjvpK8wvWqkxKI=; b=UxxY+1IoCckMJVgR/APjwBZBJjiBVPsA/w1AFf+DSupVKt7R2me7E+Z1MyQ/PtFpjN jR5mnQwVn+f2xcjJFt7oVMJeSXhaFG94c1SuonNNvXdaG7sKqoGme2xJLq24SOpvJkyi /ZasNrwc6KilsNENv0R7KMYspQJv6Tw2odKIMjGK2bBnhlYl+djnB1oqnFe7JZE94sT4 WgGdZDwi8UlGlcHQVYfz5L8/gDLu54LfXOOhYHBL+hsaFkbkUESSHB2l058Q1L1Qkck7 dXRNqOoz8idREEyph32gAVLE6WHQ73CupQk3AWqc3Z86E+gfogvecu+I6I3HW7MxkUEN u2RA== X-Gm-Message-State: AEkoousWcOjiqwiqr7JiepeJ+HZ70XJ/Lh63mewvfR9XalSPNYh0uCjFEYJwTProfwi+9w== X-Received: by 10.98.58.149 with SMTP id v21mr24922647pfj.19.1470990093521; Fri, 12 Aug 2016 01:21:33 -0700 (PDT) Received: from E107787-LIN (gcc115.osuosl.org. [140.211.9.73]) by smtp.gmail.com with ESMTPSA id u72sm10748059pfa.31.2016.08.12.01.21.30 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 12 Aug 2016 01:21:32 -0700 (PDT) From: Yao Qi <qiyaoltc@gmail.com> To: Pedro Alves <palves@redhat.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 References: <1470332251-10857-1-git-send-email-palves@redhat.com> <2148041.k6fglmTO5R@ralph.baldwin.cx> <ab4e62e3-cdd0-3405-1599-0664413030a2@redhat.com> <86d1ddee-9841-d332-27d5-15c8c185063e@redhat.com> Date: Fri, 12 Aug 2016 09:21:27 +0100 In-Reply-To: <86d1ddee-9841-d332-27d5-15c8c185063e@redhat.com> (Pedro Alves's message of "Fri, 5 Aug 2016 11:56:56 +0100") Message-ID: <86inv6cs8o.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes |
Commit Message
Yao Qi
Aug. 12, 2016, 8:21 a.m. UTC
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. 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
Comments
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
diff --git a/gdb/testsuite/gdb.base/signals-state-child.c b/gdb/testsuite/gdb.base/signals-state-child.c index e11fa93..f934c86 100644 --- a/gdb/testsuite/gdb.base/signals-state-child.c +++ b/gdb/testsuite/gdb.base/signals-state-child.c @@ -74,7 +74,7 @@ main (int argc, char **argv) { int m; - fprintf (out, "sigaction={sa_handler=", i); + fprintf (out, "sigaction={sa_handler="); if (oldact.sa_handler == SIG_DFL) fprintf (out, "SIG_DFL");