From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 581B2395201B; Fri, 6 May 2022 18:10:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 581B2395201B 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 breakpoint::ops X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 04d0163c3ff280a2ec7d4e06594da750ef8f96d5 X-Git-Newrev: 9efa3c7fa3654c91d638fc9705ecd61c465c8000 Message-Id: <20220506181006.581B2395201B@sourceware.org> Date: Fri, 6 May 2022 18:10:06 +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, 06 May 2022 18:10:06 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D9efa3c7fa365= 4c91d638fc9705ecd61c465c8000 commit 9efa3c7fa3654c91d638fc9705ecd61c465c8000 Author: Tom Tromey Date: Sat Apr 30 08:02:36 2022 -0600 Remove breakpoint::ops =20 The breakpoint::ops field is set but never used. This removes it. Diff: --- gdb/breakpoint.c | 99 +++++++++++++++++++---------------------------------= ---- gdb/breakpoint.h | 3 -- 2 files changed, 33 insertions(+), 69 deletions(-) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 3a2d37e8462..7e8fae92ffb 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -113,8 +113,7 @@ static int can_use_hardware_watchpoint static void mention (struct breakpoint *); =20 static struct breakpoint *set_raw_breakpoint_without_location (struct gdba= rch *, - enum bptype, - const struct breakpoint_ops *); + enum bptype); static struct bp_location *add_location_to_breakpoint (struct breakpoint *, const struct symtab_and_line *); =20 @@ -122,13 +121,11 @@ static struct bp_location *add_location_to_breakpoint= (struct breakpoint *, static. */ static struct breakpoint *set_raw_breakpoint (struct gdbarch *gdbarch, struct symtab_and_line, - enum bptype, - const struct breakpoint_ops *); + enum bptype); =20 static struct breakpoint * momentary_breakpoint_from_master (struct breakpoint *orig, enum bptype type, - const struct breakpoint_ops *ops, int loc_enabled); =20 static void breakpoint_adjustment_warning (CORE_ADDR, CORE_ADDR, int, int); @@ -3251,15 +3248,14 @@ set_breakpoint_number (int internal, struct breakpo= int *b) =20 static struct breakpoint * create_internal_breakpoint (struct gdbarch *gdbarch, - CORE_ADDR address, enum bptype type, - const struct breakpoint_ops *ops) + CORE_ADDR address, enum bptype type) { symtab_and_line sal; sal.pc =3D address; sal.section =3D find_pc_overlay (sal.pc); sal.pspace =3D current_program_space; =20 - breakpoint *b =3D set_raw_breakpoint (gdbarch, sal, type, ops); + breakpoint *b =3D set_raw_breakpoint (gdbarch, sal, type); b->number =3D internal_breakpoint_number--; b->disposition =3D disp_donttouch; =20 @@ -3363,8 +3359,7 @@ create_overlay_event_breakpoint (void) =20 addr =3D bp_objfile_data->overlay_msym.value_address (); b =3D create_internal_breakpoint (objfile->arch (), addr, - bp_overlay_event, - &base_breakpoint_ops); + bp_overlay_event); initialize_explicit_location (&explicit_loc); explicit_loc.function_name =3D ASTRDUP (func_name); b->location =3D new_explicit_location (&explicit_loc); @@ -3423,8 +3418,7 @@ create_longjmp_master_breakpoint_probe (objfile *objf= ile) =20 b =3D create_internal_breakpoint (gdbarch, p->get_relocated_address (objfile), - bp_longjmp_master, - &base_breakpoint_ops); + bp_longjmp_master); b->location =3D new_probe_location ("-probe-stap libc:longjmp"); b->enable_state =3D bp_disabled; } @@ -3472,8 +3466,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, - &base_breakpoint_ops); + b =3D create_internal_breakpoint (gdbarch, addr, bp_longjmp_master); initialize_explicit_location (&explicit_loc); explicit_loc.function_name =3D ASTRDUP (func_name); b->location =3D new_explicit_location (&explicit_loc); @@ -3556,8 +3549,7 @@ create_std_terminate_master_breakpoint (void) =20 addr =3D bp_objfile_data->terminate_msym.value_address (); b =3D create_internal_breakpoint (objfile->arch (), addr, - bp_std_terminate_master, - &base_breakpoint_ops); + bp_std_terminate_master); initialize_explicit_location (&explicit_loc); explicit_loc.function_name =3D ASTRDUP (func_name); b->location =3D new_explicit_location (&explicit_loc); @@ -3609,8 +3601,7 @@ create_exception_master_breakpoint_probe (objfile *ob= jfile) { b =3D create_internal_breakpoint (gdbarch, p->get_relocated_address (objfile), - bp_exception_master, - &base_breakpoint_ops); + bp_exception_master); b->location =3D new_probe_location ("-probe-stap libgcc:unwind"); b->enable_state =3D bp_disabled; } @@ -3655,8 +3646,7 @@ create_exception_master_breakpoint_hook (objfile *obj= file) addr =3D bp_objfile_data->exception_msym.value_address (); addr =3D gdbarch_convert_from_func_ptr_addr (gdbarch, addr, current_inferior ()->top_target ()); - b =3D create_internal_breakpoint (gdbarch, addr, bp_exception_master, - &base_breakpoint_ops); + b =3D create_internal_breakpoint (gdbarch, addr, bp_exception_master); initialize_explicit_location (&explicit_loc); explicit_loc.function_name =3D ASTRDUP (func_name); b->location =3D new_explicit_location (&explicit_loc); @@ -7230,12 +7220,8 @@ add_to_breakpoint_chain (std::unique_ptr= &&b) static void init_raw_breakpoint_without_location (struct breakpoint *b, struct gdbarch *gdbarch, - enum bptype bptype, - const struct breakpoint_ops *ops) + enum bptype bptype) { - gdb_assert (ops !=3D NULL); - - b->ops =3D ops; b->type =3D bptype; b->gdbarch =3D gdbarch; b->language =3D current_language->la_language; @@ -7248,12 +7234,11 @@ init_raw_breakpoint_without_location (struct breakp= oint *b, =20 static struct breakpoint * set_raw_breakpoint_without_location (struct gdbarch *gdbarch, - enum bptype bptype, - const struct breakpoint_ops *ops) + enum bptype bptype) { std::unique_ptr b =3D new_breakpoint_from_type (bptype); =20 - init_raw_breakpoint_without_location (b.get (), gdbarch, bptype, ops); + init_raw_breakpoint_without_location (b.get (), gdbarch, bptype); return add_to_breakpoint_chain (std::move (b)); } =20 @@ -7319,10 +7304,9 @@ get_sal_arch (struct symtab_and_line sal) =20 static void init_raw_breakpoint (struct breakpoint *b, struct gdbarch *gdbarch, - struct symtab_and_line sal, enum bptype bptype, - const struct breakpoint_ops *ops) + struct symtab_and_line sal, enum bptype bptype) { - init_raw_breakpoint_without_location (b, gdbarch, bptype, ops); + init_raw_breakpoint_without_location (b, gdbarch, bptype); =20 add_location_to_breakpoint (b, &sal); =20 @@ -7353,12 +7337,11 @@ init_raw_breakpoint (struct breakpoint *b, struct g= dbarch *gdbarch, =20 static struct breakpoint * set_raw_breakpoint (struct gdbarch *gdbarch, - struct symtab_and_line sal, enum bptype bptype, - const struct breakpoint_ops *ops) + struct symtab_and_line sal, enum bptype bptype) { std::unique_ptr b =3D new_breakpoint_from_type (bptype); =20 - init_raw_breakpoint (b.get (), gdbarch, sal, bptype, ops); + init_raw_breakpoint (b.get (), gdbarch, sal, bptype); return add_to_breakpoint_chain (std::move (b)); } =20 @@ -7385,8 +7368,7 @@ set_longjmp_breakpoint (struct thread_info *tp, struc= t frame_id frame) =20 /* longjmp_breakpoint_ops ensures INITIATING_FRAME is cleared again after their removal. */ - clone =3D momentary_breakpoint_from_master (b, type, - &base_breakpoint_ops, 1); + clone =3D momentary_breakpoint_from_master (b, type, 1); clone->thread =3D thread; } =20 @@ -7432,7 +7414,6 @@ set_longjmp_breakpoint_for_call_dummy (void) struct breakpoint *new_b; =20 new_b =3D momentary_breakpoint_from_master (b, bp_longjmp_call_dummy, - &base_breakpoint_ops, 1); new_b->thread =3D inferior_thread ()->global_num; =20 @@ -7563,8 +7544,7 @@ set_std_terminate_breakpoint (void) if (b->pspace =3D=3D current_program_space && b->type =3D=3D bp_std_terminate_master) { - momentary_breakpoint_from_master (b, bp_std_terminate, - &base_breakpoint_ops, 1); + momentary_breakpoint_from_master (b, bp_std_terminate, 1); } } =20 @@ -7582,8 +7562,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, - &base_breakpoint_ops); + b =3D create_internal_breakpoint (gdbarch, address, bp_thread_event); =20 b->enable_state =3D bp_enabled; /* location has to be used or breakpoint_re_set will delete me. */ @@ -7605,8 +7584,7 @@ struct lang_and_radix struct breakpoint * create_jit_event_breakpoint (struct gdbarch *gdbarch, CORE_ADDR address) { - return create_internal_breakpoint (gdbarch, address, bp_jit_event, - &base_breakpoint_ops); + return create_internal_breakpoint (gdbarch, address, bp_jit_event); } =20 /* Remove JIT code registration and unregistration breakpoint(s). */ @@ -7650,8 +7628,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, - &base_breakpoint_ops); + b =3D create_internal_breakpoint (gdbarch, address, bp_shlib_event); update_global_location_list_nothrow (insert_mode); return b; } @@ -7835,8 +7812,7 @@ init_catchpoint (struct breakpoint *b, symtab_and_line sal; sal.pspace =3D current_program_space; =20 - init_raw_breakpoint (b, gdbarch, sal, bp_catchpoint, - &base_breakpoint_ops); + init_raw_breakpoint (b, gdbarch, sal, bp_catchpoint); =20 if (cond_string =3D=3D nullptr) b->cond_string.reset (); @@ -7970,8 +7946,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, - &base_breakpoint_ops); + init_raw_breakpoint_without_location (b.get (), gdbarch, bp_single_step); =20 b->disposition =3D disp_donttouch; b->frame_id =3D null_frame_id; @@ -7996,7 +7971,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, &base_breakpoint_ops); + b =3D set_raw_breakpoint (gdbarch, sal, type); b->enable_state =3D bp_enabled; b->disposition =3D disp_donttouch; b->frame_id =3D frame_id; @@ -8015,12 +7990,11 @@ set_momentary_breakpoint (struct gdbarch *gdbarch, = struct symtab_and_line sal, static struct breakpoint * momentary_breakpoint_from_master (struct breakpoint *orig, enum bptype type, - const struct breakpoint_ops *ops, int loc_enabled) { struct breakpoint *copy; =20 - copy =3D set_raw_breakpoint_without_location (orig->gdbarch, type, ops); + copy =3D set_raw_breakpoint_without_location (orig->gdbarch, type); copy->loc =3D copy->allocate_location (); set_breakpoint_location_function (copy->loc); =20 @@ -8055,8 +8029,7 @@ clone_momentary_breakpoint (struct breakpoint *orig) if (orig =3D=3D NULL) return NULL; =20 - gdb_assert (orig->ops =3D=3D &base_breakpoint_ops); - return momentary_breakpoint_from_master (orig, orig->type, orig->ops, 0); + return momentary_breakpoint_from_master (orig, orig->type, 0); } =20 breakpoint_up @@ -8352,7 +8325,7 @@ init_breakpoint_sal (struct breakpoint *b, struct gdb= arch *gdbarch, =20 if (&sal =3D=3D &sals[0]) { - init_raw_breakpoint (b, gdbarch, sal, type, ops); + init_raw_breakpoint (b, gdbarch, sal, type); b->thread =3D thread; b->task =3D task; =20 @@ -9013,7 +8986,7 @@ create_breakpoint (struct gdbarch *gdbarch, { std::unique_ptr b =3D new_breakpoint_from_type (type_wa= nted); =20 - init_raw_breakpoint_without_location (b.get (), gdbarch, type_wanted= , ops); + init_raw_breakpoint_without_location (b.get (), gdbarch, type_wanted= ); b->location =3D copy_event_location (location); =20 if (parse_extra) @@ -9461,8 +9434,7 @@ break_range_command (const char *arg, int from_tty) /* Now set up the breakpoint. */ std::unique_ptr br (new ranged_breakpoint ()); init_raw_breakpoint (br.get (), get_current_arch (), - sal_start, bp_hardware_breakpoint, - &base_breakpoint_ops); + sal_start, bp_hardware_breakpoint); b =3D add_to_breakpoint_chain (std::move (br)); =20 set_breakpoint_count (breakpoint_count + 1); @@ -10155,8 +10127,7 @@ watch_command_1 (const char *arg, int accessflag, i= nt from_tty, =20 scope_breakpoint =3D create_internal_breakpoint (caller_arch, caller_pc, - bp_watchpoint_scope, - &base_breakpoint_ops); + bp_watchpoint_scope); =20 /* create_internal_breakpoint could invalidate WP_FRAME. */ wp_frame =3D NULL; @@ -10196,8 +10167,7 @@ watch_command_1 (const char *arg, int accessflag, i= nt from_tty, w.reset (new masked_watchpoint ()); else w.reset (new watchpoint ()); - init_raw_breakpoint_without_location (w.get (), nullptr, bp_type, - &base_breakpoint_ops); + init_raw_breakpoint_without_location (w.get (), nullptr, bp_type); =20 w->thread =3D thread; w->task =3D task; @@ -10650,8 +10620,7 @@ init_ada_exception_breakpoint (struct breakpoint *b, enough for now, though. */ } =20 - init_raw_breakpoint (b, gdbarch, sal, bp_catchpoint, - &base_breakpoint_ops); + init_raw_breakpoint (b, gdbarch, sal, bp_catchpoint); =20 b->enable_state =3D enabled ? bp_enabled : bp_disabled; b->disposition =3D tempflag ? disp_del : disp_donttouch; @@ -12779,8 +12748,6 @@ location_to_sals (struct breakpoint *b, struct even= t_location *location, { struct gdb_exception exception; =20 - gdb_assert (b->ops !=3D NULL); - std::vector sals; =20 try diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index 7d4e8740cf0..b0ca4e98eb4 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -736,9 +736,6 @@ struct breakpoint /* Return a range of this breakpoint's locations. */ bp_location_range locations (); =20 - /* Methods associated with this breakpoint. */ - const breakpoint_ops *ops =3D NULL; - breakpoint *next =3D NULL; /* Type of breakpoint. */ bptype type =3D bp_none;