aboutsummaryrefslogtreecommitdiff
path: root/gdb/breakpoint.h
diff options
context:
space:
mode:
authorPedro Alves <pedro@palves.net>2022-05-16 17:30:06 +0100
committerPedro Alves <pedro@palves.net>2022-05-20 20:41:02 +0100
commit74421c0bc857fdeadd033b44bb3cd372df8d62b8 (patch)
treee4d8151723478f699eb09e1c4fedce95510b4a9b /gdb/breakpoint.h
parent46f0aab14350e9e380c6bbe7bf0539932241fb5b (diff)
downloadgdb-74421c0bc857fdeadd033b44bb3cd372df8d62b8.zip
gdb-74421c0bc857fdeadd033b44bb3cd372df8d62b8.tar.gz
gdb-74421c0bc857fdeadd033b44bb3cd372df8d62b8.tar.bz2
Rename base_breakpoint -> code_breakpoint
Even after the previous patches reworking the inheritance of several breakpoint types, the present breakpoint hierarchy looks a bit surprising, as we have "breakpoint" as the superclass, and then "base_breakpoint" inherits from "breakpoint". Like so, simplified: breakpoint base_breakpoint ordinary_breakpoint internal_breakpoint momentary_breakpoint ada_catchpoint exception_catchpoint tracepoint watchpoint catchpoint exec_catchpoint ... The surprising part to me is having "base_breakpoint" being a subclass of "breakpoint". I'm just refering to naming here -- I mean, you'd expect that it would be the top level baseclass that would be called "base". Just flipping the names of breakpoint and base_breakpoint around wouldn't be super great for us, IMO, given we think of every type of *point as a breakpoint at the user visible level. E.g., "info breakpoints" shows watchpoints, tracepoints, etc. So it makes to call the top level class breakpoint. Instead, I propose renaming base_breakpoint to code_breakpoint. The previous patches made sure that all code breakpoints inherit from base_breakpoint, so it's fitting. Also, "code breakpoint" contrasts nicely with a watchpoint also being typically known as a "data breakpoint". After this commit, the resulting hierarchy looks like: breakpoint code_breakpoint ordinary_breakpoint internal_breakpoint momentary_breakpoint ada_catchpoint exception_catchpoint tracepoint watchpoint catchpoint exec_catchpoint ... ... which makes a lot more sense to me. I've left this patch as last in the series in case people want to bikeshed on the naming. "code" has a nice property that it's exactly as many letters as "base", so this patch didn't require any reindentation. :-) Change-Id: Id8dc06683a69fad80d88e674f65e826d6a4e3f66
Diffstat (limited to 'gdb/breakpoint.h')
-rw-r--r--gdb/breakpoint.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
index 8735396..566f128 100644
--- a/gdb/breakpoint.h
+++ b/gdb/breakpoint.h
@@ -849,7 +849,7 @@ protected:
/* Abstract base class representing code breakpoints. User "break"
breakpoints, internal and momentary breakpoints, etc. IOW, any
kind of breakpoint whose locations are created from SALs. */
-struct base_breakpoint : public breakpoint
+struct code_breakpoint : public breakpoint
{
using breakpoint::breakpoint;
@@ -857,7 +857,7 @@ struct base_breakpoint : public breakpoint
description of the location, and COND_STRING as condition
expression. If LOCATION is NULL then create an "address
location" from the address in the SAL. */
- base_breakpoint (struct gdbarch *gdbarch, bptype type,
+ code_breakpoint (struct gdbarch *gdbarch, bptype type,
gdb::array_view<const symtab_and_line> sals,
event_location_up &&location,
gdb::unique_xmalloc_ptr<char> filter,
@@ -869,7 +869,7 @@ struct base_breakpoint : public breakpoint
int enabled, unsigned flags,
int display_canonical);
- ~base_breakpoint () override = 0;
+ ~code_breakpoint () override = 0;
/* Add a location for SAL to this breakpoint. */
bp_location *add_location (const symtab_and_line &sal);
@@ -985,9 +985,9 @@ extern bool is_exception_catchpoint (breakpoint *bp);
/* An instance of this type is used to represent all kinds of
tracepoints. */
-struct tracepoint : public base_breakpoint
+struct tracepoint : public code_breakpoint
{
- using base_breakpoint::base_breakpoint;
+ using code_breakpoint::code_breakpoint;
int breakpoint_hit (const struct bp_location *bl,
const address_space *aspace, CORE_ADDR bp_addr,
@@ -1384,7 +1384,7 @@ extern void until_break_command (const char *, int, int);
/* Initialize a struct bp_location. */
extern void update_breakpoint_locations
- (base_breakpoint *b,
+ (code_breakpoint *b,
struct program_space *filter_pspace,
gdb::array_view<const symtab_and_line> sals,
gdb::array_view<const symtab_and_line> sals_end);
@@ -1434,7 +1434,7 @@ extern void awatch_command_wrapper (const char *, int, bool);
extern void rwatch_command_wrapper (const char *, int, bool);
extern void tbreak_command (const char *, int);
-extern const struct breakpoint_ops base_breakpoint_ops;
+extern const struct breakpoint_ops code_breakpoint_ops;
/* Arguments to pass as context to some catch command handlers. */
#define CATCH_PERMANENT ((void *) (uintptr_t) 0)
@@ -1463,7 +1463,7 @@ extern void install_breakpoint (int internal, std::unique_ptr<breakpoint> &&b,
/* Returns the breakpoint ops appropriate for use with with LOCATION and
according to IS_TRACEPOINT. Use this to ensure, for example, that you pass
the correct ops to create_breakpoint for probe locations. If LOCATION is
- NULL, returns base_breakpoint_ops. */
+ NULL, returns code_breakpoint_ops. */
extern const struct breakpoint_ops *breakpoint_ops_for_event_location
(const struct event_location *location, bool is_tracepoint);