From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id E4678385842B; Fri, 29 Apr 2022 22:24:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E4678385842B Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Constify breakpoint_ops X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 8613a476b198e67ecd645cf74befe9a0dad255b3 X-Git-Newrev: a678887d09c00cecb9aec39cd15f8c65e603078e Message-Id: <20220429222441.E4678385842B@sourceware.org> Date: Fri, 29 Apr 2022 22:24:41 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2022 22:24:42 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Da678887d09c0= 0cecb9aec39cd15f8c65e603078e commit a678887d09c00cecb9aec39cd15f8c65e603078e Author: Tom Tromey Date: Sun Jan 16 20:05:18 2022 -0700 Constify breakpoint_ops =20 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); =20 -struct breakpoint_ops base_breakpoint_ops =3D +const struct breakpoint_ops base_breakpoint_ops =3D { create_sals_from_location_default, create_breakpoints_sal_default, }; =20 /* Breakpoints set on probes. */ -static struct breakpoint_ops bkpt_probe_breakpoint_ops =3D +static const struct breakpoint_ops bkpt_probe_breakpoint_ops =3D { bkpt_probe_create_sals_from_location, create_breakpoints_sal_default, }; =20 /* Tracepoints set on probes. */ -static struct breakpoint_ops tracepoint_probe_breakpoint_ops =3D +static const struct breakpoint_ops tracepoint_probe_breakpoint_ops =3D { 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; =20 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); =20 -extern struct breakpoint_ops base_breakpoint_ops; +extern const struct breakpoint_ops base_breakpoint_ops; =20 /* Arguments to pass as context to some catch command handlers. */ #define CATCH_PERMANENT ((void *) (uintptr_t) 0)