Introduce catchpoint class

This introduces a catchpoint class that is used as the base class for
all catchpoints.  init_catchpoint is rewritten to be a constructor
instead.

This changes the hierarchy a little -- some catchpoints now inherit
from base_breakpoint whereas previously they did not.  This isn't a
problem, as long as re_set is redefined in catchpoint.
This commit is contained in:
Tom Tromey
2022-05-01 16:11:26 -06:00
parent b68f26dea7
commit fed1c982de
8 changed files with 49 additions and 49 deletions

View File

@@ -1012,6 +1012,20 @@ struct tracepoint : public breakpoint
int static_trace_marker_id_idx = 0;
};
/* The base class for catchpoints. */
struct catchpoint : public base_breakpoint
{
/* If TEMP is true, then make the breakpoint temporary. If
COND_STRING is not NULL, then store it in the breakpoint. */
catchpoint (struct gdbarch *gdbarch, bool temp, const char *cond_string);
void re_set () override
{
/* For catchpoints, the default is to do nothing. */
}
};
/* The following stuff is an abstract data type "bpstat" ("breakpoint
status"). This provides the ability to determine whether we have
@@ -1440,14 +1454,6 @@ extern void
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. */
extern void init_catchpoint (struct breakpoint *b,
struct gdbarch *gdbarch, bool temp,
const char *cond_string);
/* Add breakpoint B on the breakpoint list, and notify the user, the
target and breakpoint_created observers of its existence. If
INTERNAL is non-zero, the breakpoint number will be allocated from