From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gproxy4-pub.mail.unifiedlayer.com (gproxy4-pub.mail.unifiedlayer.com [69.89.23.142]) by sourceware.org (Postfix) with ESMTPS id EBB493857343 for ; Mon, 2 May 2022 22:15:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EBB493857343 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 cmgw12.mail.unifiedlayer.com (unknown [10.0.90.127]) by progateway6.mail.pro1.eigbox.com (Postfix) with ESMTP id 4E82F1004749D for ; Mon, 2 May 2022 22:15:58 +0000 (UTC) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTP id leKjnPUQKb2WGleKjngnGh; Mon, 02 May 2022 22:15:58 +0000 X-Authority-Reason: nr=8 X-Authority-Analysis: v=2.4 cv=SqtVVNC0 c=1 sm=1 tr=0 ts=6270581e a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=oZkIemNP1mAA:10:nop_rcvd_month_year a=Qbun_eYptAEA:10:endurance_base64_authed_username_1 a=FG9zTcOpYfdI-Gbm3-kA: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=xwvLRTrqDgiMG/t/jh8EECFFD162aRns3SXSJguSQGU=; b=Vb2lbbnHT1deTUEBrAy5HKZhFm oa/gGnetud3Ae/sapkz6WE2bnKFmLfFoe1XNaiPJtMAddckBGGMUvlgTUlkodnO/oq1F9bMmG9Jbj 2eKbu8yGDTY4XrbyYtANzGuq+; Received: from 71-211-158-194.hlrn.qwest.net ([71.211.158.194]:45572 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 1nleKj-002K6S-DZ; Mon, 02 May 2022 16:15:57 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 07/18] Constify breakpoint::print_mention Date: Mon, 2 May 2022 16:15:42 -0600 Message-Id: <20220502221553.1394743-8-tom@tromey.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220502221553.1394743-1-tom@tromey.com> References: <20220502221553.1394743-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: 71.211.158.194 X-Source-L: No X-Exim-ID: 1nleKj-002K6S-DZ X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 71-211-158-194.hlrn.qwest.net (prentzel.Home) [71.211.158.194]:45572 X-Source-Auth: tom+tromey.com X-Email-Count: 8 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3029.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: Mon, 02 May 2022 22:16:01 -0000 This constifies breakpoint::print_mention. --- gdb/ada-lang.c | 4 ++-- gdb/break-catch-exec.c | 4 ++-- gdb/break-catch-fork.c | 4 ++-- gdb/break-catch-load.c | 4 ++-- gdb/break-catch-sig.c | 4 ++-- gdb/break-catch-syscall.c | 4 ++-- gdb/break-catch-throw.c | 4 ++-- gdb/breakpoint.c | 32 ++++++++++++++++---------------- gdb/breakpoint.h | 6 +++--- 9 files changed, 33 insertions(+), 33 deletions(-) diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 68d160a0190..c5b9d08a91e 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -12132,7 +12132,7 @@ struct ada_catchpoint : public base_breakpoint void check_status (struct bpstat *bs) override; enum print_stop_action print_it (const bpstat *bs) const override; bool print_one (bp_location **) const override; - void print_mention () override; + void print_mention () const override; void print_recreate (struct ui_file *fp) override; /* The name of the specific exception the user specified. */ @@ -12440,7 +12440,7 @@ ada_catchpoint::print_one (bp_location **last_loc) const for all exception catchpoint kinds. */ void -ada_catchpoint::print_mention () +ada_catchpoint::print_mention () const { struct ui_out *uiout = current_uiout; diff --git a/gdb/break-catch-exec.c b/gdb/break-catch-exec.c index 9a89d7717ea..5cb08bde184 100644 --- a/gdb/break-catch-exec.c +++ b/gdb/break-catch-exec.c @@ -45,7 +45,7 @@ struct exec_catchpoint : public breakpoint const target_waitstatus &ws) override; enum print_stop_action print_it (const bpstat *bs) const override; bool print_one (bp_location **) const override; - void print_mention () override; + void print_mention () const override; void print_recreate (struct ui_file *fp) override; /* Filename of a program whose exec triggered this catchpoint. @@ -133,7 +133,7 @@ exec_catchpoint::print_one (bp_location **last_loc) const } void -exec_catchpoint::print_mention () +exec_catchpoint::print_mention () const { gdb_printf (_("Catchpoint %d (exec)"), number); } diff --git a/gdb/break-catch-fork.c b/gdb/break-catch-fork.c index 1d01b95f018..1fbea571112 100644 --- a/gdb/break-catch-fork.c +++ b/gdb/break-catch-fork.c @@ -43,7 +43,7 @@ struct fork_catchpoint : public breakpoint const target_waitstatus &ws) override; enum print_stop_action print_it (const bpstat *bs) const override; bool print_one (bp_location **) const override; - void print_mention () override; + void print_mention () const override; void print_recreate (struct ui_file *fp) override; /* True if the breakpoint is for vfork, false for fork. */ @@ -160,7 +160,7 @@ fork_catchpoint::print_one (bp_location **last_loc) const /* Implement the "print_mention" method for fork catchpoints. */ void -fork_catchpoint::print_mention () +fork_catchpoint::print_mention () const { gdb_printf (_("Catchpoint %d (%s)"), number, is_vfork ? "vfork" : "fork"); diff --git a/gdb/break-catch-load.c b/gdb/break-catch-load.c index ce62aaf53d6..7f2efd57de2 100644 --- a/gdb/break-catch-load.c +++ b/gdb/break-catch-load.c @@ -45,7 +45,7 @@ struct solib_catchpoint : public breakpoint void check_status (struct bpstat *bs) override; enum print_stop_action print_it (const bpstat *bs) const override; bool print_one (bp_location **) const override; - void print_mention () override; + void print_mention () const override; void print_recreate (struct ui_file *fp) override; /* True for "catch load", false for "catch unload". */ @@ -189,7 +189,7 @@ solib_catchpoint::print_one (bp_location **locs) const } void -solib_catchpoint::print_mention () +solib_catchpoint::print_mention () const { gdb_printf (_("Catchpoint %d (%s)"), number, is_load ? "load" : "unload"); diff --git a/gdb/break-catch-sig.c b/gdb/break-catch-sig.c index 8ded60374c9..6665c9eaab0 100644 --- a/gdb/break-catch-sig.c +++ b/gdb/break-catch-sig.c @@ -49,7 +49,7 @@ struct signal_catchpoint : public breakpoint const target_waitstatus &ws) override; enum print_stop_action print_it (const bpstat *bs) const override; bool print_one (bp_location **) const override; - void print_mention () override; + void print_mention () const override; void print_recreate (struct ui_file *fp) override; bool explains_signal (enum gdb_signal) override; @@ -255,7 +255,7 @@ signal_catchpoint::print_one (bp_location **last_loc) const /* Implement the "print_mention" method for signal catchpoints. */ void -signal_catchpoint::print_mention () +signal_catchpoint::print_mention () const { if (!signals_to_be_caught.empty ()) { diff --git a/gdb/break-catch-syscall.c b/gdb/break-catch-syscall.c index e7810cb711c..721a87c66b6 100644 --- a/gdb/break-catch-syscall.c +++ b/gdb/break-catch-syscall.c @@ -46,7 +46,7 @@ struct syscall_catchpoint : public breakpoint const target_waitstatus &ws) override; enum print_stop_action print_it (const bpstat *bs) const override; bool print_one (bp_location **) const override; - void print_mention () override; + void print_mention () const override; void print_recreate (struct ui_file *fp) override; /* Syscall numbers used for the 'catch syscall' feature. If no @@ -284,7 +284,7 @@ syscall_catchpoint::print_one (bp_location **last_loc) const /* Implement the "print_mention" method for syscall catchpoints. */ void -syscall_catchpoint::print_mention () +syscall_catchpoint::print_mention () const { struct gdbarch *gdbarch = loc->gdbarch; diff --git a/gdb/break-catch-throw.c b/gdb/break-catch-throw.c index 759391c7ad3..1ab518f02c0 100644 --- a/gdb/break-catch-throw.c +++ b/gdb/break-catch-throw.c @@ -70,7 +70,7 @@ struct exception_catchpoint : public base_breakpoint void re_set () override; enum print_stop_action print_it (const bpstat *bs) const override; bool print_one (bp_location **) const override; - void print_mention () override; + void print_mention () const override; void print_recreate (struct ui_file *fp) override; void print_one_detail (struct ui_out *) const override; void check_status (struct bpstat *bs) override; @@ -302,7 +302,7 @@ exception_catchpoint::print_one_detail (struct ui_out *uiout) const } void -exception_catchpoint::print_mention () +exception_catchpoint::print_mention () const { struct ui_out *uiout = current_uiout; int bp_temp; diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 195fa302a6d..ddb198523ca 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -110,7 +110,7 @@ static std::vector decode_location_default static int can_use_hardware_watchpoint (const std::vector &vals); -static void mention (struct breakpoint *); +static void mention (const breakpoint *); static struct breakpoint *set_raw_breakpoint_without_location (struct gdbarch *, enum bptype); @@ -260,7 +260,7 @@ struct ordinary_breakpoint : public base_breakpoint { int resources_needed (const struct bp_location *) override; enum print_stop_action print_it (const bpstat *bs) const override; - void print_mention () override; + void print_mention () const override; void print_recreate (struct ui_file *fp) override; }; @@ -270,7 +270,7 @@ struct internal_breakpoint : public base_breakpoint void re_set () override; void check_status (struct bpstat *bs) override; enum print_stop_action print_it (const bpstat *bs) const override; - void print_mention () override; + void print_mention () const override; }; /* Momentary breakpoints. */ @@ -279,7 +279,7 @@ struct momentary_breakpoint : public base_breakpoint void re_set () override; void check_status (struct bpstat *bs) override; enum print_stop_action print_it (const bpstat *bs) const override; - void print_mention () override; + void print_mention () const override; }; /* DPrintf breakpoints. */ @@ -305,7 +305,7 @@ struct ranged_breakpoint : public ordinary_breakpoint enum print_stop_action print_it (const bpstat *bs) const override; bool print_one (bp_location **) const override; void print_one_detail (struct ui_out *) const override; - void print_mention () override; + void print_mention () const override; void print_recreate (struct ui_file *fp) override; }; @@ -8050,7 +8050,7 @@ set_momentary_breakpoint_at_pc (struct gdbarch *gdbarch, CORE_ADDR pc, /* Tell the user we have just set a breakpoint B. */ static void -mention (struct breakpoint *b) +mention (const breakpoint *b) { b->print_mention (); current_uiout->text ("\n"); @@ -9287,7 +9287,7 @@ ranged_breakpoint::print_one_detail (struct ui_out *uiout) const /* Implement the "print_mention" method for ranged breakpoints. */ void -ranged_breakpoint::print_mention () +ranged_breakpoint::print_mention () const { struct bp_location *bl = loc; struct ui_out *uiout = current_uiout; @@ -9654,7 +9654,7 @@ watchpoint::print_it (const bpstat *bs) const /* Implement the "print_mention" method for hardware watchpoints. */ void -watchpoint::print_mention () +watchpoint::print_mention () const { struct ui_out *uiout = current_uiout; const char *tuple_name; @@ -9736,7 +9736,7 @@ struct masked_watchpoint : public watchpoint bool works_in_software_mode () const override; enum print_stop_action print_it (const bpstat *bs) const override; void print_one_detail (struct ui_out *) const override; - void print_mention () override; + void print_mention () const override; void print_recreate (struct ui_file *fp) override; }; @@ -9845,7 +9845,7 @@ masked_watchpoint::print_one_detail (struct ui_out *uiout) const watchpoints. */ void -masked_watchpoint::print_mention () +masked_watchpoint::print_mention () const { struct ui_out *uiout = current_uiout; const char *tuple_name; @@ -11442,7 +11442,7 @@ bpstat_remove_breakpoint_callback (struct thread_info *th, void *data) callbacks. */ static void -say_where (struct breakpoint *b) +say_where (const breakpoint *b) { struct value_print_options opts; @@ -11563,7 +11563,7 @@ breakpoint::print_it (const bpstat *bs) const } void -breakpoint::print_mention () +breakpoint::print_mention () const { internal_error_pure_virtual_called (); } @@ -11719,7 +11719,7 @@ ordinary_breakpoint::print_it (const bpstat *bs) const } void -ordinary_breakpoint::print_mention () +ordinary_breakpoint::print_mention () const { if (current_uiout->is_mi_like_p ()) return; @@ -11871,7 +11871,7 @@ internal_breakpoint::print_it (const bpstat *bs) const } void -internal_breakpoint::print_mention () +internal_breakpoint::print_mention () const { /* Nothing to mention. These breakpoints are internal. */ } @@ -11900,7 +11900,7 @@ momentary_breakpoint::print_it (const bpstat *bs) const } void -momentary_breakpoint::print_mention () +momentary_breakpoint::print_mention () const { /* Nothing to mention. These breakpoints are internal. */ } @@ -11975,7 +11975,7 @@ tracepoint::print_one_detail (struct ui_out *uiout) const } void -tracepoint::print_mention () +tracepoint::print_mention () const { if (current_uiout->is_mi_like_p ()) return; diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index 1b399d47384..4f27262ef20 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -699,7 +699,7 @@ struct breakpoint /* Display information about this breakpoint after setting it (roughly speaking; this is called from "mention"). */ - virtual void print_mention (); + virtual void print_mention () const; /* Print to FP the CLI command that recreates this breakpoint. */ virtual void print_recreate (struct ui_file *fp); @@ -880,7 +880,7 @@ struct watchpoint : public breakpoint virtual bool works_in_software_mode () const; enum print_stop_action print_it (const bpstat *bs) const override; - void print_mention () override; + void print_mention () const override; void print_recreate (struct ui_file *fp) override; bool explains_signal (enum gdb_signal) override; @@ -961,7 +961,7 @@ struct tracepoint : public breakpoint const address_space *aspace, CORE_ADDR bp_addr, const target_waitstatus &ws) override; void print_one_detail (struct ui_out *uiout) const override; - void print_mention () override; + void print_mention () const override; void print_recreate (struct ui_file *fp) override; std::vector decode_location (struct event_location *location, -- 2.34.1