Blame SOURCES/gdb-rhbz1903375-s390x-store-on-condition.patch

0efd7d
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
0efd7d
From: Andreas Arnez <arnez@linux.ibm.com>
0efd7d
Date: Thu, 19 Nov 2020 19:10:58 +0100
0efd7d
Subject: gdb-rhbz1903375-s390x-store-on-condition.patch
0efd7d
0efd7d
;; Backport of "Correct recording of 'store on condition' insns"
0efd7d
;; Andreas Arnaz (RH BZ 1903374)
0efd7d
0efd7d
gdb/s390: Correct recording of "store on condition" insns
0efd7d
0efd7d
The "store on condition" instructions STOC, STOCG, and STOCFH are recorded
0efd7d
as if their instruction formats resembled that of STG.  This is wrong,
0efd7d
usually resulting in "failed to record execution log" errors when trying
0efd7d
to record code with any of these instructions.
0efd7d
0efd7d
This patch fixes the recording of these instructions.
0efd7d
0efd7d
gdb/ChangeLog:
0efd7d
0efd7d
	PR tdep/26916
0efd7d
	* s390-tdep.c (s390_process_record): Fix recording of STOC, STOCG,
0efd7d
	and STOCFH.
0efd7d
0efd7d
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
0efd7d
--- a/gdb/s390-tdep.c
0efd7d
+++ b/gdb/s390-tdep.c
0efd7d
@@ -5380,7 +5380,6 @@ ex:
0efd7d
 	case 0xe325: /* NTSTG - nontransactional store */
0efd7d
 	case 0xe326: /* CVDY - convert to decimal */
0efd7d
 	case 0xe32f: /* STRVG - store reversed */
0efd7d
-	case 0xebe3: /* STOCG - store on condition */
0efd7d
 	case 0xed67: /* STDY - store */
0efd7d
 	  oaddr = s390_record_calc_disp (gdbarch, regcache, inib[3], insn[1], ibyte[4]);
0efd7d
 	  if (record_full_arch_list_add_mem (oaddr, 8))
0efd7d
@@ -5409,8 +5408,6 @@ ex:
0efd7d
 	case 0xe33e: /* STRV - store reversed */
0efd7d
 	case 0xe350: /* STY - store */
0efd7d
 	case 0xe3cb: /* STFH - store high */
0efd7d
-	case 0xebe1: /* STOCFH - store high on condition */
0efd7d
-	case 0xebf3: /* STOC - store on condition */
0efd7d
 	case 0xed66: /* STEY - store */
0efd7d
 	  oaddr = s390_record_calc_disp (gdbarch, regcache, inib[3], insn[1], ibyte[4]);
0efd7d
 	  if (record_full_arch_list_add_mem (oaddr, 4))
0efd7d
@@ -6123,6 +6120,20 @@ ex:
0efd7d
 
0efd7d
 	/* 0xeb9c-0xebbf undefined */
0efd7d
 	/* 0xebc1-0xebdb undefined */
0efd7d
+
0efd7d
+	case 0xebe1: /* STOCFH - store high on condition */
0efd7d
+	case 0xebf3: /* STOC - store on condition */
0efd7d
+	  oaddr = s390_record_calc_disp (gdbarch, regcache, 0, insn[1], ibyte[4]);
0efd7d
+	  if (record_full_arch_list_add_mem (oaddr, 4))
0efd7d
+	    return -1;
0efd7d
+	  break;
0efd7d
+
0efd7d
+	case 0xebe3: /* STOCG - store on condition */
0efd7d
+	  oaddr = s390_record_calc_disp (gdbarch, regcache, 0, insn[1], ibyte[4]);
0efd7d
+	  if (record_full_arch_list_add_mem (oaddr, 8))
0efd7d
+	    return -1;
0efd7d
+	  break;
0efd7d
+
0efd7d
 	/* 0xebe5 undefined */
0efd7d
 	/* 0xebe9 undefined */
0efd7d
 	/* 0xebeb-0xebf1 undefined */