From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1879) id 9D869385841C; Thu, 25 May 2023 14:01:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9D869385841C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1685023280; bh=7zoLrQht2ktq4KV6tC7/eTmha8ukJP2RPoXYhEa8y4o=; h=From:To:Subject:Date:From; b=gSJB3E20Mhe5KyWURylICdhH6t3eclcNTMJ/OVyHy3ikLyGCbt9qcyI+upvkMJJG9 egtIJqCD/qveBFqp3PQIaE878m5BKmMvjg0qwkPSM0DN29BzzLucQCbYBYKDnV1J5D rrCnro8OMXJN29nPDVrsmcXDC1fyqQ5vg3ImHMvQ= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Simon Marchi To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb: constify breakpoint::print_it parameter X-Act-Checkin: binutils-gdb X-Git-Author: Simon Marchi X-Git-Refname: refs/heads/master X-Git-Oldrev: dbaa3bf64062798c3e3009ab18af432dc5e7f4f5 X-Git-Newrev: 5e632eca05f38ea7229f103e0636e02c6dfcd9fa Message-Id: <20230525140120.9D869385841C@sourceware.org> Date: Thu, 25 May 2023 14:01:20 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D5e632eca05f3= 8ea7229f103e0636e02c6dfcd9fa commit 5e632eca05f38ea7229f103e0636e02c6dfcd9fa Author: Simon Marchi Date: Mon May 8 16:40:40 2023 -0400 gdb: constify breakpoint::print_it parameter =20 The print_it method itself is const. In a subsequent patch, the locations that come out of a const breakpoint will be const as well. It will therefore be needed to make the last_loc output parameter const as well. Make that change now to reduce the size of the following patches. =20 Change-Id: I7ed962950bc9582646e31e2e42beca2a1c9c5105 Reviewed-By: Andrew Burgess 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 | 14 ++++++-------- gdb/breakpoint.h | 2 +- 9 files changed, 21 insertions(+), 23 deletions(-) diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 21f3348a161..b5a8b4bf544 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -12179,7 +12179,7 @@ struct ada_catchpoint : public code_breakpoint void re_set () override; 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; + bool print_one (const bp_location **) const override; void print_mention () const override; void print_recreate (struct ui_file *fp) const override; =20 @@ -12444,7 +12444,7 @@ ada_catchpoint::print_it (const bpstat *bs) const catchpoint kinds. */ =20 bool -ada_catchpoint::print_one (bp_location **last_loc) const +ada_catchpoint::print_one (const bp_location **last_loc) const {=20 struct ui_out *uiout =3D current_uiout; struct value_print_options opts; diff --git a/gdb/break-catch-exec.c b/gdb/break-catch-exec.c index 6cd498517af..2e4ce59f49c 100644 --- a/gdb/break-catch-exec.c +++ b/gdb/break-catch-exec.c @@ -49,7 +49,7 @@ struct exec_catchpoint : public catchpoint CORE_ADDR bp_addr, const target_waitstatus &ws) override; enum print_stop_action print_it (const bpstat *bs) const override; - bool print_one (bp_location **) const override; + bool print_one (const bp_location **) const override; void print_mention () const override; void print_recreate (struct ui_file *fp) const override; =20 @@ -110,7 +110,7 @@ exec_catchpoint::print_it (const bpstat *bs) const } =20 bool -exec_catchpoint::print_one (bp_location **last_loc) const +exec_catchpoint::print_one (const bp_location **last_loc) const { struct value_print_options opts; struct ui_out *uiout =3D current_uiout; diff --git a/gdb/break-catch-fork.c b/gdb/break-catch-fork.c index 1b1dace99d1..fc761bcaa2b 100644 --- a/gdb/break-catch-fork.c +++ b/gdb/break-catch-fork.c @@ -49,7 +49,7 @@ struct fork_catchpoint : public catchpoint CORE_ADDR bp_addr, const target_waitstatus &ws) override; enum print_stop_action print_it (const bpstat *bs) const override; - bool print_one (bp_location **) const override; + bool print_one (const bp_location **) const override; void print_mention () const override; void print_recreate (struct ui_file *fp) const override; =20 @@ -136,7 +136,7 @@ fork_catchpoint::print_it (const bpstat *bs) const /* Implement the "print_one" method for fork catchpoints. */ =20 bool -fork_catchpoint::print_one (bp_location **last_loc) const +fork_catchpoint::print_one (const bp_location **last_loc) const { struct value_print_options opts; struct ui_out *uiout =3D current_uiout; diff --git a/gdb/break-catch-load.c b/gdb/break-catch-load.c index e01f6450fd7..d33313a1d98 100644 --- a/gdb/break-catch-load.c +++ b/gdb/break-catch-load.c @@ -56,7 +56,7 @@ struct solib_catchpoint : public catchpoint const target_waitstatus &ws) override; 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; + bool print_one (const bp_location **) const override; void print_mention () const override; void print_recreate (struct ui_file *fp) const override; =20 @@ -158,7 +158,7 @@ solib_catchpoint::print_it (const bpstat *bs) const } =20 bool -solib_catchpoint::print_one (bp_location **locs) const +solib_catchpoint::print_one (const bp_location **locs) const { struct value_print_options opts; struct ui_out *uiout =3D current_uiout; diff --git a/gdb/break-catch-sig.c b/gdb/break-catch-sig.c index 8c1fcbd69ee..10c8b81f8e8 100644 --- a/gdb/break-catch-sig.c +++ b/gdb/break-catch-sig.c @@ -57,7 +57,7 @@ struct signal_catchpoint : public catchpoint CORE_ADDR bp_addr, const target_waitstatus &ws) override; enum print_stop_action print_it (const bpstat *bs) const override; - bool print_one (bp_location **) const override; + bool print_one (const bp_location **) const override; void print_mention () const override; void print_recreate (struct ui_file *fp) const override; bool explains_signal (enum gdb_signal) override; @@ -213,7 +213,7 @@ signal_catchpoint::print_it (const bpstat *bs) const /* Implement the "print_one" method for signal catchpoints. */ =20 bool -signal_catchpoint::print_one (bp_location **last_loc) const +signal_catchpoint::print_one (const bp_location **last_loc) const { struct value_print_options opts; struct ui_out *uiout =3D current_uiout; diff --git a/gdb/break-catch-syscall.c b/gdb/break-catch-syscall.c index 6475f4aa172..18e2b20c138 100644 --- a/gdb/break-catch-syscall.c +++ b/gdb/break-catch-syscall.c @@ -52,7 +52,7 @@ struct syscall_catchpoint : public catchpoint CORE_ADDR bp_addr, const target_waitstatus &ws) override; enum print_stop_action print_it (const bpstat *bs) const override; - bool print_one (bp_location **) const override; + bool print_one (const bp_location **) const override; void print_mention () const override; void print_recreate (struct ui_file *fp) const override; =20 @@ -236,7 +236,7 @@ syscall_catchpoint::print_it (const bpstat *bs) const /* Implement the "print_one" method for syscall catchpoints. */ =20 bool -syscall_catchpoint::print_one (bp_location **last_loc) const +syscall_catchpoint::print_one (const bp_location **last_loc) const { struct value_print_options opts; struct ui_out *uiout =3D current_uiout; diff --git a/gdb/break-catch-throw.c b/gdb/break-catch-throw.c index 604c1855c0d..47d534c5ee8 100644 --- a/gdb/break-catch-throw.c +++ b/gdb/break-catch-throw.c @@ -87,7 +87,7 @@ struct exception_catchpoint : public code_breakpoint =20 void re_set () override; enum print_stop_action print_it (const bpstat *bs) const override; - bool print_one (bp_location **) const override; + bool print_one (const bp_location **) const override; void print_mention () const override; void print_recreate (struct ui_file *fp) const override; void print_one_detail (struct ui_out *) const override; @@ -259,7 +259,7 @@ exception_catchpoint::print_it (const bpstat *bs) const } =20 bool -exception_catchpoint::print_one (bp_location **last_loc) const +exception_catchpoint::print_one (const bp_location **last_loc) const { struct value_print_options opts; struct ui_out *uiout =3D current_uiout; diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index facf23c3da9..30b985ab5bc 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -369,7 +369,7 @@ struct ranged_breakpoint : public ordinary_breakpoint const target_waitstatus &ws) override; int resources_needed (const struct bp_location *) override; enum print_stop_action print_it (const bpstat *bs) const override; - bool print_one (bp_location **) const override; + bool print_one (const bp_location **) const override; void print_one_detail (struct ui_out *) const override; void print_mention () const override; void print_recreate (struct ui_file *fp) const override; @@ -6342,7 +6342,7 @@ static bool print_one_breakpoint_location (struct breakpoint *b, struct bp_location *loc, int loc_number, - struct bp_location **last_loc, + const bp_location **last_loc, int allflag, bool raw_loc) { struct command_line *l; @@ -6705,9 +6705,7 @@ print_one_breakpoint_location (struct breakpoint *b, bool fix_multi_location_breakpoint_output_globally =3D false; =20 static void -print_one_breakpoint (struct breakpoint *b, - struct bp_location **last_loc,=20 - int allflag) +print_one_breakpoint (breakpoint *b, const bp_location **last_loc, int all= flag) { struct ui_out *uiout =3D current_uiout; bool use_fixed_output @@ -6791,7 +6789,7 @@ breakpoint_address_bits (struct breakpoint *b) void print_breakpoint (breakpoint *b) { - struct bp_location *dummy_loc =3D NULL; + const bp_location *dummy_loc =3D nullptr; print_one_breakpoint (b, &dummy_loc, 0); } =20 @@ -6829,7 +6827,7 @@ static int breakpoint_1 (const char *bp_num_list, bool show_internal, bool (*filter) (const struct breakpoint *)) { - struct bp_location *last_loc =3D NULL; + const bp_location *last_loc =3D nullptr; int nr_printable_breakpoints; struct value_print_options opts; int print_address_bits =3D 0; @@ -9409,7 +9407,7 @@ ranged_breakpoint::print_it (const bpstat *bs) const /* Implement the "print_one" method for ranged breakpoints. */ =20 bool -ranged_breakpoint::print_one (bp_location **last_loc) const +ranged_breakpoint::print_one (const bp_location **last_loc) const { struct bp_location *bl =3D loc; struct value_print_options opts; diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index 7c5cf3f2bef..80cb91b1a91 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -684,7 +684,7 @@ struct breakpoint /* Display information about this breakpoint, for "info breakpoints". Returns false if this method should use the default behavior. */ - virtual bool print_one (bp_location **) const + virtual bool print_one (const bp_location **) const { return false; }