This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: small patch to 19991101 snapshot
- To: Michael Snyder <msnyder at cygnus dot com>
- Subject: Re: small patch to 19991101 snapshot
- From: Jimmy Guo <guo at cup dot hp dot com>
- Date: Tue, 2 Nov 1999 15:39:51 -0800 (PST)
- cc: Tom Tromey <tromey at cygnus dot com>, gdb-patches at sourceware dot cygnus dot com
>OK, Jimmy, want to be a code reviewer?
>How about the following, using a match flag
>instead of a goto?
This looks much more appealing and clean to me :). I vote for this
change.
- Jimmy Guo, guo@cup.hp.com
>static void
>map_breakpoint_numbers (args, function)
> char *args;
> void (*function) PARAMS ((struct breakpoint *));
>{
> register char *p = args;
> char *p1;
> register int num;
> register struct breakpoint *b, *tmp;
> int match;
>
> if (p == 0)
> error_no_arg ("one or more breakpoint numbers");
>
> while (*p)
> {
> match = 0;
> p1 = p;
>
> num = get_number_or_range (&p1);
> if (num == 0)
> {
> warning ("bad breakpoint number at or near '%s'", p);
> }
> else
> {
> ALL_BREAKPOINTS_SAFE (b, tmp)
> if (b->number == num)
> {
> struct breakpoint *related_breakpoint =
>b->related_breakpoint;
> match = 1;
> function (b);
> if (related_breakpoint)
> function (related_breakpoint);
> break;
> }
> if (match == 0)
> printf_unfiltered ("No breakpoint number %d.\n", num);
> }
> p = p1;
> }
>}