From d789f63ad11d589c7802074aaf05dd698d297e474685033376ec4444b35792b2 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Mon, 9 Dec 2024 14:19:58 +0000 Subject: [PATCH] - Patches added (jsc#PED-10258): * gdb-tdep-s390-add-arch15-record-replay-support.patch OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=399 --- ...390-add-arch15-record-replay-support.patch | 168 ++++++++++++++++++ gdb.changes | 8 +- gdb.spec | 2 + 3 files changed, 177 insertions(+), 1 deletion(-) create mode 100644 gdb-tdep-s390-add-arch15-record-replay-support.patch diff --git a/gdb-tdep-s390-add-arch15-record-replay-support.patch b/gdb-tdep-s390-add-arch15-record-replay-support.patch new file mode 100644 index 0000000..fcef18f --- /dev/null +++ b/gdb-tdep-s390-add-arch15-record-replay-support.patch @@ -0,0 +1,168 @@ +From 9afcf99e16a4adecc7d1a18c30bed65a29c96e52 Mon Sep 17 00:00:00 2001 +From: Andreas Arnez +Date: Tue, 19 Nov 2024 18:24:06 +0100 +Subject: [PATCH] [gdb/tdep] s390: Add arch15 record/replay support + +Enable recording of the new "arch15" instructions on z/Architecture +targets. +--- + gdb/s390-tdep.c | 78 +++++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 75 insertions(+), 3 deletions(-) + +diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c +index dcac407caef..e25bcfaf974 100644 +--- a/gdb/s390-tdep.c ++++ b/gdb/s390-tdep.c +@@ -4245,6 +4245,10 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, + case 0xb917: /* LLGTR - load logical thirty one bits */ + case 0xb91c: /* MSGFR - multiply single 64<32 */ + case 0xb946: /* BCTGR - branch on count */ ++ case 0xb968: /* CLZG - count leading zeros */ ++ case 0xb969: /* CTZG - count trailing zeros */ ++ case 0xb96c: /* BEXTG - bit extract */ ++ case 0xb96d: /* BDEPG - bit deposit */ + case 0xb984: /* LLGCR - load logical character */ + case 0xb985: /* LLGHR - load logical halfword */ + case 0xb9e2: /* LOCGR - load on condition */ +@@ -5125,7 +5129,14 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, + return -1; + break; + +- /* 0xc86-0xc8f undefined */ ++ case 0xc86: /* CAL - compare and load 32 */ ++ case 0xc87: /* CALG - compare and load 64 */ ++ case 0xc8f: /* CALGF - compare and load 64<32 */ ++ if (s390_record_gpr_g (gdbarch, regcache, inib[2])) ++ return -1; ++ if (record_full_arch_list_add_reg (regcache, S390_PSWM_REGNUM)) ++ return -1; ++ break; + + default: + goto UNKNOWN_OP; +@@ -5336,6 +5347,16 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, + case 0xe33b: /* LZRF - load and zero rightmost byte */ + case 0xe351: /* MSY - multiply single */ + case 0xe358: /* LY - load */ ++ case 0xe360: /* LXAB - load indexed address (shift 0) */ ++ case 0xe361: /* LLXAB - load logical indexed address (shift 0) */ ++ case 0xe362: /* LXAH - load indexed address (shift 1) */ ++ case 0xe363: /* LLXAH - load logical indexed address (shift 1) */ ++ case 0xe364: /* LXAF - load indexed address (shift 2) */ ++ case 0xe365: /* LLXAF - load logical indexed address (shift 2) */ ++ case 0xe366: /* LXAG - load indexed address (shift 3) */ ++ case 0xe367: /* LLXAG - load logical indexed address (shift 3) */ ++ case 0xe368: /* LXAQ - load indexed address (shift 4) */ ++ case 0xe369: /* LLXAQ - load logical indexed address (shift 4) */ + case 0xe371: /* LAY - load address */ + case 0xe373: /* ICY - insert character */ + case 0xe376: /* LB - load byte */ +@@ -5448,7 +5469,7 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, + break; + + /* 0xe35d undefined */ +- /* 0xe360-0xe36f undefined */ ++ /* 0xe36a-0xe36f undefined */ + + case 0xe372: /* STCY - store character */ + case 0xe3c3: /* STCH - store character high */ +@@ -5569,6 +5590,7 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, + case 0xe750: /* VPOPCT - vector population count */ + case 0xe752: /* VCTZ - vector count trailing zeros */ + case 0xe753: /* VCLZ - vector count leading zeros */ ++ case 0xe754: /* VGEM - vector generate element masks */ + case 0xe756: /* VLR - vector load */ + case 0xe75f: /* VSEG -vector sign extend to doubleword */ + case 0xe760: /* VMRL - vector merge low */ +@@ -5602,6 +5624,8 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, + case 0xe785: /* VBPERM - vector bit permute */ + case 0xe786: /* VSLD - vector shift left double by bit */ + case 0xe787: /* VSRD - vector shift right double by bit */ ++ case 0xe788: /* VEVAL - vector evaluate */ ++ case 0xe789: /* VBLEND - vector blend */ + case 0xe78b: /* VSTRS - vector string search */ + case 0xe78c: /* VPERM - vector permute */ + case 0xe78d: /* VSEL - vector select */ +@@ -5624,6 +5648,10 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, + case 0xe7ad: /* VMALO - vector multiply and add logical odd */ + case 0xe7ae: /* VMAE - vector multiply and add even */ + case 0xe7af: /* VMAO - vector multiply and add odd */ ++ case 0xe7b0: /* VDL - vector divide logical */ ++ case 0xe7b1: /* VRL - vector remainder logical */ ++ case 0xe7b2: /* VD - vector divide */ ++ case 0xe7b3: /* VR - vector remainder */ + case 0xe7b4: /* VGFM - vector Galois field multiply sum */ + case 0xe7b8: /* VMSL - vector multiply sum logical */ + case 0xe7b9: /* VACCC - vector add with carry compute carry */ +@@ -5799,6 +5827,8 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, + + /* 0xe747-0xe749 undefined */ + ++ case 0xe64a: /* VCVDQ - vector convert to decimal 128 bits */ ++ case 0xe64e: /* VCVBQ - vector convert to binary 128 bits */ + case 0xe651: /* VCLZDP - vector count leading zero digits */ + case 0xe654: /* VUPKZH - vector unpack zoned high */ + case 0xe658: /* VCVD - vector convert to decimal 32 bit */ +@@ -5839,6 +5869,7 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, + break; + + case 0xe65f: /* VTP - vector test decimal */ ++ case 0xe67f: /* VTZ - vector test zoned */ + /* flags + FPC */ + if (record_full_arch_list_add_reg (regcache, S390_PSWM_REGNUM)) + return -1; +@@ -5932,7 +5963,48 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, + return -1; + break; + +- /* 0xeb15-0xeb1b undefined */ ++ case 0xeb16: /* PFCR - perform functions with concurrent results */ ++ if (record_full_arch_list_add_reg (regcache, S390_PSWM_REGNUM)) ++ return -1; ++ regcache_raw_read_unsigned (regcache, S390_R0_REGNUM, &tmp); ++ oaddr = s390_record_calc_disp (gdbarch, regcache, 0, insn[1], ++ ibyte[4]); ++ { ++ uint8_t fc = tmp & 0xff; ++ if (fc == 0) /* PFCR-QAF */ ++ { ++ if (record_full_arch_list_add_mem (oaddr, 16)) ++ return -1; ++ } ++ else if (fc >= 1 && fc <= 4) ++ { ++ /* Compare and swap and double/triple store. */ ++ int bytesize = fc & 1 ? 4 : 8; ++ int startbit = fc >= 3 ? 16 : 32; ++ if (record_full_arch_list_add_reg (regcache, ++ S390_R0_REGNUM + inib[2])) ++ return -1; ++ regcache_raw_read_unsigned (regcache, ++ S390_R0_REGNUM + inib[3], &tmp); ++ for (i = startbit; i < 64; i += 16) ++ { ++ oaddr = s390_record_calc_disp (gdbarch, regcache, 0, ++ (tmp >> i) & 0xffff, 0); ++ if (record_full_arch_list_add_mem (oaddr, bytesize)) ++ return -1; ++ } ++ } ++ else ++ { ++ gdb_printf (gdb_stdlog, ++ "Warning: Unknown PFCR FC %02x at %s.\n", ++ fc, paddress (gdbarch, addr)); ++ return -1; ++ } ++ } ++ break; ++ ++ /* 0xeb17-0xeb1b undefined */ + /* 0xeb1e-0xeb1f undefined */ + /* 0xeb22 undefined */ + + +base-commit: 029bb9a91184eae765dda5220ccfb29d7d02f395 +-- +2.43.0 + diff --git a/gdb.changes b/gdb.changes index 9eafa3d..ef18b21 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,7 +1,13 @@ +------------------------------------------------------------------- +Mon Dec 9 14:09:01 UTC 2024 - Tom de Vries + +- Patches added (jsc#PED-10258): + * gdb-tdep-s390-add-arch15-record-replay-support.patch + ------------------------------------------------------------------- Mon Dec 2 16:05:47 UTC 2024 - Tom de Vries -- Patches added: +- Patches added (jsc#PED-10751): * s390-provide-ibm-z16-arch14-instruction-descriptions.patch * gdb-s390-add-arch14-record-replay-support.patch - Maintenance script qa.sh: diff --git a/gdb.spec b/gdb.spec index 7422f52..8c773e2 100644 --- a/gdb.spec +++ b/gdb.spec @@ -347,6 +347,7 @@ Patch2078: gdb-s390-add-arch14-record-replay-support.patch Patch2090: gdb-python-fix-gdb.python-py-disasm.exp-on-arm-linux.patch Patch2091: gdb-testsuite-fix-gdb.fortran-array-bounds.exp-on-ar.patch Patch2092: gdb-symtab-return-correct-reader-for-top-level-cu-in.patch +Patch2093: gdb-tdep-s390-add-arch15-record-replay-support.patch # @@ -832,6 +833,7 @@ find -name "*.info*"|xargs rm -f %patch -P 2090 -p1 %patch -P 2091 -p1 %patch -P 2092 -p1 +%patch -P 2093 -p1 %patch -P 2100 -p1 %patch -P 2101 -p1