gdb/s390: Correct recording of "store on condition" insns
authorAndreas Arnez <arnez@linux.ibm.com>
Thu, 19 Nov 2020 18:10:58 +0000 (19:10 +0100)
committerAndreas Arnez <arnez@linux.ibm.com>
Thu, 19 Nov 2020 18:10:58 +0000 (19:10 +0100)
The "store on condition" instructions STOC, STOCG, and STOCFH are recorded
as if their instruction formats resembled that of STG.  This is wrong,
usually resulting in "failed to record execution log" errors when trying
to record code with any of these instructions.

This patch fixes the recording of these instructions.

gdb/ChangeLog:

PR tdep/26916
* s390-tdep.c (s390_process_record): Fix recording of STOC, STOCG,
and STOCFH.

gdb/ChangeLog
gdb/s390-tdep.c

index 5b4844250239f65e953d117d50b7b4372a40a37e..45c92748ec945ba7821cc768aab9067da11e5ffd 100644 (file)
@@ -1,3 +1,9 @@
+2020-11-19  Andreas Arnez  <arnez@linux.ibm.com>
+
+       PR tdep/26916
+       * s390-tdep.c (s390_process_record): Fix recording of STOC, STOCG,
+       and STOCFH.
+
 2020-11-19  Simon Marchi  <simon.marchi@polymtl.ca>
 
        * f-lang.c (fortran_value_subarray): Use plongest/pulongest.
index ce013458e890d1b713a4c4d16e68f9a63d421621..247adcd6e2749901bc6ca4e436f330452df78470 100644 (file)
@@ -5370,7 +5370,6 @@ ex:
        case 0xe325: /* NTSTG - nontransactional store */
        case 0xe326: /* CVDY - convert to decimal */
        case 0xe32f: /* STRVG - store reversed */
-       case 0xebe3: /* STOCG - store on condition */
        case 0xed67: /* STDY - store */
          oaddr = s390_record_calc_disp (gdbarch, regcache, inib[3], insn[1], ibyte[4]);
          if (record_full_arch_list_add_mem (oaddr, 8))
@@ -5399,8 +5398,6 @@ ex:
        case 0xe33e: /* STRV - store reversed */
        case 0xe350: /* STY - store */
        case 0xe3cb: /* STFH - store high */
-       case 0xebe1: /* STOCFH - store high on condition */
-       case 0xebf3: /* STOC - store on condition */
        case 0xed66: /* STEY - store */
          oaddr = s390_record_calc_disp (gdbarch, regcache, inib[3], insn[1], ibyte[4]);
          if (record_full_arch_list_add_mem (oaddr, 4))
@@ -6113,6 +6110,20 @@ ex:
 
        /* 0xeb9c-0xebbf undefined */
        /* 0xebc1-0xebdb undefined */
+
+       case 0xebe1: /* STOCFH - store high on condition */
+       case 0xebf3: /* STOC - store on condition */
+         oaddr = s390_record_calc_disp (gdbarch, regcache, 0, insn[1], ibyte[4]);
+         if (record_full_arch_list_add_mem (oaddr, 4))
+           return -1;
+         break;
+
+       case 0xebe3: /* STOCG - store on condition */
+         oaddr = s390_record_calc_disp (gdbarch, regcache, 0, insn[1], ibyte[4]);
+         if (record_full_arch_list_add_mem (oaddr, 8))
+           return -1;
+         break;
+
        /* 0xebe5 undefined */
        /* 0xebe9 undefined */
        /* 0xebeb-0xebf1 undefined */
This page took 0.033657 seconds and 4 git commands to generate.