From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29677 invoked by alias); 23 Aug 2012 17:38:15 -0000 Received: (qmail 29669 invoked by uid 22791); 23 Aug 2012 17:38:13 -0000 X-SWARE-Spam-Status: No, hits=-7.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 23 Aug 2012 17:37:57 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q7NHbsVH014207 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 23 Aug 2012 13:37:54 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q7NHbqIo004384; Thu, 23 Aug 2012 13:37:53 -0400 Message-ID: <50366A70.2010602@redhat.com> Date: Thu, 23 Aug 2012 17:38:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: Mike Frysinger CC: Eli Zaretskii , Doug Evans , gdb-patches@sourceware.org Subject: Re: further improve "handle" help string References: <1344704080-24677-1-git-send-email-vapier@gentoo.org> <201208142158.42487.vapier@gentoo.org> <503659B8.9020107@redhat.com> <201208231318.36988.vapier@gentoo.org> In-Reply-To: <201208231318.36988.vapier@gentoo.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-08/txt/msg00682.txt.bz2 On 08/23/2012 06:18 PM, Mike Frysinger wrote: > On Thursday 23 August 2012 12:26:32 Pedro Alves wrote: >> Multiple signals may be specified. Signal numbers and signal names >> may be interspersed with actions, with the actions being performed for >> all signals cumulatively specified. > > this doesn't accurately describe real world behavior (but maybe that's a > bug?). this is why i avoided that aspect in the first place :(. > for example: > (gdb) handle SIGHUP SIGUSR1 SIGUSR2 SIGPWR > Signal Stop Print Pass to program Description > SIGHUP Yes Yes Yes Hangup > SIGUSR1 Yes Yes Yes User defined signal 1 > SIGUSR2 Yes Yes Yes User defined signal 2 > SIGPWR Yes Yes Yes Power fail/restart > (gdb) handle SIGHUP SIGUSR1 SIGUSR2 nostop SIGPWR > Signal Stop Print Pass to program Description > SIGHUP No Yes Yes Hangup > SIGUSR1 No Yes Yes User defined signal 1 > SIGUSR2 No Yes Yes User defined signal 2 > SIGPWR Yes Yes Yes Power fail/restart > (gdb) handle SIGPWR > Signal Stop Print Pass to program Description > SIGPWR Yes Yes Yes Power fail/restart > (gdb) handle SIGHUP SIGUSR1 SIGUSR2 SIGPWR nostop > Signal Stop Print Pass to program Description > SIGHUP No Yes Yes Hangup > SIGUSR1 No Yes Yes User defined signal 1 > SIGUSR2 No Yes Yes User defined signal 2 > SIGPWR No Yes Yes Power fail/restart > > so saying "all signals cumulatively" is not how the code is behaving. I had interpreted "cumulatively" as what the code is doing. As in, "all signals specified so far, when the action is parsed". That's what we see above. Another e.g., (gdb) handle SIGHUP SIGUSR1 noprint SIGUSR2 SIGPWR nopass Signal Stop Print Pass to program Description SIGHUP No No No Hangup SIGUSR1 No No No User defined signal 1 SIGUSR2 Yes Yes No User defined signal 2 SIGPWR Yes Yes No Power fail/restart IOW, I interpreted it as "noprint" (implies nostop) applying to all signals accumulated that far (SIGHUP, SIGUSR1), and then "nopass" applying to all accumulated signals at the end (all 4). Consequently, this: (gdb) handle SIGHUP SIGUSR1 pass SIGUSR2 SIGPWR nopass Sets all signals to "nopass". I don't frequently intersperse. Rather, I do things like: handle SIGTRAP SIG34 SIG35 pass nostop noprint I have already applied the patch, but if we want to change the behavior, or the text, that's fine with me. -- Pedro Alves