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] Move decode_location_spec to code_breakpoint
Date: Sun, 14 Aug 2022 13:48:04 +0000 (GMT)	[thread overview]
Message-ID: <20220814134804.E9FE83858287@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=aef4b7a5cc7ba4fb681a0675529000d91dc0aa72

commit aef4b7a5cc7ba4fb681a0675529000d91dc0aa72
Author: Tom Tromey <tom@tromey.com>
Date:   Sat May 21 10:17:38 2022 -0600

    Move decode_location_spec to code_breakpoint
    
    breakpoint::decode_location_spec just asserts if called.  It turned
    out to be relatively easy to remove this method from breakpoint and
    instead move the base implementation to code_breakpoint.

Diff:
---
 gdb/breakpoint.c |  7 -------
 gdb/breakpoint.h | 23 ++++++++++-------------
 2 files changed, 10 insertions(+), 20 deletions(-)

diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index b24fbd1fe36..2fe74ea0d3a 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -11493,13 +11493,6 @@ breakpoint::print_recreate (struct ui_file *fp) const
   internal_error_pure_virtual_called ();
 }
 
-std::vector<symtab_and_line>
-breakpoint::decode_location_spec (location_spec *locspec,
-				  program_space *search_pspace)
-{
-  internal_error_pure_virtual_called ();
-}
-
 /* Default breakpoint_ops methods.  */
 
 void
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
index e919fe6f0d2..aaf7549b660 100644
--- a/gdb/breakpoint.h
+++ b/gdb/breakpoint.h
@@ -710,16 +710,6 @@ struct breakpoint
   /* Print to FP the CLI command that recreates this breakpoint.  */
   virtual void print_recreate (struct ui_file *fp) const;
 
-  /* Given the location spec (second parameter), this method decodes
-     it and returns the SAL locations related to it.  For ordinary
-     breakpoints, it calls `decode_line_full'.  If SEARCH_PSPACE is
-     not NULL, symbol search is restricted to just that program space.
-
-     This function is called inside `location_spec_to_sals'.  */
-  virtual std::vector<symtab_and_line> decode_location_spec
-    (location_spec *locspec,
-     struct program_space *search_pspace);
-
   /* Return true if this breakpoint explains a signal.  See
      bpstat_explains_signal.  */
   virtual bool explains_signal (enum gdb_signal)
@@ -883,12 +873,19 @@ struct code_breakpoint : public breakpoint
 		      const address_space *aspace,
 		      CORE_ADDR bp_addr,
 		      const target_waitstatus &ws) override;
-  std::vector<symtab_and_line> decode_location_spec
-       (struct location_spec *locspec,
-	struct program_space *search_pspace) override;
 
 protected:
 
+  /* Given the location spec, this method decodes it and returns the
+     SAL locations related to it.  For ordinary breakpoints, it calls
+     `decode_line_full'.  If SEARCH_PSPACE is not NULL, symbol search
+     is restricted to just that program space.
+
+     This function is called inside `location_spec_to_sals'.  */
+  virtual std::vector<symtab_and_line> decode_location_spec
+    (location_spec *locspec,
+     struct program_space *search_pspace);
+
   /* Helper method that does the basic work of re_set.  */
   void re_set_default ();


                 reply	other threads:[~2022-08-14 13:48 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=20220814134804.E9FE83858287@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: link
Be 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).