From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6039 invoked by alias); 25 Oct 2011 20:37:10 -0000 Received: (qmail 5965 invoked by uid 22791); 25 Oct 2011 20:37:10 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 25 Oct 2011 20:36:54 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=EU1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1RInjx-0007du-71 from pedro_alves@mentor.com ; Tue, 25 Oct 2011 13:36:53 -0700 Received: from scottsdale.localnet ([172.16.63.104]) by EU1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 25 Oct 2011 21:36:49 +0100 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: Status of 'blacklist' patch? Date: Tue, 25 Oct 2011 20:41:00 -0000 User-Agent: KMail/1.13.6 (Linux/2.6.38-11-generic; KDE/4.7.1; x86_64; ; ) Cc: Justin Lebar , Tom Tromey , Doug Evans , Stan Shebs References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201110252136.45043.pedro@codesourcery.com> X-IsSubscribed: yes 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: 2011-10/txt/msg00684.txt.bz2 On Tuesday 25 October 2011 20:51:31, Justin Lebar wrote: > > Justin> + if (arg != 0) > > Justin> + { > > Justin> + entry_num = parse_and_eval_long (arg); > > Justin> + } > > > > This will parse and evaluate an expression. I think something like what > > "info break" does would be more in keeping with other places in gdb -- > > that is, use get_number_or_range, then iterate. > > breakpoint_1 calls parse_and_eval_long: > > if (allflag && parse_and_eval_long (args) != b->number) > continue; > if (!allflag && !number_is_in_list (args, b->number)) > continue; > > Do we want to copy the breakpoint code here, or not? Yes. :-) ALLFLAG being true means breakpoint_1 is being called to implement the "maint info breakpoints" command, which needs to handle negative breakpoint numbers, which are not visible to the regular "info breakpoints" command. That uses parse_and_eval_long because ranges can't handle negative numbers. When ALLFLAG is false, that code is implementing the "info breakpoints" command, and that you'll notice the number_is_in_list call, which is a wrapper around get_number_or_range. If you make your code use number_is_in_list, you'll get e.g., "info skip 1-10 12 30" support for free. -- Pedro Alves