public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Marcin Kościelnicki" <koriakin@0x04.net>
To: gdb-patches@sourceware.org
Cc: "Marcin Kościelnicki" <koriakin@0x04.net>
Subject: [PATCH 1/8] gdb: Add ax_pseudo_register_collect for powerpc.
Date: Sun, 06 Mar 2016 16:35:00 -0000	[thread overview]
Message-ID: <1457282097-7201-2-git-send-email-koriakin@0x04.net> (raw)
In-Reply-To: <1457282097-7201-1-git-send-email-koriakin@0x04.net>

gdb/ChangeLog:

	* rs6000-tdep.c (rs6000_ax_pseudo_register_collect): New function.
	(rs6000_gdbarch_init): Wire in the above.
---
 gdb/ChangeLog     |  5 +++++
 gdb/rs6000-tdep.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b84326c..f0b6112 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2016-03-05  Marcin Kościelnicki  <koriakin@0x04.net>
+
+	* rs6000-tdep.c (rs6000_ax_pseudo_register_collect): New function.
+	(rs6000_gdbarch_init): Wire in the above.
+
 2016-03-05  Pitchumani Sivanupandi  <pitchumani.s@atmel.com>
 
 	* avr-tdep.c (AVR_LAST_ARG_REGNUM): Define.
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index c2b6638..3bcd205 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -2919,6 +2919,50 @@ rs6000_pseudo_register_write (struct gdbarch *gdbarch,
 		    gdbarch_register_name (gdbarch, reg_nr), reg_nr);
 }
 
+static int
+rs6000_ax_pseudo_register_collect (struct gdbarch *gdbarch,
+				   struct agent_expr *ax, int reg_nr)
+{
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+  if (IS_SPE_PSEUDOREG (tdep, reg_nr))
+    {
+      int reg_index = reg_nr - tdep->ppc_ev0_regnum;
+      ax_reg_mask (ax, tdep->ppc_gp0_regnum + reg_index);
+      ax_reg_mask (ax, tdep->ppc_ev0_upper_regnum + reg_index);
+    }
+  else if (IS_DFP_PSEUDOREG (tdep, reg_nr))
+    {
+      int reg_index = reg_nr - tdep->ppc_dl0_regnum;
+      ax_reg_mask (ax, tdep->ppc_fp0_regnum + 2 * reg_index);
+      ax_reg_mask (ax, tdep->ppc_fp0_regnum + 2 * reg_index + 1);
+    }
+  else if (IS_VSX_PSEUDOREG (tdep, reg_nr))
+    {
+      int reg_index = reg_nr - tdep->ppc_vsr0_regnum;
+      if (reg_index > 31)
+        {
+          ax_reg_mask (ax, tdep->ppc_vr0_regnum + reg_index - 32);
+	}
+      else
+        {
+          ax_reg_mask (ax, tdep->ppc_fp0_regnum + reg_index);
+          ax_reg_mask (ax, tdep->ppc_vsr0_upper_regnum + reg_index);
+        }
+    }
+  else if (IS_EFP_PSEUDOREG (tdep, reg_nr))
+    {
+      int reg_index = reg_nr - tdep->ppc_efpr0_regnum;
+      ax_reg_mask (ax, tdep->ppc_vr0_regnum + reg_index);
+    }
+  else
+    internal_error (__FILE__, __LINE__,
+		    _("rs6000_pseudo_register_collect: "
+		    "called on unexpected register '%s' (%d)"),
+		    gdbarch_register_name (gdbarch, reg_nr), reg_nr);
+  return 0;
+}
+
+
 /* Convert a DBX STABS register number to a GDB register number.  */
 static int
 rs6000_stab_reg_to_regnum (struct gdbarch *gdbarch, int num)
@@ -5924,6 +5968,8 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
       set_gdbarch_pseudo_register_read (gdbarch, rs6000_pseudo_register_read);
       set_gdbarch_pseudo_register_write (gdbarch,
 					 rs6000_pseudo_register_write);
+      set_gdbarch_ax_pseudo_register_collect (gdbarch,
+	      rs6000_ax_pseudo_register_collect);
     }
 
   set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1);
-- 
2.7.2

  parent reply	other threads:[~2016-03-06 16:35 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-06 16:35 [PATCH 0/8] Add regular tracepoint support " Marcin Kościelnicki
2016-03-06 16:35 ` [PATCH 8/8] gdb: Add " Marcin Kościelnicki
2016-03-09 17:33   ` Ulrich Weigand
2016-03-09 17:48     ` Marcin Kościelnicki
2016-03-06 16:35 ` [PATCH 7/8] gdb.trace/entry-values.exp: Fixes for powerpc64 Marcin Kościelnicki
2016-03-09 17:29   ` Ulrich Weigand
2016-03-06 16:35 ` [PATCH 6/8] gdb.trace/tfind.exp: Force call via global entry point on ppc64le Marcin Kościelnicki
2016-03-09 17:26   ` Ulrich Weigand
2016-03-06 16:35 ` [PATCH 4/8] gdb.trace: Use manually-defined start labels in unavailable-dwarf-piece.exp Marcin Kościelnicki
2016-03-09 17:24   ` Ulrich Weigand
2016-03-09 17:27     ` Marcin Kościelnicki
2016-03-09 17:35       ` Ulrich Weigand
2016-03-06 16:35 ` [PATCH 2/8] gdb: Add gen_return_address for powerpc Marcin Kościelnicki
2016-03-09 17:20   ` Ulrich Weigand
2016-03-06 16:35 ` Marcin Kościelnicki [this message]
2016-03-09 17:20   ` [PATCH 1/8] gdb: Add ax_pseudo_register_collect " Ulrich Weigand
2016-03-06 16:40 ` [PATCH 3/8] gdb/rs6000: Read backchain as unsigned Marcin Kościelnicki
2016-03-09 17:21   ` Ulrich Weigand
2016-03-06 16:40 ` [PATCH 5/8] gdb.trace/change-loc.exp: Don't depend on tracepoint ordering Marcin Kościelnicki
2016-03-09 17:25   ` Ulrich Weigand

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=1457282097-7201-2-git-send-email-koriakin@0x04.net \
    --to=koriakin@0x04.net \
    --cc=gdb-patches@sourceware.org \
    /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).