aboutsummaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r--gdb/breakpoint.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 923523e..c0ab1d7 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -644,6 +644,23 @@ static struct cmd_list_element *breakpoint_set_cmdlist;
static struct cmd_list_element *breakpoint_show_cmdlist;
struct cmd_list_element *save_cmdlist;
+/* See declaration at breakpoint.h. */
+
+struct breakpoint *
+breakpoint_find_if (int (*func) (struct breakpoint *b, void *d),
+ void *user_data)
+{
+ struct breakpoint *b = NULL;
+
+ ALL_BREAKPOINTS (b)
+ {
+ if (func (b, user_data) != 0)
+ break;
+ }
+
+ return b;
+}
+
/* Return whether a breakpoint is an active enabled breakpoint. */
static int
breakpoint_enabled (struct breakpoint *b)