From: Tom Tromey Date: Sat, 30 Apr 2022 18:31:15 +0000 (-0600) Subject: Constify breakpoint::print_mention X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b713485d666a822a9e65c0272c8d7de51baa8b5f;p=binutils-gdb.git Constify breakpoint::print_mention This constifies breakpoint::print_mention. --- 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,