From b3d5660a7adf2e1e3846976ff4346c6a9b323978 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sat, 21 May 2022 09:57:43 -0600 Subject: [PATCH] Change breakpoint_re_set_default to a method breakpoint_re_set_default is only ever called from breakpoint re_set methods, so make it a protected method on code_breakpoint. --- 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); -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; } - breakpoint_re_set_default (this); + re_set_default (); } 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 (); /* extra_string should never be non-NULL for dprintf. */ gdb_assert (extra_string != NULL); @@ -12723,28 +12721,28 @@ location_spec_to_sals (struct breakpoint *b, location_spec *locspec, breakpoints. Reevaluate the breakpoint and recreate its locations. */ -static void -breakpoint_re_set_default (code_breakpoint *b) +void +code_breakpoint::re_set_default () { struct program_space *filter_pspace = current_program_space; std::vector expanded, expanded_end; int found; std::vector sals - = location_spec_to_sals (b, b->locspec.get (), filter_pspace, &found); + = location_spec_to_sals (this, locspec.get (), filter_pspace, &found); if (found) expanded = std::move (sals); - if (b->locspec_range_end != nullptr) + if (locspec_range_end != nullptr) { std::vector sals_end - = location_spec_to_sals (b, b->locspec_range_end.get (), + = location_spec_to_sals (this, locspec_range_end.get (), filter_pspace, &found); if (found) expanded_end = std::move (sals_end); } - update_breakpoint_locations (b, filter_pspace, expanded, expanded_end); + update_breakpoint_locations (this, filter_pspace, expanded, expanded_end); } /* 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 (); }; /* An instance of this type is used to represent a watchpoint, -- 2.30.2