From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12215 invoked by alias); 4 Dec 2017 15:50:02 -0000 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 Received: (qmail 12202 invoked by uid 89); 4 Dec 2017 15:50:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=1-3, erroneously, discrepancy, H*f:sk:87vahq5 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 04 Dec 2017 15:50:01 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3BE59356F4; Mon, 4 Dec 2017 15:50:00 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 92C2060C9E; Mon, 4 Dec 2017 15:49:59 +0000 (UTC) Subject: Re: [RFA] Fix regression in "commands" To: Tom Tromey References: <20171103190747.389-1-tom@tromey.com> <3a860acf-6e64-b2ba-e3fd-560406077259@redhat.com> <87vahq5rcw.fsf@tromey.com> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: <58677519-fc2d-457d-34b9-3014d24dc147@redhat.com> Date: Mon, 04 Dec 2017 15:50:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <87vahq5rcw.fsf@tromey.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-12/txt/msg00079.txt.bz2 On 12/01/2017 04:45 PM, Tom Tromey wrote: >>>>>> "Pedro" == Pedro Alves writes: > > Pedro> Hmm, for the truly "no breakpoints specified" case, > Pedro> it seems to me that before we can reach this error, we've already > Pedro> hit the error at the top of map_breakpoint_numbers: > Pedro> if (args == 0 || *args == '\0') > Pedro> error_no_arg (_("one or more breakpoint numbers")); > Pedro> and for the case where the user specifies some argument > Pedro> that doesn't match any breakpoint, map_breakpoint_numbers > Pedro> already printed one of: > Pedro> warning (_("bad breakpoint number at or near '%s'"), p); > Pedro> printf_unfiltered (_("No breakpoint number %d.\n"), num); > Pedro> when the "No breakpoints specified." error is reached. > > I think the problem is that if the error call is removed from > commands_command_1, then a failure here won't throw at all, because > map_breakpoint_number_range just prints a message (either with warning > or printf_unfiltered -- not sure why the discrepancy), and doesn't > throw. > > But, this would mean that an script erroneously using "commands" would > not be interrupted, which seems like maybe a bad result. Though, as you > point out, "delete" doesn't do this, so maybe it is ok? I think it's OK in the principle that "delete", "disable", etc. which seem like used-more-frequently commands, don't do this. I think that if we want to error out, then we should do that to all the commands that take command lists/ranges, and then maybe do it directly in map_breakpoint_number_range, perhaps. But I'd start with making "commands" not-error like the others. > > Making map_breakpoint_number_range throw would mean that the case where > you have breakpoint 2 and do "commands 1-3" would now fail -- although > that's worked with a warning since ranges were added. Right, doesn't seem very friently to make those error out. Thanks, Pedro Alves