From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gproxy1-pub.mail.unifiedlayer.com (gproxy1-pub.mail.unifiedlayer.com [69.89.25.95]) by sourceware.org (Postfix) with ESMTPS id A388D3857C74 for ; Tue, 18 Jan 2022 19:40:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A388D3857C74 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com Received: from cmgw13.mail.unifiedlayer.com (unknown [10.0.90.128]) by progateway3.mail.pro1.eigbox.com (Postfix) with ESMTP id 1FD6010048A15 for ; Tue, 18 Jan 2022 19:40:23 +0000 (UTC) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTP id 9uL8nWPETEaNC9uL8nPhnh; Tue, 18 Jan 2022 19:40:23 +0000 X-Authority-Reason: nr=8 X-Authority-Analysis: v=2.4 cv=dJtjJMVb c=1 sm=1 tr=0 ts=61e717a7 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=DghFqjY3_ZEA:10:nop_rcvd_month_year a=Qbun_eYptAEA:10:endurance_base64_authed_username_1 a=4bHB6ElAp5xRFtjOEu8A:9 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=FUe0EEI0EE8pBbSgD3KiFA9raGCelxLMN0tut6xazVc=; b=KiLy81t9rcjztlXesYpDQ3bR9g nY8XIJkRCTDL9Y2u+jqeIymu14UMi+lXSn38zhnriL+fxpgdiwZP5xdeCy8kjZhdJu2ilQrqZ7GBy eRrgRA6QlsQwyJnzXXfb+a2iL; Received: from 75-166-134-30.hlrn.qwest.net ([75.166.134.30]:40588 helo=prentzel.Home) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1n9uL7-0015df-On; Tue, 18 Jan 2022 12:40:21 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 32/36] Remove vtable_breakpoint_ops Date: Tue, 18 Jan 2022 12:40:03 -0700 Message-Id: <20220118194007.2853108-33-tom@tromey.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220118194007.2853108-1-tom@tromey.com> References: <20220118194007.2853108-1-tom@tromey.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 75.166.134.30 X-Source-L: No X-Exim-ID: 1n9uL7-0015df-On X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-166-134-30.hlrn.qwest.net (prentzel.Home) [75.166.134.30]:40588 X-Source-Auth: tom+tromey.com X-Email-Count: 33 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3030.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_STOCKGEN, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2022 19:40:25 -0000 There's no need to have vtable_breakpoint_ops any more, so remove it in favor of base_breakpoint_ops. --- 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 c97a55f488a..89893d48b20 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -3346,7 +3346,7 @@ create_overlay_event_breakpoint (void) addr = BMSYMBOL_VALUE_ADDRESS (bp_objfile_data->overlay_msym); b = create_internal_breakpoint (objfile->arch (), addr, bp_overlay_event, - &vtable_breakpoint_ops); + &base_breakpoint_ops); initialize_explicit_location (&explicit_loc); explicit_loc.function_name = ASTRDUP (func_name); b->location = new_explicit_location (&explicit_loc); @@ -3406,7 +3406,7 @@ create_longjmp_master_breakpoint_probe (objfile *objfile) b = create_internal_breakpoint (gdbarch, p->get_relocated_address (objfile), bp_longjmp_master, - &vtable_breakpoint_ops); + &base_breakpoint_ops); b->location = new_probe_location ("-probe-stap libc:longjmp"); b->enable_state = bp_disabled; } @@ -3455,7 +3455,7 @@ create_longjmp_master_breakpoint_names (objfile *objfile) addr = BMSYMBOL_VALUE_ADDRESS (bp_objfile_data->longjmp_msym[i]); b = create_internal_breakpoint (gdbarch, addr, bp_longjmp_master, - &vtable_breakpoint_ops); + &base_breakpoint_ops); initialize_explicit_location (&explicit_loc); explicit_loc.function_name = ASTRDUP (func_name); b->location = new_explicit_location (&explicit_loc); @@ -3539,7 +3539,7 @@ create_std_terminate_master_breakpoint (void) addr = BMSYMBOL_VALUE_ADDRESS (bp_objfile_data->terminate_msym); b = 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 = ASTRDUP (func_name); b->location = new_explicit_location (&explicit_loc); @@ -3592,7 +3592,7 @@ create_exception_master_breakpoint_probe (objfile *objfile) b = create_internal_breakpoint (gdbarch, p->get_relocated_address (objfile), bp_exception_master, - &vtable_breakpoint_ops); + &base_breakpoint_ops); b->location = new_probe_location ("-probe-stap libgcc:unwind"); b->enable_state = bp_disabled; } @@ -3638,7 +3638,7 @@ create_exception_master_breakpoint_hook (objfile *objfile) addr = gdbarch_convert_from_func_ptr_addr (gdbarch, addr, current_inferior ()->top_target ()); b = create_internal_breakpoint (gdbarch, addr, bp_exception_master, - &vtable_breakpoint_ops); + &base_breakpoint_ops); initialize_explicit_location (&explicit_loc); explicit_loc.function_name = ASTRDUP (func_name); b->location = new_explicit_location (&explicit_loc); @@ -7317,7 +7317,7 @@ set_longjmp_breakpoint (struct thread_info *tp, struct frame_id frame) /* longjmp_breakpoint_ops ensures INITIATING_FRAME is cleared again after their removal. */ clone = momentary_breakpoint_from_master (b, type, - &vtable_breakpoint_ops, 1); + &base_breakpoint_ops, 1); clone->thread = thread; } @@ -7363,7 +7363,7 @@ set_longjmp_breakpoint_for_call_dummy (void) struct breakpoint *new_b; new_b = momentary_breakpoint_from_master (b, bp_longjmp_call_dummy, - &vtable_breakpoint_ops, + &base_breakpoint_ops, 1); new_b->thread = inferior_thread ()->global_num; @@ -7495,7 +7495,7 @@ set_std_terminate_breakpoint (void) && b->type == bp_std_terminate_master) { momentary_breakpoint_from_master (b, bp_std_terminate, - &vtable_breakpoint_ops, 1); + &base_breakpoint_ops, 1); } } @@ -7514,7 +7514,7 @@ create_thread_event_breakpoint (struct gdbarch *gdbarch, CORE_ADDR address) struct breakpoint *b; b = create_internal_breakpoint (gdbarch, address, bp_thread_event, - &vtable_breakpoint_ops); + &base_breakpoint_ops); b->enable_state = bp_enabled; /* location has to be used or breakpoint_re_set will delete me. */ @@ -7537,7 +7537,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); } /* Remove JIT code registration and unregistration breakpoint(s). */ @@ -7582,7 +7582,7 @@ create_solib_event_breakpoint_1 (struct gdbarch *gdbarch, CORE_ADDR address, struct breakpoint *b; b = create_internal_breakpoint (gdbarch, address, bp_shlib_event, - &vtable_breakpoint_ops); + &base_breakpoint_ops); update_global_location_list_nothrow (insert_mode); return b; } @@ -7767,7 +7767,7 @@ init_catchpoint (struct breakpoint *b, sal.pspace = current_program_space; init_raw_breakpoint (b, gdbarch, sal, bp_catchpoint, - &vtable_breakpoint_ops); + &base_breakpoint_ops); if (cond_string == nullptr) b->cond_string.reset (); @@ -7902,7 +7902,7 @@ new_single_step_breakpoint (int thread, struct gdbarch *gdbarch) std::unique_ptr b (new momentary_breakpoint ()); init_raw_breakpoint_without_location (b.get (), gdbarch, bp_single_step, - &vtable_breakpoint_ops); + &base_breakpoint_ops); b->disposition = disp_donttouch; b->frame_id = null_frame_id; @@ -7927,7 +7927,7 @@ set_momentary_breakpoint (struct gdbarch *gdbarch, struct symtab_and_line sal, tail-called one. */ gdb_assert (!frame_id_artificial_p (frame_id)); - b = set_raw_breakpoint (gdbarch, sal, type, &vtable_breakpoint_ops); + b = set_raw_breakpoint (gdbarch, sal, type, &base_breakpoint_ops); b->enable_state = bp_enabled; b->disposition = disp_donttouch; b->frame_id = frame_id; @@ -7986,7 +7986,7 @@ clone_momentary_breakpoint (struct breakpoint *orig) if (orig == NULL) return NULL; - gdb_assert (orig->ops = &vtable_breakpoint_ops); + gdb_assert (orig->ops = &base_breakpoint_ops); return momentary_breakpoint_from_master (orig, orig->type, orig->ops, 0); } @@ -8770,14 +8770,14 @@ breakpoint_ops_for_event_location_type (enum event_location_type location_type, if (location_type == PROBE_LOCATION) return &tracepoint_probe_breakpoint_ops; else - return &vtable_breakpoint_ops; + return &base_breakpoint_ops; } else { if (location_type == PROBE_LOCATION) return &bkpt_probe_breakpoint_ops; else - return &vtable_breakpoint_ops; + return &base_breakpoint_ops; } } @@ -8790,7 +8790,7 @@ breakpoint_ops_for_event_location (const struct event_location *location, if (location != nullptr) return breakpoint_ops_for_event_location_type (event_location_type (location), is_tracepoint); - return &vtable_breakpoint_ops; + return &base_breakpoint_ops; } /* See breakpoint.h. */ @@ -9198,7 +9198,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 */, @@ -9466,7 +9466,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 = add_to_breakpoint_chain (std::move (br)); set_breakpoint_count (breakpoint_count + 1); @@ -10160,7 +10160,7 @@ watch_command_1 (const char *arg, int accessflag, int from_tty, scope_breakpoint = create_internal_breakpoint (caller_arch, caller_pc, bp_watchpoint_scope, - &vtable_breakpoint_ops); + &base_breakpoint_ops); /* create_internal_breakpoint could invalidate WP_FRAME. */ wp_frame = NULL; @@ -10201,7 +10201,7 @@ watch_command_1 (const char *arg, int accessflag, int from_tty, else w.reset (new watchpoint ()); init_raw_breakpoint_without_location (w.get (), nullptr, bp_type, - &vtable_breakpoint_ops); + &base_breakpoint_ops); w->thread = thread; w->task = task; @@ -10653,7 +10653,7 @@ init_ada_exception_breakpoint (struct breakpoint *b, } init_raw_breakpoint (b, gdbarch, sal, bp_catchpoint, - &vtable_breakpoint_ops); + &base_breakpoint_ops); b->enable_state = enabled ? bp_enabled : bp_disabled; b->disposition = tempflag ? disp_del : disp_donttouch; @@ -11612,31 +11612,6 @@ breakpoint::print_recreate (struct ui_file *fp) internal_error_pure_virtual_called (); } -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) @@ -11645,12 +11620,6 @@ breakpoint::decode_location (struct event_location *location, } struct breakpoint_ops base_breakpoint_ops = -{ - base_breakpoint_create_sals_from_location, - base_breakpoint_create_breakpoints_sal, -}; - -struct breakpoint_ops vtable_breakpoint_ops = { create_sals_from_location_default, create_breakpoints_sal_default, @@ -13745,7 +13714,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); @@ -13770,7 +13739,7 @@ strace_command (const char *arg, int from_tty) } else { - ops = &vtable_breakpoint_ops; + ops = &base_breakpoint_ops; location = string_to_event_location (&arg, current_language); type = bp_static_tracepoint; } @@ -13853,7 +13822,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 */, @@ -14400,17 +14369,17 @@ initialize_breakpoint_ops (void) /* Probe breakpoints. */ ops = &bkpt_probe_breakpoint_ops; - *ops = vtable_breakpoint_ops; + *ops = base_breakpoint_ops; ops->create_sals_from_location = bkpt_probe_create_sals_from_location; /* Probe tracepoints. */ ops = &tracepoint_probe_breakpoint_ops; - *ops = vtable_breakpoint_ops; + *ops = base_breakpoint_ops; ops->create_sals_from_location = tracepoint_probe_create_sals_from_location; /* Static tracepoints with marker (`-m'). */ ops = &strace_marker_breakpoint_ops; - *ops = vtable_breakpoint_ops; + *ops = base_breakpoint_ops; ops->create_sals_from_location = strace_marker_create_sals_from_location; ops->create_breakpoints_sal = strace_marker_create_breakpoints_sal; } diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index 86f7a9d9665..1c9d9159806 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -1381,7 +1381,6 @@ extern void rwatch_command_wrapper (const char *, int, bool); extern void tbreak_command (const char *, int); extern struct breakpoint_ops base_breakpoint_ops; -extern struct breakpoint_ops vtable_breakpoint_ops; extern void initialize_breakpoint_ops (void); @@ -1431,8 +1430,7 @@ extern void install_breakpoint (int internal, std::unique_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. */ 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 *command, char **argv, int argc) else if (dprintf) { type_wanted = bp_dprintf; - ops = &vtable_breakpoint_ops; + ops = &base_breakpoint_ops; } else { type_wanted = hardware ? bp_hardware_breakpoint : bp_breakpoint; - ops = &vtable_breakpoint_ops; + ops = &base_breakpoint_ops; } if (is_explicit) diff --git a/gdb/python/py-finishbreakpoint.c b/gdb/python/py-finishbreakpoint.c index 00129b09240..cbf3a25e911 100644 --- a/gdb/python/py-finishbreakpoint.c +++ b/gdb/python/py-finishbreakpoint.c @@ -300,7 +300,7 @@ bpfinishpy_init (PyObject *self, PyObject *args, PyObject *kwargs) bp_breakpoint, 0, AUTO_BOOLEAN_TRUE, - &vtable_breakpoint_ops, + &base_breakpoint_ops, 0, 1, internal_bp, 0); } catch (const gdb_exception &except) -- 2.31.1