From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id C1E373858036; Fri, 29 Apr 2022 22:24:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C1E373858036 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Remove vtable_breakpoint_ops X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: c47614fef9fa278399e0d2818d42b73f0e0a26ec X-Git-Newrev: a0cd5f080b0e2a51bc3122456d2101dafae04dca Message-Id: <20220429222431.C1E373858036@sourceware.org> Date: Fri, 29 Apr 2022 22:24:31 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2022 22:24:31 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Da0cd5f080b0e= 2a51bc3122456d2101dafae04dca commit a0cd5f080b0e2a51bc3122456d2101dafae04dca Author: Tom Tromey Date: Sun Jan 16 19:16:01 2022 -0700 Remove vtable_breakpoint_ops =20 There's no need to have vtable_breakpoint_ops any more, so remove it in favor of base_breakpoint_ops. Diff: --- gdb/breakpoint.c | 91 +++++++++++++-----------------------= ---- gdb/breakpoint.h | 4 +- gdb/mi/mi-cmd-break.c | 4 +- gdb/python/py-finishbreakpoint.c | 2 +- 4 files changed, 34 insertions(+), 67 deletions(-) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 6446aac8ace..0e59a1ab3aa 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -3346,7 +3346,7 @@ create_overlay_event_breakpoint (void) addr =3D bp_objfile_data->overlay_msym.value_address (); b =3D create_internal_breakpoint (objfile->arch (), addr, bp_overlay_event, - &vtable_breakpoint_ops); + &base_breakpoint_ops); initialize_explicit_location (&explicit_loc); explicit_loc.function_name =3D ASTRDUP (func_name); b->location =3D new_explicit_location (&explicit_loc); @@ -3406,7 +3406,7 @@ create_longjmp_master_breakpoint_probe (objfile *objf= ile) b =3D create_internal_breakpoint (gdbarch, p->get_relocated_address (objfile), bp_longjmp_master, - &vtable_breakpoint_ops); + &base_breakpoint_ops); b->location =3D new_probe_location ("-probe-stap libc:longjmp"); b->enable_state =3D bp_disabled; } @@ -3455,7 +3455,7 @@ create_longjmp_master_breakpoint_names (objfile *objf= ile) =20 addr =3D bp_objfile_data->longjmp_msym[i].value_address (); b =3D create_internal_breakpoint (gdbarch, addr, bp_longjmp_master, - &vtable_breakpoint_ops); + &base_breakpoint_ops); initialize_explicit_location (&explicit_loc); explicit_loc.function_name =3D ASTRDUP (func_name); b->location =3D new_explicit_location (&explicit_loc); @@ -3539,7 +3539,7 @@ create_std_terminate_master_breakpoint (void) addr =3D bp_objfile_data->terminate_msym.value_address (); b =3D create_internal_breakpoint (objfile->arch (), addr, bp_std_terminate_master, - &vtable_breakpoint_ops); + &base_breakpoint_ops); initialize_explicit_location (&explicit_loc); explicit_loc.function_name =3D ASTRDUP (func_name); b->location =3D new_explicit_location (&explicit_loc); @@ -3592,7 +3592,7 @@ create_exception_master_breakpoint_probe (objfile *ob= jfile) b =3D create_internal_breakpoint (gdbarch, p->get_relocated_address (objfile), bp_exception_master, - &vtable_breakpoint_ops); + &base_breakpoint_ops); b->location =3D new_probe_location ("-probe-stap libgcc:unwind"); b->enable_state =3D bp_disabled; } @@ -3638,7 +3638,7 @@ create_exception_master_breakpoint_hook (objfile *obj= file) addr =3D gdbarch_convert_from_func_ptr_addr (gdbarch, addr, current_inferior ()->top_target ()); b =3D create_internal_breakpoint (gdbarch, addr, bp_exception_master, - &vtable_breakpoint_ops); + &base_breakpoint_ops); initialize_explicit_location (&explicit_loc); explicit_loc.function_name =3D ASTRDUP (func_name); b->location =3D new_explicit_location (&explicit_loc); @@ -7376,7 +7376,7 @@ set_longjmp_breakpoint (struct thread_info *tp, struc= t frame_id frame) /* longjmp_breakpoint_ops ensures INITIATING_FRAME is cleared again after their removal. */ clone =3D momentary_breakpoint_from_master (b, type, - &vtable_breakpoint_ops, 1); + &base_breakpoint_ops, 1); clone->thread =3D thread; } =20 @@ -7422,7 +7422,7 @@ set_longjmp_breakpoint_for_call_dummy (void) struct breakpoint *new_b; =20 new_b =3D momentary_breakpoint_from_master (b, bp_longjmp_call_dummy, - &vtable_breakpoint_ops, + &base_breakpoint_ops, 1); new_b->thread =3D inferior_thread ()->global_num; =20 @@ -7554,7 +7554,7 @@ set_std_terminate_breakpoint (void) && b->type =3D=3D bp_std_terminate_master) { momentary_breakpoint_from_master (b, bp_std_terminate, - &vtable_breakpoint_ops, 1); + &base_breakpoint_ops, 1); } } =20 @@ -7573,7 +7573,7 @@ create_thread_event_breakpoint (struct gdbarch *gdbar= ch, CORE_ADDR address) struct breakpoint *b; =20 b =3D create_internal_breakpoint (gdbarch, address, bp_thread_event, - &vtable_breakpoint_ops); + &base_breakpoint_ops); =20 b->enable_state =3D bp_enabled; /* location has to be used or breakpoint_re_set will delete me. */ @@ -7596,7 +7596,7 @@ struct breakpoint * create_jit_event_breakpoint (struct gdbarch *gdbarch, CORE_ADDR address) { return create_internal_breakpoint (gdbarch, address, bp_jit_event, - &vtable_breakpoint_ops); + &base_breakpoint_ops); } =20 /* Remove JIT code registration and unregistration breakpoint(s). */ @@ -7641,7 +7641,7 @@ create_solib_event_breakpoint_1 (struct gdbarch *gdba= rch, CORE_ADDR address, struct breakpoint *b; =20 b =3D create_internal_breakpoint (gdbarch, address, bp_shlib_event, - &vtable_breakpoint_ops); + &base_breakpoint_ops); update_global_location_list_nothrow (insert_mode); return b; } @@ -7826,7 +7826,7 @@ init_catchpoint (struct breakpoint *b, sal.pspace =3D current_program_space; =20 init_raw_breakpoint (b, gdbarch, sal, bp_catchpoint, - &vtable_breakpoint_ops); + &base_breakpoint_ops); =20 if (cond_string =3D=3D nullptr) b->cond_string.reset (); @@ -7961,7 +7961,7 @@ new_single_step_breakpoint (int thread, struct gdbarc= h *gdbarch) std::unique_ptr b (new momentary_breakpoint ()); =20 init_raw_breakpoint_without_location (b.get (), gdbarch, bp_single_step, - &vtable_breakpoint_ops); + &base_breakpoint_ops); =20 b->disposition =3D disp_donttouch; b->frame_id =3D null_frame_id; @@ -7986,7 +7986,7 @@ set_momentary_breakpoint (struct gdbarch *gdbarch, st= ruct symtab_and_line sal, tail-called one. */ gdb_assert (!frame_id_artificial_p (frame_id)); =20 - b =3D set_raw_breakpoint (gdbarch, sal, type, &vtable_breakpoint_ops); + b =3D set_raw_breakpoint (gdbarch, sal, type, &base_breakpoint_ops); b->enable_state =3D bp_enabled; b->disposition =3D disp_donttouch; b->frame_id =3D frame_id; @@ -8045,7 +8045,7 @@ clone_momentary_breakpoint (struct breakpoint *orig) if (orig =3D=3D NULL) return NULL; =20 - gdb_assert (orig->ops =3D=3D &vtable_breakpoint_ops); + gdb_assert (orig->ops =3D=3D &base_breakpoint_ops); return momentary_breakpoint_from_master (orig, orig->type, orig->ops, 0); } =20 @@ -8828,14 +8828,14 @@ breakpoint_ops_for_event_location_type (enum event_= location_type location_type, if (location_type =3D=3D PROBE_LOCATION) return &tracepoint_probe_breakpoint_ops; else - return &vtable_breakpoint_ops; + return &base_breakpoint_ops; } else { if (location_type =3D=3D PROBE_LOCATION) return &bkpt_probe_breakpoint_ops; else - return &vtable_breakpoint_ops; + return &base_breakpoint_ops; } } =20 @@ -8848,7 +8848,7 @@ breakpoint_ops_for_event_location (const struct event= _location *location, if (location !=3D nullptr) return breakpoint_ops_for_event_location_type (event_location_type (location), is_tracepoint); - return &vtable_breakpoint_ops; + return &base_breakpoint_ops; } =20 /* See breakpoint.h. */ @@ -9184,7 +9184,7 @@ dprintf_command (const char *arg, int from_tty) 0, bp_dprintf, 0 /* Ignore count */, pending_break_support, - &vtable_breakpoint_ops, + &base_breakpoint_ops, from_tty, 1 /* enabled */, 0 /* internal */, @@ -9452,7 +9452,7 @@ break_range_command (const char *arg, int from_tty) std::unique_ptr br (new ranged_breakpoint ()); init_raw_breakpoint (br.get (), get_current_arch (), sal_start, bp_hardware_breakpoint, - &vtable_breakpoint_ops); + &base_breakpoint_ops); b =3D add_to_breakpoint_chain (std::move (br)); =20 set_breakpoint_count (breakpoint_count + 1); @@ -10146,7 +10146,7 @@ watch_command_1 (const char *arg, int accessflag, i= nt from_tty, scope_breakpoint =3D create_internal_breakpoint (caller_arch, caller_pc, bp_watchpoint_scope, - &vtable_breakpoint_ops); + &base_breakpoint_ops); =20 /* create_internal_breakpoint could invalidate WP_FRAME. */ wp_frame =3D NULL; @@ -10187,7 +10187,7 @@ watch_command_1 (const char *arg, int accessflag, i= nt from_tty, else w.reset (new watchpoint ()); init_raw_breakpoint_without_location (w.get (), nullptr, bp_type, - &vtable_breakpoint_ops); + &base_breakpoint_ops); =20 w->thread =3D thread; w->task =3D task; @@ -10641,7 +10641,7 @@ init_ada_exception_breakpoint (struct breakpoint *b, } =20 init_raw_breakpoint (b, gdbarch, sal, bp_catchpoint, - &vtable_breakpoint_ops); + &base_breakpoint_ops); =20 b->enable_state =3D enabled ? bp_enabled : bp_disabled; b->disposition =3D tempflag ? disp_del : disp_donttouch; @@ -11601,31 +11601,6 @@ breakpoint::print_recreate (struct ui_file *fp) internal_error_pure_virtual_called (); } =20 -static void -base_breakpoint_create_sals_from_location - (struct event_location *location, - struct linespec_result *canonical, - enum bptype type_wanted) -{ - internal_error_pure_virtual_called (); -} - -static void -base_breakpoint_create_breakpoints_sal (struct gdbarch *gdbarch, - struct linespec_result *c, - gdb::unique_xmalloc_ptr cond_string, - gdb::unique_xmalloc_ptr extra_string, - enum bptype type_wanted, - enum bpdisp disposition, - int thread, - int task, int ignore_count, - const struct breakpoint_ops *o, - int from_tty, int enabled, - int internal, unsigned flags) -{ - internal_error_pure_virtual_called (); -} - std::vector breakpoint::decode_location (struct event_location *location, struct program_space *search_pspace) @@ -11634,12 +11609,6 @@ breakpoint::decode_location (struct event_location= *location, } =20 struct breakpoint_ops base_breakpoint_ops =3D -{ - base_breakpoint_create_sals_from_location, - base_breakpoint_create_breakpoints_sal, -}; - -struct breakpoint_ops vtable_breakpoint_ops =3D { create_sals_from_location_default, create_breakpoints_sal_default, @@ -13733,7 +13702,7 @@ ftrace_command (const char *arg, int from_tty) bp_fast_tracepoint /* type_wanted */, 0 /* Ignore count */, pending_break_support, - &vtable_breakpoint_ops, + &base_breakpoint_ops, from_tty, 1 /* enabled */, 0 /* internal */, 0); @@ -13758,7 +13727,7 @@ strace_command (const char *arg, int from_tty) } else { - ops =3D &vtable_breakpoint_ops; + ops =3D &base_breakpoint_ops; location =3D string_to_event_location (&arg, current_language); type =3D bp_static_tracepoint; } @@ -13841,7 +13810,7 @@ create_tracepoint_from_upload (struct uploaded_tp *= utp) utp->type /* type_wanted */, 0 /* Ignore count */, pending_break_support, - &vtable_breakpoint_ops, + &base_breakpoint_ops, 0 /* from_tty */, utp->enabled /* enabled */, 0 /* internal */, @@ -14388,17 +14357,17 @@ initialize_breakpoint_ops (void) =20 /* Probe breakpoints. */ ops =3D &bkpt_probe_breakpoint_ops; - *ops =3D vtable_breakpoint_ops; + *ops =3D base_breakpoint_ops; ops->create_sals_from_location =3D bkpt_probe_create_sals_from_location; =20 /* Probe tracepoints. */ ops =3D &tracepoint_probe_breakpoint_ops; - *ops =3D vtable_breakpoint_ops; + *ops =3D base_breakpoint_ops; ops->create_sals_from_location =3D tracepoint_probe_create_sals_from_loc= ation; =20 /* Static tracepoints with marker (`-m'). */ ops =3D &strace_marker_breakpoint_ops; - *ops =3D vtable_breakpoint_ops; + *ops =3D base_breakpoint_ops; ops->create_sals_from_location =3D strace_marker_create_sals_from_locati= on; ops->create_breakpoints_sal =3D strace_marker_create_breakpoints_sal; } diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index 93c2a64387d..64f06a98b37 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -1399,7 +1399,6 @@ extern void rwatch_command_wrapper (const char *, int= , bool); extern void tbreak_command (const char *, int); =20 extern struct breakpoint_ops base_breakpoint_ops; -extern struct breakpoint_ops vtable_breakpoint_ops; =20 extern void initialize_breakpoint_ops (void); =20 @@ -1449,8 +1448,7 @@ extern void install_breakpoint (int internal, std::un= ique_ptr &&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 bkpt_breakpoint_ops (or vtable_breakpoint_ops, if - IS_TRACEPOINT is true). */ + NULL, returns base_breakpoint_ops. */ =20 extern const struct breakpoint_ops *breakpoint_ops_for_event_location (const struct event_location *location, bool is_tracepoint); diff --git a/gdb/mi/mi-cmd-break.c b/gdb/mi/mi-cmd-break.c index fb034317a6e..1d9fc0de436 100644 --- a/gdb/mi/mi-cmd-break.c +++ b/gdb/mi/mi-cmd-break.c @@ -327,12 +327,12 @@ mi_cmd_break_insert_1 (int dprintf, const char *comma= nd, char **argv, int argc) else if (dprintf) { type_wanted =3D bp_dprintf; - ops =3D &vtable_breakpoint_ops; + ops =3D &base_breakpoint_ops; } else { type_wanted =3D hardware ? bp_hardware_breakpoint : bp_breakpoint; - ops =3D &vtable_breakpoint_ops; + ops =3D &base_breakpoint_ops; } =20 if (is_explicit) diff --git a/gdb/python/py-finishbreakpoint.c b/gdb/python/py-finishbreakpo= int.c index 015eb3c08f7..abd5b48a949 100644 --- a/gdb/python/py-finishbreakpoint.c +++ b/gdb/python/py-finishbreakpoint.c @@ -305,7 +305,7 @@ bpfinishpy_init (PyObject *self, PyObject *args, PyObje= ct *kwargs) bp_breakpoint, 0, AUTO_BOOLEAN_TRUE, - &vtable_breakpoint_ops, + &base_breakpoint_ops, 0, 1, internal_bp, 0); } catch (const gdb_exception &except)