static void map_breakpoint_numbers (const char *,
gdb::function_view<void (breakpoint *)>);
-static void breakpoint_re_set_default (struct breakpoint *);
+static void breakpoint_re_set_default (base_breakpoint *);
static void
create_sals_from_location_default (struct event_location *location,
handle_jit_event (bs->bp_location_at->address);
break;
case bp_gnu_ifunc_resolver:
- gnu_ifunc_resolver_stop (b);
+ gnu_ifunc_resolver_stop ((base_breakpoint *) b);
break;
case bp_gnu_ifunc_resolver_return:
- gnu_ifunc_resolver_return_stop (b);
+ gnu_ifunc_resolver_return_stop ((base_breakpoint *) b);
break;
}
}
breakpoint_re_set ();
}
-/* Create a new single-step breakpoint for thread THREAD, with no
- locations. */
-
-static struct breakpoint *
-new_single_step_breakpoint (int thread, struct gdbarch *gdbarch)
-{
- std::unique_ptr<breakpoint> b (new momentary_breakpoint (gdbarch,
- bp_single_step));
-
- b->disposition = disp_donttouch;
- b->frame_id = null_frame_id;
-
- b->thread = thread;
- gdb_assert (b->thread != 0);
-
- return add_to_breakpoint_chain (std::move (b));
-}
-
/* Allocate a new momentary breakpoint. */
static momentary_breakpoint *
}
bp_location *
-breakpoint::add_location (const symtab_and_line &sal)
+base_breakpoint::add_location (const symtab_and_line &sal)
{
struct bp_location *new_loc, **tmp;
CORE_ADDR adjusted_address;
untouched. */
void
-update_breakpoint_locations (struct breakpoint *b,
+update_breakpoint_locations (base_breakpoint *b,
struct program_space *filter_pspace,
gdb::array_view<const symtab_and_line> sals,
gdb::array_view<const symtab_and_line> sals_end)
locations. */
static void
-breakpoint_re_set_default (struct breakpoint *b)
+breakpoint_re_set_default (base_breakpoint *b)
{
struct program_space *filter_pspace = current_program_space;
std::vector<symtab_and_line> expanded, expanded_end;
if (tp->control.single_step_breakpoints == NULL)
{
+ std::unique_ptr<breakpoint> b
+ (new momentary_breakpoint (gdbarch, bp_single_step));
+
+ b->disposition = disp_donttouch;
+
+ b->thread = tp->global_num;
+ gdb_assert (b->thread != 0);
+
tp->control.single_step_breakpoints
- = new_single_step_breakpoint (tp->global_num, gdbarch);
+ = add_to_breakpoint_chain (std::move (b));
}
sal = find_pc_line (pc, 0);
sal.pc = pc;
sal.section = find_pc_overlay (pc);
sal.explicit_pc = 1;
- tp->control.single_step_breakpoints->add_location (sal);
+
+ auto *ss_bp
+ = static_cast<momentary_breakpoint *> (tp->control.single_step_breakpoints);
+ ss_bp->add_location (sal);
update_global_location_list (UGLL_INSERT);
}
/* Nothing to do. */
}
- /* Add a location for SAL to this breakpoint. */
- bp_location *add_location (const symtab_and_line &sal);
-
/* Return a range of this breakpoint's locations. */
bp_location_range locations () const;
~base_breakpoint () override = 0;
+ /* Add a location for SAL to this breakpoint. */
+ bp_location *add_location (const symtab_and_line &sal);
+
void re_set () override;
int insert_location (struct bp_location *) override;
int remove_location (struct bp_location *,
/* Initialize a struct bp_location. */
extern void update_breakpoint_locations
- (struct breakpoint *b,
+ (base_breakpoint *b,
struct program_space *filter_pspace,
gdb::array_view<const symtab_and_line> sals,
gdb::array_view<const symtab_and_line> sals_end);
/* Handle inferior hit of bp_gnu_ifunc_resolver, see its definition. */
static void
-elf_gnu_ifunc_resolver_stop (struct breakpoint *b)
+elf_gnu_ifunc_resolver_stop (base_breakpoint *b)
{
struct breakpoint *b_return;
struct frame_info *prev_frame = get_prev_frame (get_current_frame ());
/* Handle inferior hit of bp_gnu_ifunc_resolver_return, see its definition. */
static void
-elf_gnu_ifunc_resolver_return_stop (struct breakpoint *b)
+elf_gnu_ifunc_resolver_return_stop (base_breakpoint *b)
{
thread_info *thread = inferior_thread ();
struct gdbarch *gdbarch = get_frame_arch (get_current_frame ());
"gnu-indirect-function breakpoint type %d"),
(int) b->type);
}
- b = b_next;
+ b = (base_breakpoint *) b_next;
}
gdb_assert (b->type == bp_gnu_ifunc_resolver);
gdb_assert (b->loc->next == NULL);
/* See elf_gnu_ifunc_resolver_stop for its real implementation. */
static void
-stub_gnu_ifunc_resolver_stop (struct breakpoint *b)
+stub_gnu_ifunc_resolver_stop (base_breakpoint *b)
{
internal_error (__FILE__, __LINE__,
_("elf_gnu_ifunc_resolver_stop cannot be reached."));
/* See elf_gnu_ifunc_resolver_return_stop for its real implementation. */
static void
-stub_gnu_ifunc_resolver_return_stop (struct breakpoint *b)
+stub_gnu_ifunc_resolver_return_stop (base_breakpoint *b)
{
internal_error (__FILE__, __LINE__,
_("elf_gnu_ifunc_resolver_return_stop cannot be reached."));
struct cmd_list_element;
class probe;
struct lookup_name_info;
+struct base_breakpoint;
/* How to match a lookup name against a symbol search name. */
enum class symbol_name_match_type
CORE_ADDR *function_address_p);
/* See elf_gnu_ifunc_resolver_stop for its real implementation. */
- void (*gnu_ifunc_resolver_stop) (struct breakpoint *b);
+ void (*gnu_ifunc_resolver_stop) (base_breakpoint *b);
/* See elf_gnu_ifunc_resolver_return_stop for its real implementation. */
- void (*gnu_ifunc_resolver_return_stop) (struct breakpoint *b);
+ void (*gnu_ifunc_resolver_return_stop) (base_breakpoint *b);
};
#define gnu_ifunc_resolve_addr gnu_ifunc_fns_p->gnu_ifunc_resolve_addr