This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] gdb/riscv: Make some target description functions constant


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

commit 0ff80bf7b9901b5e3c6805b99d30fd555f512d69
Author: Andrew Burgess <andrew.burgess@embecosm.com>
Date:   Thu Nov 29 15:38:29 2018 +0000

    gdb/riscv: Make some target description functions constant
    
    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.

Diff:
---
 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/ChangeLog b/gdb/ChangeLog
index f899248..72c2ee1 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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>
diff --git a/gdb/arch/riscv.c b/gdb/arch/riscv.c
index ca2238d..cb715fa 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 0079440..ec4d5f3 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 5965a59..d66fe5c 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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]