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] s390: gdbarch_tdep add field tdesc


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

commit 095085d8473689d86e00cd7d9a63680ca8faeda6
Author: Philipp Rudo <prudo@linux.vnet.ibm.com>
Date:   Tue Jan 23 13:37:42 2018 +0100

    s390: gdbarch_tdep add field tdesc
    
    Add a field for the target description to gdbarch_tdep.  This will later be
    needed to pass the 'correct' target description from osabi_init to
    gdbarch_init.  Unfortunately this cannot be done using gdbarch_info as it
    is only passed by copy, not reference.
    
    gdb/ChangeLog:
    
    	* s390-linux-tdep.c (gdbarch_tdep) <tdesc>: New field.
    	(s390_gdbarch_tdep_alloc): Adjust.
    	(s390_gdbarch_init): Adjust.

Diff:
---
 gdb/ChangeLog         | 6 ++++++
 gdb/s390-linux-tdep.c | 8 +++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 52394ab..e823cc4 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
 2018-01-23  Philipp Rudo  <prudo@linux.vnet.ibm.com>
 
+	* s390-linux-tdep.c (gdbarch_tdep) <tdesc>: New field.
+	(s390_gdbarch_tdep_alloc): Adjust.
+	(s390_gdbarch_init): Adjust.
+
+2018-01-23  Philipp Rudo  <prudo@linux.vnet.ibm.com>
+
 	* s390-linux-tdep.c (gdbarch_tdep) <have_linux_v1, have_linux_v2>
 	<have_tdb>: Change type to bool.
 	(s390_gdbarch_tdep_alloc): Adjust.
diff --git a/gdb/s390-linux-tdep.c b/gdb/s390-linux-tdep.c
index 7d41dfe..557eac3 100644
--- a/gdb/s390-linux-tdep.c
+++ b/gdb/s390-linux-tdep.c
@@ -100,6 +100,9 @@ enum s390_vector_abi_kind
 
 struct gdbarch_tdep
 {
+  /* Target description.  */
+  const struct target_desc *tdesc;
+
   /* ABI version.  */
   enum s390_abi_kind abi;
 
@@ -7815,6 +7818,8 @@ s390_gdbarch_tdep_alloc ()
 {
   struct gdbarch_tdep *tdep = XCNEW (struct gdbarch_tdep);
 
+  tdep->tdesc = NULL;
+
   tdep->abi = ABI_NONE;
   tdep->vector_abi = S390_VECTOR_ABI_NONE;
 
@@ -7875,6 +7880,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
       else
 	tdesc = tdesc_s390x_linux64;
     }
+  tdep->tdesc = tdesc;
 
   /* Check any target description for validity.  */
   if (tdesc_has_registers (tdesc))
@@ -8137,7 +8143,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_ax_pseudo_register_push_stack
       (gdbarch, s390_ax_pseudo_register_push_stack);
   set_gdbarch_gen_return_address (gdbarch, s390_gen_return_address);
-  tdesc_use_registers (gdbarch, tdesc, tdesc_data);
+  tdesc_use_registers (gdbarch, tdep->tdesc, tdesc_data);
   set_gdbarch_register_name (gdbarch, s390_register_name);
 
   /* Assign pseudo register numbers.  */


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