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] Constify breakpoint_ops
Date: Fri, 29 Apr 2022 22:24:41 +0000 (GMT)	[thread overview]
Message-ID: <20220429222441.E4678385842B@sourceware.org> (raw)

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

commit a678887d09c00cecb9aec39cd15f8c65e603078e
Author: Tom Tromey <tom@tromey.com>
Date:   Sun Jan 16 20:05:18 2022 -0700

    Constify breakpoint_ops
    
    Now that all breakpoint_ops are statically initialized, they can all
    be made const.

Diff:
---
 gdb/breakpoint.c | 8 ++++----
 gdb/breakpoint.h | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index b6541b5bdb7..c3568883ea9 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -243,21 +243,21 @@ static void tracepoint_probe_create_sals_from_location
       struct linespec_result *canonical,
       enum bptype type_wanted);
 
-struct breakpoint_ops base_breakpoint_ops =
+const struct breakpoint_ops base_breakpoint_ops =
 {
   create_sals_from_location_default,
   create_breakpoints_sal_default,
 };
 
 /* Breakpoints set on probes.  */
-static struct breakpoint_ops bkpt_probe_breakpoint_ops =
+static const struct breakpoint_ops bkpt_probe_breakpoint_ops =
 {
   bkpt_probe_create_sals_from_location,
   create_breakpoints_sal_default,
 };
 
 /* Tracepoints set on probes.  */
-static struct breakpoint_ops tracepoint_probe_breakpoint_ops =
+static const struct breakpoint_ops tracepoint_probe_breakpoint_ops =
 {
   tracepoint_probe_create_sals_from_location,
   create_breakpoints_sal_default,
@@ -13735,7 +13735,7 @@ ftrace_command (const char *arg, int from_tty)
 static void
 strace_command (const char *arg, int from_tty)
 {
-  struct breakpoint_ops *ops;
+  const struct breakpoint_ops *ops;
   event_location_up location;
   enum bptype type;
 
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
index 2d4a89fb3e6..94ae70698a4 100644
--- a/gdb/breakpoint.h
+++ b/gdb/breakpoint.h
@@ -1398,7 +1398,7 @@ extern void awatch_command_wrapper (const char *, int, bool);
 extern void rwatch_command_wrapper (const char *, int, bool);
 extern void tbreak_command (const char *, int);
 
-extern struct breakpoint_ops base_breakpoint_ops;
+extern const struct breakpoint_ops base_breakpoint_ops;
 
 /* Arguments to pass as context to some catch command handlers.  */
 #define CATCH_PERMANENT ((void *) (uintptr_t) 0)


                 reply	other threads:[~2022-04-29 22:24 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=20220429222441.E4678385842B@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).