public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Philipp Rudo <prudo@linux.vnet.ibm.com>
To: gdb-patches@sourceware.org
Cc: Andreas Arnez <arnez@linux.vnet.ibm.com>,
	       Ulrich Weigand <uweigand@de.ibm.com>,
	Yao Qi <qiyaoltc@gmail.com>
Subject: [PATCH v4 04/11] s390: gdbarch_tdep add field tdesc
Date: Tue, 09 Jan 2018 12:01:00 -0000	[thread overview]
Message-ID: <20180109120144.93854-5-prudo@linux.vnet.ibm.com> (raw)
In-Reply-To: <20180109120144.93854-1-prudo@linux.vnet.ibm.com>

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.
---
 gdb/s390-linux-tdep.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gdb/s390-linux-tdep.c b/gdb/s390-linux-tdep.c
index 203c84fb25..bc439f0ea8 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;
 
@@ -7816,6 +7819,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;
 
@@ -7876,6 +7881,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))
@@ -8138,7 +8144,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.  */
-- 
2.13.5

  parent reply	other threads:[~2018-01-09 12:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-09 12:01 [PATCH v4 00/11] Split up s390-linux-tdep.c Philipp Rudo
2018-01-09 12:01 ` [PATCH v4 03/11] s390: gdbarch_tdep.have_* int -> bool Philipp Rudo
2018-01-09 12:01 ` Philipp Rudo [this message]
2018-01-09 12:02 ` [PATCH v4 06/11] s390: if -> gdb_assert for tdesc_has_registers check Philipp Rudo
2018-01-09 12:02 ` [PATCH v4 10/11] s390: Move record-replay to s390-tdep Philipp Rudo
2018-01-09 12:02 ` [PATCH v4 09/11] s390: Split up s390-linux-tdep.c into two files Philipp Rudo
2018-01-09 12:02 ` [PATCH v4 08/11] s390: gdbarch_tdep add hook for syscall record Philipp Rudo
2018-01-09 12:02 ` [PATCH v4 01/11] s390: Remove duplicate checks for cached gdbarch at init Philipp Rudo
2018-01-09 12:02 ` [PATCH v4 07/11] s390: Hook s390 into OSABI mechanism Philipp Rudo
2018-01-09 12:02 ` [PATCH v4 05/11] s390: Move tdesc validation to separate function Philipp Rudo
2018-01-09 12:02 ` [PATCH v4 11/11] s390: Clean up s390-linux-tdep.c Philipp Rudo
2018-01-09 14:09 ` [PATCH v4 00/11] Split " Ulrich Weigand
2018-01-23 12:53   ` Andreas Arnez
2018-01-10 13:10 ` [PATCH v4 02/11] s390: Allocate gdbarch & tdep at start of gdbarch_init Philipp Rudo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180109120144.93854-5-prudo@linux.vnet.ibm.com \
    --to=prudo@linux.vnet.ibm.com \
    --cc=arnez@linux.vnet.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=qiyaoltc@gmail.com \
    --cc=uweigand@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).