public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Change breakpoint_re_set_default to a method
@ 2022-08-14 13:47 Tom Tromey
0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2022-08-14 13:47 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b3d5660a7adf2e1e3846976ff4346c6a9b323978
commit b3d5660a7adf2e1e3846976ff4346c6a9b323978
Author: Tom Tromey <tom@tromey.com>
Date: Sat May 21 09:57:43 2022 -0600
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.
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<void (breakpoint *)>);
-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<symtab_and_line> expanded, expanded_end;
int found;
std::vector<symtab_and_line> 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<symtab_and_line> 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<symtab_and_line> 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,
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-08-14 13:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-14 13:47 [binutils-gdb] Change breakpoint_re_set_default to a method Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).