b->condition_not_parsed = 0;
b->py_bp_object = NULL;
b->related_breakpoint = b;
-
- add_to_breakpoint_chain (b);
}
/* Helper to set_raw_breakpoint below. Creates a breakpoint
struct breakpoint *b = XNEW (struct breakpoint);
init_raw_breakpoint_without_location (b, gdbarch, bptype);
-
+ add_to_breakpoint_chain (b);
return b;
}
/* Low level routine for partially initializing a breakpoint of type
BPTYPE. The newly created breakpoint's address, section, source
- file name, and line number are provided by SAL. The newly created
- and partially initialized breakpoint is added to the breakpoint
- chain.
+ file name, and line number are provided by SAL.
It is expected that the caller will complete the initialization of
the newly created breakpoint struct as well as output any status
- information regarding the creation of a new breakpoint. In
- particular, init_raw_breakpoint does NOT set the breakpoint number!
- Care should be taken to not allow an error to occur prior to
- completing the initialization of the breakpoint. If this should
- happen, a bogus breakpoint will be left on the chain. */
+ information regarding the creation of a new breakpoint. */
static void
init_raw_breakpoint (struct breakpoint *b, struct gdbarch *gdbarch,
struct breakpoint *b = XNEW (struct breakpoint);
init_raw_breakpoint (b, gdbarch, sal, bptype);
+ add_to_breakpoint_chain (b);
return b;
}
sal.pspace = current_program_space;
init_raw_breakpoint (b, gdbarch, sal, bp_catchpoint);
- set_breakpoint_count (breakpoint_count + 1);
- b->number = breakpoint_count;
b->cond_string = (cond_string == NULL) ? NULL : xstrdup (cond_string);
b->thread = -1;
b->ops = ops;
}
-/* Create a new breakpoint of the bp_catchpoint kind and return it,
- but does NOT mention it nor update the global location list.
- This is useful if you need to fill more fields in the
- struct breakpoint before calling mention.
+/* Add breakpoint B on the breakpoint list, and notify the user, the
+ target and breakpoint_created observers of its existence. */
- If TEMPFLAG is non-zero, then make the breakpoint temporary.
- If COND_STRING is not NULL, then store it in the breakpoint.
- OPS, if not NULL, is the breakpoint_ops structure associated
- to the catchpoint. */
-
-static struct breakpoint *
-create_catchpoint_without_mention (struct gdbarch *gdbarch, int tempflag,
- char *cond_string,
- struct breakpoint_ops *ops)
-{
- struct breakpoint *b = XNEW (struct breakpoint);
-
- init_catchpoint (b, gdbarch, tempflag, cond_string, ops);
- return b;
-}
-
-/* Create a new breakpoint of the bp_catchpoint kind and return it.
-
- If TEMPFLAG is non-zero, then make the breakpoint temporary.
- If COND_STRING is not NULL, then store it in the breakpoint.
- OPS, if not NULL, is the breakpoint_ops structure associated
- to the catchpoint. */
-
-static struct breakpoint *
-create_catchpoint (struct gdbarch *gdbarch, int tempflag,
- char *cond_string, struct breakpoint_ops *ops)
+static void
+install_catchpoint (struct breakpoint *b)
{
- struct breakpoint *b =
- create_catchpoint_without_mention (gdbarch, tempflag, cond_string, ops);
-
+ add_to_breakpoint_chain (b);
+ set_breakpoint_count (breakpoint_count + 1);
+ b->number = breakpoint_count;
mention (b);
observer_notify_breakpoint_created (b);
update_global_location_list (1);
-
- return b;
}
static void
c->forked_inferior_pid = null_ptid;
- mention (&c->base);
- observer_notify_breakpoint_created (&c->base);
- update_global_location_list (1);
+ install_catchpoint (&c->base);
}
/* Exec catchpoints. */
init_catchpoint (&c->base, gdbarch, tempflag, NULL, ops);
c->syscalls_to_be_caught = filter;
- /* Now, we have to mention the breakpoint and update the global
- location list. */
- mention (&c->base);
- observer_notify_breakpoint_created (&c->base);
- update_global_location_list (1);
+ install_catchpoint (&c->base);
}
static int
&catch_exec_breakpoint_ops);
c->exec_pathname = NULL;
- /* Now, we have to mention the breakpoint and update the global
- location list. */
- mention (&c->base);
- observer_notify_breakpoint_created (&c->base);
- update_global_location_list (1);
+ install_catchpoint (&c->base);
}
static enum print_stop_action