+2001-05-11 Keith Seitz <keiths@cygnus.com>
+
+ * generic/gdbtk-bp.c (gdbtk_create_breakpoint): Safe guard
+ against "invalid" (internal) breakpoint numbers.
+ (gdbtk_modify_breakpoint): Ditto.
+ (gdbtk_delete_breakpoint): Ditto.
+
2001-05-10 Keith Seitz <keiths@cygnus.com>
* generic/gdbtk-bp.c (gdb_set_bp): Generate a breakpoint event
char *bpdisp[] =
{"delete", "delstop", "disable", "donttouch"};
+/* Is this breakpoint interesting to a user interface? */
+#define BREAKPOINT_IS_INTERESTING(bp) \
+((bp)->type == bp_breakpoint \
+ || (bp)->type == bp_hardware_breakpoint \
+ || (bp)->type == bp_watchpoint \
+ || (bp)->type == bp_hardware_watchpoint \
+ || (bp)->type == bp_read_watchpoint \
+ || (bp)->type == bp_access_watchpoint)
+
/*
* These are routines we need from breakpoint.c.
* at some point make these static in breakpoint.c and move GUI code there
break;
}
- if (b == NULL)
+ if (b == NULL || !BREAKPOINT_IS_INTERESTING (b))
return;
/* Check if there is room to store it */
void
gdbtk_delete_breakpoint (int num)
{
- if (breakpoint_list[num] != NULL)
+ if (num >= 0
+ && num <= breakpoint_list_size
+ && breakpoint_list[num] != NULL)
{
breakpoint_notify (num, "delete");
breakpoint_list[num] = NULL;
void
gdbtk_modify_breakpoint (int num)
{
- breakpoint_notify (num, "modify");
+ if (num >= 0)
+ breakpoint_notify (num, "modify");
}
/* This is the generic function for handling changes in
char *buf;
if (num > breakpoint_list_size
+ || num < 0
|| breakpoint_list[num] == NULL
+ /* FIXME: should not be so restrictive... */
|| breakpoint_list[num]->type != bp_breakpoint)
return;