[06/17,PowerPC] Add record/replay support for PPR and DSCR

Message ID 20180713135226.2321-7-pedromfc@linux.ibm.com
State New, archived
Headers

Commit Message

Pedro Franco de Carvalho July 13, 2018, 1:52 p.m. UTC
  This patch changes ppc_process_record_op31 to handle instructions that
change PPR and DSCR.

gdb/ChangeLog:
YYYY-MM-DD  Pedro Franco de Carvalho  <pedromfc@linux.ibm.com>

	* rs6000-tdep.c (ppc_process_record_op31): Record changes to PPR
	and DSCR.
---
 gdb/rs6000-tdep.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
  

Patch

diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 294d6ea702..f390370455 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -4428,6 +4428,16 @@  ppc_process_record_op31 (struct gdbarch *gdbarch, struct regcache *regcache,
     case 476:		/* NAND */
     case 412:		/* OR with Complement */
     case 444:		/* OR */
+      /* Or Rx,Rx,Rx alters PRI in PPR.  */
+      if (tdep->ppc_ppr_regnum >= 0
+	  && (PPC_RS (insn) == PPC_RA (insn))
+	  && (PPC_RA (insn) == PPC_RB (insn))
+	  && !PPC_RC (insn))
+	{
+	  record_full_arch_list_add_reg (regcache, tdep->ppc_ppr_regnum);
+	  return 0;
+	}
+      /* FALL-THROUGH */
     case 536:		/* Shift Right Word */
     case 539:		/* Shift Right Doubleword */
     case 922:		/* Extend Sign Halfword */
@@ -4646,6 +4656,10 @@  ppc_process_record_op31 (struct gdbarch *gdbarch, struct regcache *regcache,
 	case 1:			/* XER */
 	  record_full_arch_list_add_reg (regcache, tdep->ppc_xer_regnum);
 	  return 0;
+	case 3:			/* DSCR */
+	  if (tdep->ppc_dscr_regnum >= 0)
+	    record_full_arch_list_add_reg (regcache, tdep->ppc_dscr_regnum);
+	  return 0;
 	case 8:			/* LR */
 	  record_full_arch_list_add_reg (regcache, tdep->ppc_lr_regnum);
 	  return 0;
@@ -4655,6 +4669,11 @@  ppc_process_record_op31 (struct gdbarch *gdbarch, struct regcache *regcache,
 	case 256:		/* VRSAVE */
 	  record_full_arch_list_add_reg (regcache, tdep->ppc_vrsave_regnum);
 	  return 0;
+	case 896:
+	case 898:		/* PPR */
+	  if (tdep->ppc_ppr_regnum >= 0)
+	    record_full_arch_list_add_reg (regcache, tdep->ppc_ppr_regnum);
+	  return 0;
 	}
 
       goto UNKNOWN_OP;