This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: small patch to 19991101 snapshot
Jimmy Guo wrote:
>
> >What compiler are you using?
> >What is the error?
>
> HP C compiler. The error is exactly what you said below.
OK, Jimmy, want to be a code reviewer?
How about the following, using a match flag
instead of a goto?
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;
}
}