This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Status of 'blacklist' patch?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]