public inbox for gdb-cvs@sourceware.org help / color / mirror / Atom feed
From: Tom Tromey <tromey@sourceware.org> To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Change breakpoint_re_set_default to a method Date: Sun, 14 Aug 2022 13:47:54 +0000 (GMT) [thread overview] Message-ID: <20220814134754.C627E3858D1E@sourceware.org> (raw) 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,
reply other threads:[~2022-08-14 13:47 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220814134754.C627E3858D1E@sourceware.org \ --to=tromey@sourceware.org \ --cc=gdb-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).