From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id C627E3858D1E; Sun, 14 Aug 2022 13:47:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C627E3858D1E 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] Change breakpoint_re_set_default to a method X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 8ad969a3fe9159c261092875def3b323acc594e2 X-Git-Newrev: b3d5660a7adf2e1e3846976ff4346c6a9b323978 Message-Id: <20220814134754.C627E3858D1E@sourceware.org> Date: Sun, 14 Aug 2022 13:47:54 +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: Sun, 14 Aug 2022 13:47:54 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Db3d5660a7adf= 2e1e3846976ff4346c6a9b323978 commit b3d5660a7adf2e1e3846976ff4346c6a9b323978 Author: Tom Tromey Date: Sat May 21 09:57:43 2022 -0600 Change breakpoint_re_set_default to a method =20 breakpoint_re_set_default is only ever called from breakpoint re_set methods, so make it a protected method on code_breakpoint. Diff: --- gdb/breakpoint.c | 18 ++++++++---------- gdb/breakpoint.h | 5 +++++ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 37f70a77721..35701930cac 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -87,8 +87,6 @@ static void map_breakpoint_numbers (const char *, gdb::function_view); =20 -static void breakpoint_re_set_default (code_breakpoint *); - static void create_sals_from_location_spec_default (location_spec *locspec, linespec_result *canonical); @@ -11515,7 +11513,7 @@ code_breakpoint::re_set () return; } =20 - breakpoint_re_set_default (this); + re_set_default (); } =20 int @@ -11951,7 +11949,7 @@ tracepoint_probe_create_sals_from_location_spec void dprintf_breakpoint::re_set () { - breakpoint_re_set_default (this); + re_set_default (); =20 /* extra_string should never be non-NULL for dprintf. */ gdb_assert (extra_string !=3D NULL); @@ -12723,28 +12721,28 @@ location_spec_to_sals (struct breakpoint *b, loca= tion_spec *locspec, breakpoints. Reevaluate the breakpoint and recreate its locations. */ =20 -static void -breakpoint_re_set_default (code_breakpoint *b) +void +code_breakpoint::re_set_default () { struct program_space *filter_pspace =3D current_program_space; std::vector expanded, expanded_end; =20 int found; std::vector sals - =3D location_spec_to_sals (b, b->locspec.get (), filter_pspace, &found= ); + =3D location_spec_to_sals (this, locspec.get (), filter_pspace, &found= ); if (found) expanded =3D std::move (sals); =20 - if (b->locspec_range_end !=3D nullptr) + if (locspec_range_end !=3D nullptr) { std::vector sals_end - =3D location_spec_to_sals (b, b->locspec_range_end.get (), + =3D location_spec_to_sals (this, locspec_range_end.get (), filter_pspace, &found); if (found) expanded_end =3D std::move (sals_end); } =20 - update_breakpoint_locations (b, filter_pspace, expanded, expanded_end); + update_breakpoint_locations (this, filter_pspace, expanded, expanded_end= ); } =20 /* Default method for creating SALs from an address string. It basically diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index 4c62f9d46fc..5316d193cc5 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -886,6 +886,11 @@ struct code_breakpoint : public breakpoint std::vector decode_location_spec (struct location_spec *locspec, struct program_space *search_pspace) override; + +protected: + + /* Helper method that does the basic work of re_set. */ + void re_set_default (); }; =20 /* An instance of this type is used to represent a watchpoint,