From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30441 invoked by alias); 25 Oct 2011 21:09:59 -0000 Received: (qmail 30429 invoked by uid 22791); 25 Oct 2011 21:09:58 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-fx0-f41.google.com (HELO mail-fx0-f41.google.com) (209.85.161.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 25 Oct 2011 21:09:42 +0000 Received: by faat2 with SMTP id t2so1262217faa.0 for ; Tue, 25 Oct 2011 14:09:41 -0700 (PDT) Received: by 10.223.7.14 with SMTP id b14mr55459634fab.10.1319576981295; Tue, 25 Oct 2011 14:09:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.152.22.6 with HTTP; Tue, 25 Oct 2011 14:09:17 -0700 (PDT) In-Reply-To: <201110252136.45043.pedro@codesourcery.com> References: <201110252136.45043.pedro@codesourcery.com> From: Justin Lebar Date: Tue, 25 Oct 2011 21:25:00 -0000 Message-ID: Subject: Re: Status of 'blacklist' patch? To: Pedro Alves Cc: gdb-patches@sourceware.org, Tom Tromey , Doug Evans , Stan Shebs Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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/msg00687.txt.bz2 Ah, I missed that "!". Thanks! On Tue, Oct 25, 2011 at 4:36 PM, Pedro Alves wrote: > On Tuesday 25 October 2011 20:51:31, Justin Lebar wrote: >> > Justin> + =C2=A0if (arg !=3D 0) >> > Justin> + =C2=A0 =C2=A0{ >> > Justin> + =C2=A0 =C2=A0 =C2=A0entry_num =3D parse_and_eval_long (arg); >> > Justin> + =C2=A0 =C2=A0} >> > >> > This will parse and evaluate an expression. =C2=A0I think something li= ke 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: >> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (allflag && parse_and_eval_long (a= rgs) !=3D b->number) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 continue; >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (!allflag && !number_is_in_list (a= rgs, b->number)) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 continue; >> >> Do we want to copy the breakpoint code here, or not? > > Yes. :-) =C2=A0ALLFLAG 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. =C2=A0That uses parse_and_eval_long > because ranges can't handle negative numbers. =C2=A0When 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. =C2=A0If 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 >