This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 1/4] gdb/riscv: Make some target description functions constant
- From: Andrew Burgess <andrew dot burgess at embecosm dot com>
- To: gdb-patches at sourceware dot org
- Cc: jimw at sifive dot com, palmer at sifive dot com, jhb at FreeBSD dot org, Andrew Burgess <andrew dot burgess at embecosm dot com>
- Date: Thu, 29 Nov 2018 16:48:10 +0000
- Subject: [PATCH 1/4] gdb/riscv: Make some target description functions constant
- References: <cover.1543509416.git.andrew.burgess@embecosm.com>
- References: <CAFyWVabMg7KYrE64GBz2qLcNJob=zOJLjWg0cFz1De-mRFoM+A@mail.gmail.com> <cover.1543509416.git.andrew.burgess@embecosm.com>
Makes more of the interface related to fetching target descriptions
constant.
gdb/ChangeLog:
* arch/riscv.h (riscv_create_target_description): Make return type
const.
* arch/riscv.c (riscv_create_target_description): Likewise.
* riscv-tdep.c (riscv_find_default_target_description): Likewise.
---
gdb/ChangeLog | 7 +++++++
gdb/arch/riscv.c | 2 +-
gdb/arch/riscv.h | 2 +-
gdb/riscv-tdep.c | 2 +-
4 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/gdb/arch/riscv.c b/gdb/arch/riscv.c
index ca2238d5d70..cb715fabb1f 100644
--- a/gdb/arch/riscv.c
+++ b/gdb/arch/riscv.c
@@ -26,7 +26,7 @@
/* See arch/riscv.h. */
-target_desc *
+const target_desc *
riscv_create_target_description (struct riscv_gdbarch_features features)
{
target_desc *tdesc = allocate_target_description ();
diff --git a/gdb/arch/riscv.h b/gdb/arch/riscv.h
index 007944019a9..ec4d5f39525 100644
--- a/gdb/arch/riscv.h
+++ b/gdb/arch/riscv.h
@@ -58,7 +58,7 @@ struct riscv_gdbarch_features
/* Create and return a target description that is compatible with
FEATURES. */
-target_desc *riscv_create_target_description
+const target_desc *riscv_create_target_description
(struct riscv_gdbarch_features features);
#endif /* ARCH_RISCV_H */
diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c
index 5965a594440..d66fe5c8793 100644
--- a/gdb/riscv-tdep.c
+++ b/gdb/riscv-tdep.c
@@ -2793,7 +2793,7 @@ static const struct frame_unwind riscv_frame_unwind =
specifically the bfd object being executed, to guide the selection of a
suitable default target description. */
-static struct target_desc *
+static const struct target_desc *
riscv_find_default_target_description (const struct gdbarch_info info)
{
struct riscv_gdbarch_features features;
--
2.14.5