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

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