gdb/riscv: Make some target description functions constant
authorAndrew Burgess <andrew.burgess@embecosm.com>
Thu, 29 Nov 2018 15:38:29 +0000 (15:38 +0000)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Fri, 30 Nov 2018 18:13:42 +0000 (18:13 +0000)
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
gdb/arch/riscv.c
gdb/arch/riscv.h
gdb/riscv-tdep.c

index f8992485700bf347ef0d6dbb018238a154654499..72c2ee16ca444779619e4ba92da65e1ed1ad9fc6 100644 (file)
@@ -1,3 +1,10 @@
+2018-11-30  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * 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.
+
 2018-11-30  Jan Kratochvil  <jan.kratochvil@redhat.com>
            Keith Seitz  <keiths@redhat.com>
            Tom Tromey  <tom@tromey.com>
index ca2238d5d705f05a38061a7f4e5c2428219d3202..cb715fabb1f48b459a90728ecb36e2d37fc43304 100644 (file)
@@ -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 ();
index 007944019a974401fc97e4fde67b1b435a43ef60..ec4d5f3952578d8b40e0637e034f6c74438e9e45 100644 (file)
@@ -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 */
index 5965a59444058236a7bf0cd98e057dc0ffcf68a9..d66fe5c87935788afd0ced0fd438cfcaf79fb778 100644 (file)
@@ -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;