From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 89633 invoked by alias); 1 Dec 2017 16:45:58 -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 89406 invoked by uid 89); 1 Dec 2017 16:45:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00,KB_WAM_FROM_NAME_SINGLEWORD,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=1-3 X-HELO: gateway36.websitewelcome.com Received: from gateway36.websitewelcome.com (HELO gateway36.websitewelcome.com) (192.185.201.2) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 01 Dec 2017 16:45:54 +0000 Received: from cm15.websitewelcome.com (cm15.websitewelcome.com [100.42.49.9]) by gateway36.websitewelcome.com (Postfix) with ESMTP id 21E51400E335C for ; Fri, 1 Dec 2017 10:45:53 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id KoRkeDru5R0LfKoRkeA5qN; Fri, 01 Dec 2017 10:45:53 -0600 Received: from 71-218-90-63.hlrn.qwest.net ([71.218.90.63]:44850 helo=pokyo) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1eKoRk-001KMa-MY; Fri, 01 Dec 2017 10:45:52 -0600 From: Tom Tromey To: Pedro Alves Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [RFA] Fix regression in "commands" References: <20171103190747.389-1-tom@tromey.com> <3a860acf-6e64-b2ba-e3fd-560406077259@redhat.com> Date: Fri, 01 Dec 2017 16:45:00 -0000 In-Reply-To: <3a860acf-6e64-b2ba-e3fd-560406077259@redhat.com> (Pedro Alves's message of "Tue, 7 Nov 2017 10:49:15 +0000") Message-ID: <87vahq5rcw.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BWhitelist: no X-Source-L: No X-Exim-ID: 1eKoRk-001KMa-MY X-Source-Sender: 71-218-90-63.hlrn.qwest.net (pokyo) [71.218.90.63]:44850 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-SW-Source: 2017-12/txt/msg00024.txt.bz2 >>>>> "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? 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. Tom