From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id B2689394BE26; Fri, 6 May 2022 18:10:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B2689394BE26 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] Constify breakpoint::print_mention X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: a67bcaba1c47a01826ed2769a41f84c533183ddf X-Git-Newrev: b713485d666a822a9e65c0272c8d7de51baa8b5f Message-Id: <20220506181031.B2689394BE26@sourceware.org> Date: Fri, 6 May 2022 18:10: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, 06 May 2022 18:10:31 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Db713485d666a= 822a9e65c0272c8d7de51baa8b5f commit b713485d666a822a9e65c0272c8d7de51baa8b5f Author: Tom Tromey Date: Sat Apr 30 12:31:15 2022 -0600 Constify breakpoint::print_mention =20 This constifies breakpoint::print_mention. Diff: --- 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; =20 /* 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. */ =20 void -ada_catchpoint::print_mention () +ada_catchpoint::print_mention () const { struct ui_out *uiout =3D current_uiout; =20 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; =20 /* Filename of a program whose exec triggered this catchpoint. @@ -133,7 +133,7 @@ exec_catchpoint::print_one (bp_location **last_loc) con= st } =20 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; =20 /* True if the breakpoint is for vfork, false for fork. */ @@ -160,7 +160,7 @@ fork_catchpoint::print_one (bp_location **last_loc) con= st /* Implement the "print_mention" method for fork catchpoints. */ =20 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; =20 /* True for "catch load", false for "catch unload". */ @@ -189,7 +189,7 @@ solib_catchpoint::print_one (bp_location **locs) const } =20 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; =20 @@ -255,7 +255,7 @@ signal_catchpoint::print_one (bp_location **last_loc) c= onst /* Implement the "print_mention" method for signal catchpoints. */ =20 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; =20 /* 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. */ =20 void -syscall_catchpoint::print_mention () +syscall_catchpoint::print_mention () const { struct gdbarch *gdbarch =3D loc->gdbarch; =20 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 } =20 void -exception_catchpoint::print_mention () +exception_catchpoint::print_mention () const { struct ui_out *uiout =3D 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_def= ault static int can_use_hardware_watchpoint (const std::vector &vals); =20 -static void mention (struct breakpoint *); +static void mention (const breakpoint *); =20 static struct breakpoint *set_raw_breakpoint_without_location (struct gdba= rch *, 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; }; =20 @@ -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; }; =20 /* 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; }; =20 /* 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; }; =20 @@ -8050,7 +8050,7 @@ set_momentary_breakpoint_at_pc (struct gdbarch *gdbar= ch, CORE_ADDR pc, /* Tell the user we have just set a breakpoint B. */ =20 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 *u= iout) const /* Implement the "print_mention" method for ranged breakpoints. */ =20 void -ranged_breakpoint::print_mention () +ranged_breakpoint::print_mention () const { struct bp_location *bl =3D loc; struct ui_out *uiout =3D current_uiout; @@ -9654,7 +9654,7 @@ watchpoint::print_it (const bpstat *bs) const /* Implement the "print_mention" method for hardware watchpoints. */ =20 void -watchpoint::print_mention () +watchpoint::print_mention () const { struct ui_out *uiout =3D 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; }; =20 @@ -9845,7 +9845,7 @@ masked_watchpoint::print_one_detail (struct ui_out *u= iout) const watchpoints. */ =20 void -masked_watchpoint::print_mention () +masked_watchpoint::print_mention () const { struct ui_out *uiout =3D current_uiout; const char *tuple_name; @@ -11442,7 +11442,7 @@ bpstat_remove_breakpoint_callback (struct thread_in= fo *th, void *data) callbacks. */ =20 static void -say_where (struct breakpoint *b) +say_where (const breakpoint *b) { struct value_print_options opts; =20 @@ -11563,7 +11563,7 @@ breakpoint::print_it (const bpstat *bs) const } =20 void -breakpoint::print_mention () +breakpoint::print_mention () const { internal_error_pure_virtual_called (); } @@ -11719,7 +11719,7 @@ ordinary_breakpoint::print_it (const bpstat *bs) co= nst } =20 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) co= nst } =20 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) c= onst } =20 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 } =20 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 =20 /* Display information about this breakpoint after setting it (roughly speaking; this is called from "mention"). */ - virtual void print_mention (); + virtual void print_mention () const; =20 /* 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; =20 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; =20 @@ -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,