(user breakpoints, internal and momentary breakpoints, etc.). */
static struct breakpoint_ops bkpt_base_breakpoint_ops;
-/* Internal breakpoints class type. */
-static struct breakpoint_ops internal_breakpoint_ops;
-
/* Momentary breakpoints class type. */
static struct breakpoint_ops momentary_breakpoint_ops;
/* Internal breakpoints. */
struct internal_breakpoint : public base_breakpoint
{
+ void re_set () override;
+ void check_status (struct bpstat *bs) override;
+ enum print_stop_action print_it (struct bpstat *bs) override;
+ void print_mention () override;
};
/* Momentary breakpoints. */
addr = bp_objfile_data->overlay_msym.value_address ();
b = create_internal_breakpoint (objfile->arch (), addr,
bp_overlay_event,
- &internal_breakpoint_ops);
+ &vtable_breakpoint_ops);
initialize_explicit_location (&explicit_loc);
explicit_loc.function_name = ASTRDUP (func_name);
b->location = new_explicit_location (&explicit_loc);
b = create_internal_breakpoint (gdbarch,
p->get_relocated_address (objfile),
bp_longjmp_master,
- &internal_breakpoint_ops);
+ &vtable_breakpoint_ops);
b->location = new_probe_location ("-probe-stap libc:longjmp");
b->enable_state = bp_disabled;
}
addr = bp_objfile_data->longjmp_msym[i].value_address ();
b = create_internal_breakpoint (gdbarch, addr, bp_longjmp_master,
- &internal_breakpoint_ops);
+ &vtable_breakpoint_ops);
initialize_explicit_location (&explicit_loc);
explicit_loc.function_name = ASTRDUP (func_name);
b->location = new_explicit_location (&explicit_loc);
addr = bp_objfile_data->terminate_msym.value_address ();
b = create_internal_breakpoint (objfile->arch (), addr,
bp_std_terminate_master,
- &internal_breakpoint_ops);
+ &vtable_breakpoint_ops);
initialize_explicit_location (&explicit_loc);
explicit_loc.function_name = ASTRDUP (func_name);
b->location = new_explicit_location (&explicit_loc);
b = create_internal_breakpoint (gdbarch,
p->get_relocated_address (objfile),
bp_exception_master,
- &internal_breakpoint_ops);
+ &vtable_breakpoint_ops);
b->location = new_probe_location ("-probe-stap libgcc:unwind");
b->enable_state = bp_disabled;
}
addr = gdbarch_convert_from_func_ptr_addr
(gdbarch, addr, current_inferior ()->top_target ());
b = create_internal_breakpoint (gdbarch, addr, bp_exception_master,
- &internal_breakpoint_ops);
+ &vtable_breakpoint_ops);
initialize_explicit_location (&explicit_loc);
explicit_loc.function_name = ASTRDUP (func_name);
b->location = new_explicit_location (&explicit_loc);
struct breakpoint *b;
b = create_internal_breakpoint (gdbarch, address, bp_thread_event,
- &internal_breakpoint_ops);
+ &vtable_breakpoint_ops);
b->enable_state = bp_enabled;
/* location has to be used or breakpoint_re_set will delete me. */
create_jit_event_breakpoint (struct gdbarch *gdbarch, CORE_ADDR address)
{
return create_internal_breakpoint (gdbarch, address, bp_jit_event,
- &internal_breakpoint_ops);
+ &vtable_breakpoint_ops);
}
/* Remove JIT code registration and unregistration breakpoint(s). */
struct breakpoint *b;
b = create_internal_breakpoint (gdbarch, address, bp_shlib_event,
- &internal_breakpoint_ops);
+ &vtable_breakpoint_ops);
update_global_location_list_nothrow (insert_mode);
return b;
}
/* Virtual table for internal breakpoints. */
-static void
-internal_bkpt_re_set (struct breakpoint *b)
+void
+internal_breakpoint::re_set ()
{
- switch (b->type)
+ switch (type)
{
/* Delete overlay event and longjmp master breakpoints; they
will be reset later by breakpoint_re_set. */
case bp_longjmp_master:
case bp_std_terminate_master:
case bp_exception_master:
- delete_breakpoint (b);
+ delete_breakpoint (this);
break;
/* This breakpoint is special, it's set up when the inferior
}
}
-static void
-internal_bkpt_check_status (bpstat *bs)
+void
+internal_breakpoint::check_status (bpstat *bs)
{
- if (bs->breakpoint_at->type == bp_shlib_event)
+ if (type == bp_shlib_event)
{
/* If requested, stop when the dynamic linker notifies GDB of
events. This allows the user to get control and place
bs->stop = 0;
}
-static enum print_stop_action
-internal_bkpt_print_it (bpstat *bs)
+enum print_stop_action
+internal_breakpoint::print_it (bpstat *bs)
{
- struct breakpoint *b;
-
- b = bs->breakpoint_at;
-
- switch (b->type)
+ switch (type)
{
case bp_shlib_event:
/* Did we stop because the user set the stop_on_solib_events
return PRINT_NOTHING;
}
-static void
-internal_bkpt_print_mention (struct breakpoint *b)
+void
+internal_breakpoint::print_mention ()
{
/* Nothing to mention. These breakpoints are internal. */
}
ops->print_mention = print_mention_ranged_breakpoint;
ops->print_recreate = print_recreate_ranged_breakpoint;
- /* Internal breakpoints. */
- ops = &internal_breakpoint_ops;
- *ops = bkpt_base_breakpoint_ops;
- ops->re_set = internal_bkpt_re_set;
- ops->check_status = internal_bkpt_check_status;
- ops->print_it = internal_bkpt_print_it;
- ops->print_mention = internal_bkpt_print_mention;
-
/* Momentary breakpoints. */
ops = &momentary_breakpoint_ops;
*ops = bkpt_base_breakpoint_ops;