~solib_catchpoint () override;
/* True for "catch load", false for "catch unload". */
- unsigned char is_load;
+ bool is_load;
/* Regular expression to match, if any. COMPILED is only valid when
REGEX is non-NULL. */
static struct breakpoint_ops catch_solib_breakpoint_ops;
-/* Shared helper function (MI and CLI) for creating and installing
- a shared object event catchpoint. If IS_LOAD is non-zero then
- the events to be caught are load events, otherwise they are
- unload events. If IS_TEMP is non-zero the catchpoint is a
- temporary one. If ENABLED is non-zero the catchpoint is
- created in an enabled state. */
+/* See breakpoint.h. */
void
-add_solib_catchpoint (const char *arg, int is_load, int is_temp, int enabled)
+add_solib_catchpoint (const char *arg, bool is_load, bool is_temp, bool enabled)
{
struct gdbarch *gdbarch = get_current_arch ();
catch_load_or_unload (const char *arg, int from_tty, int is_load,
struct cmd_list_element *command)
{
- int tempflag;
const int enabled = 1;
+ bool temp = get_cmd_context (command) == CATCH_TEMPORARY;
- tempflag = get_cmd_context (command) == CATCH_TEMPORARY;
-
- add_solib_catchpoint (arg, is_load, tempflag, enabled);
+ add_solib_catchpoint (arg, is_load, temp, enabled);
}
static void
catch_load_or_unload (arg, from_tty, 0, command);
}
-/* Initialize a new breakpoint of the bp_catchpoint kind. 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. */
+/* See breakpoint.h. */
void
init_catchpoint (struct breakpoint *b,
- struct gdbarch *gdbarch, int tempflag,
+ struct gdbarch *gdbarch, bool temp,
const char *cond_string,
const struct breakpoint_ops *ops)
{
init_raw_breakpoint (b, gdbarch, sal, bp_catchpoint, ops);
b->cond_string = (cond_string == NULL) ? NULL : xstrdup (cond_string);
- b->disposition = tempflag ? disp_del : disp_donttouch;
+ b->disposition = temp ? disp_del : disp_donttouch;
}
void
static void
create_fork_vfork_event_catchpoint (struct gdbarch *gdbarch,
- int tempflag, const char *cond_string,
+ bool temp, const char *cond_string,
const struct breakpoint_ops *ops)
{
std::unique_ptr<fork_catchpoint> c (new fork_catchpoint ());
- init_catchpoint (c.get (), gdbarch, tempflag, cond_string, ops);
+ init_catchpoint (c.get (), gdbarch, temp, cond_string, ops);
c->forked_inferior_pid = null_ptid;
struct gdbarch *gdbarch = get_current_arch ();
const char *cond_string = NULL;
catch_fork_kind fork_kind;
- int tempflag;
fork_kind = (catch_fork_kind) (uintptr_t) get_cmd_context (command);
- tempflag = (fork_kind == catch_fork_temporary
- || fork_kind == catch_vfork_temporary);
+ bool temp = (fork_kind == catch_fork_temporary
+ || fork_kind == catch_vfork_temporary);
if (!arg)
arg = "";
{
case catch_fork_temporary:
case catch_fork_permanent:
- create_fork_vfork_event_catchpoint (gdbarch, tempflag, cond_string,
+ create_fork_vfork_event_catchpoint (gdbarch, temp, cond_string,
&catch_fork_breakpoint_ops);
break;
case catch_vfork_temporary:
case catch_vfork_permanent:
- create_fork_vfork_event_catchpoint (gdbarch, tempflag, cond_string,
+ create_fork_vfork_event_catchpoint (gdbarch, temp, cond_string,
&catch_vfork_breakpoint_ops);
break;
default:
struct cmd_list_element *command)
{
struct gdbarch *gdbarch = get_current_arch ();
- int tempflag;
const char *cond_string = NULL;
-
- tempflag = get_cmd_context (command) == CATCH_TEMPORARY;
+ bool temp = get_cmd_context (command) == CATCH_TEMPORARY;
if (!arg)
arg = "";
error (_("Junk at end of arguments."));
std::unique_ptr<exec_catchpoint> c (new exec_catchpoint ());
- init_catchpoint (c.get (), gdbarch, tempflag, cond_string,
+ init_catchpoint (c.get (), gdbarch, temp, cond_string,
&catch_exec_breakpoint_ops);
c->exec_pathname = NULL;
int enabled,
int from_tty);
+/* Initialize a new breakpoint of the bp_catchpoint kind. If TEMP
+ is true, 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. */
+
extern void init_catchpoint (struct breakpoint *b,
- struct gdbarch *gdbarch, int tempflag,
+ struct gdbarch *gdbarch, bool temp,
const char *cond_string,
const struct breakpoint_ops *ops);
extern bool is_catchpoint (struct breakpoint *b);
/* Shared helper function (MI and CLI) for creating and installing
- a shared object event catchpoint. */
-extern void add_solib_catchpoint (const char *arg, int is_load, int is_temp,
- int enabled);
+ a shared object event catchpoint. If IS_LOAD is true then
+ the events to be caught are load events, otherwise they are
+ unload events. If IS_TEMP is true the catchpoint is a
+ temporary one. If ENABLED is true the catchpoint is
+ created in an enabled state. */
+
+extern void add_solib_catchpoint (const char *arg, bool is_load, bool is_temp,
+ bool enabled);
/* Create and insert a new software single step breakpoint for the
current thread. May be called multiple times; each time will add a