|
|
0b42f8 |
commit 550bdf96cae94bc3e6c0f7e7e9a6793399dd8fe6
|
|
|
0b42f8 |
Author: Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
0b42f8 |
Date: Mon Mar 2 10:57:39 2015 +0100
|
|
|
0b42f8 |
|
|
|
0b42f8 |
S390: Add vector register support to gdb
|
|
|
0b42f8 |
|
|
|
0b42f8 |
Recognize S/390 targets with the new vector feature and present their
|
|
|
0b42f8 |
vector registers appropriately: as 32 new 128-bit wide registers
|
|
|
0b42f8 |
v0-v31, where the first 16 embed the floating point registers f0-f15.
|
|
|
0b42f8 |
Each of the full registers v0-v15 is modelled as a pseudo register.
|
|
|
0b42f8 |
|
|
|
0b42f8 |
gdb/ChangeLog:
|
|
|
0b42f8 |
|
|
|
0b42f8 |
* s390-linux-nat.c (have_regset_vxrs): New static variable.
|
|
|
0b42f8 |
(s390_linux_fetch_inferior_registers): Handle vector registers, if
|
|
|
0b42f8 |
present.
|
|
|
0b42f8 |
(s390_linux_store_inferior_registers): Likewise.
|
|
|
0b42f8 |
(s390_get_hwcap): Remove function. Embed its logic...
|
|
|
0b42f8 |
(s390_read_description): ...here. Yield a target description with
|
|
|
0b42f8 |
vector registers if applicable.
|
|
|
0b42f8 |
* s390-linux-tdep.c: Include "features/s390-vx-linux64.c",
|
|
|
0b42f8 |
"features/s390-tevx-linux64.c", "features/s390x-vx-linux64.c", and
|
|
|
0b42f8 |
"features/s390x-tevx-linux64.c".
|
|
|
0b42f8 |
(struct gdbarch_tdep) <v0_full_regnum>: New field.
|
|
|
0b42f8 |
(s390_dwarf_regmap): Add vector registers. Remove bogus entries
|
|
|
0b42f8 |
for "GNU/Linux-specific registers".
|
|
|
0b42f8 |
(s390_dwarf_reg_r0l): New enum value.
|
|
|
0b42f8 |
(s390_dwarf_reg_to_regnum): Support vector registers.
|
|
|
0b42f8 |
(s390_adjust_frame_regnum): Adjust pseudo DWARF register numbers
|
|
|
0b42f8 |
of GPR lower halves.
|
|
|
0b42f8 |
(regnum_is_vxr_full): New function.
|
|
|
0b42f8 |
(s390_register_name): New function.
|
|
|
0b42f8 |
(s390_pseudo_register_name): Handle v0-v15, which are composed of
|
|
|
0b42f8 |
f0-f15 and v0l-v15l.
|
|
|
0b42f8 |
(s390_pseudo_register_type): Likewise.
|
|
|
0b42f8 |
(s390_pseudo_register_read): Likewise.
|
|
|
0b42f8 |
(s390_pseudo_register_write): Likewise.
|
|
|
0b42f8 |
(s390_value_from_register): Account for the fact that values are
|
|
|
0b42f8 |
placed left-justified in vector registers.
|
|
|
0b42f8 |
(s390_pseudo_register_reggroup_p): Add pseudo registers v0-v15 to
|
|
|
0b42f8 |
the vector reggroup and omit them from the general reggroup.
|
|
|
0b42f8 |
(s390_regmap_vxrs_low, s390_regmap_vxrs_high): New register maps.
|
|
|
0b42f8 |
(s390_vxrs_low_regset, s390_vxrs_high_regset): New regsets.
|
|
|
0b42f8 |
(s390_iterate_over_regset_sections): Add iterations for the two
|
|
|
0b42f8 |
new vector regsets.
|
|
|
0b42f8 |
(s390_core_read_description): Yield a target description with
|
|
|
0b42f8 |
vector registers if applicable.
|
|
|
0b42f8 |
(s390_gdbarch_init): Handle target descriptions with vector
|
|
|
0b42f8 |
registers. Add "register_name" gdbarch method.
|
|
|
0b42f8 |
(_initialize_s390_tdep): Call new tdesc initialization functions.
|
|
|
0b42f8 |
* s390-linux-tdep.h (HWCAP_S390_VX): New macro.
|
|
|
0b42f8 |
(S390_V0_LOWER_REGNUM, S390_V1_LOWER_REGNUM, S390_V2_LOWER_REGNUM)
|
|
|
0b42f8 |
(S390_V3_LOWER_REGNUM, S390_V4_LOWER_REGNUM, S390_V5_LOWER_REGNUM)
|
|
|
0b42f8 |
(S390_V6_LOWER_REGNUM, S390_V7_LOWER_REGNUM, S390_V8_LOWER_REGNUM)
|
|
|
0b42f8 |
(S390_V9_LOWER_REGNUM, S390_V10_LOWER_REGNUM)
|
|
|
0b42f8 |
(S390_V11_LOWER_REGNUM, S390_V12_LOWER_REGNUM)
|
|
|
0b42f8 |
(S390_V13_LOWER_REGNUM, S390_V14_LOWER_REGNUM)
|
|
|
0b42f8 |
(S390_V15_LOWER_REGNUM, S390_V16_REGNUM, S390_V17_REGNUM)
|
|
|
0b42f8 |
(S390_V18_REGNUM, S390_V19_REGNUM, S390_V20_REGNUM)
|
|
|
0b42f8 |
(S390_V21_REGNUM, S390_V22_REGNUM, S390_V23_REGNUM)
|
|
|
0b42f8 |
(S390_V24_REGNUM, S390_V25_REGNUM, S390_V26_REGNUM)
|
|
|
0b42f8 |
(S390_V27_REGNUM, S390_V28_REGNUM, S390_V29_REGNUM)
|
|
|
0b42f8 |
(S390_V30_REGNUM, S390_V31_REGNUM): New macros.
|
|
|
0b42f8 |
(S390_NUM_REGS): Adjust value.
|
|
|
0b42f8 |
(s390_vxrs_low_regset, s390_vxrs_high_regset): Declare.
|
|
|
0b42f8 |
(tdesc_s390_vx_linux64, tdesc_s390_tevx_linux64)
|
|
|
0b42f8 |
(tdesc_s390x_vx_linux64, tdesc_s390x_tevx_linux64): Likewise.
|
|
|
0b42f8 |
* NEWS: Announce S/390 vector register support.
|
|
|
0b42f8 |
|
|
|
0b42f8 |
### a/gdb/ChangeLog
|
|
|
0b42f8 |
### b/gdb/ChangeLog
|
|
|
0b42f8 |
## -1,5 +1,63 @@
|
|
|
0b42f8 |
2015-03-02 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
0b42f8 |
|
|
|
0b42f8 |
+ * s390-linux-nat.c (have_regset_vxrs): New static variable.
|
|
|
0b42f8 |
+ (s390_linux_fetch_inferior_registers): Handle vector registers, if
|
|
|
0b42f8 |
+ present.
|
|
|
0b42f8 |
+ (s390_linux_store_inferior_registers): Likewise.
|
|
|
0b42f8 |
+ (s390_get_hwcap): Remove function. Embed its logic...
|
|
|
0b42f8 |
+ (s390_read_description): ...here. Yield a target description with
|
|
|
0b42f8 |
+ vector registers if applicable.
|
|
|
0b42f8 |
+ * s390-linux-tdep.c: Include "features/s390-vx-linux64.c",
|
|
|
0b42f8 |
+ "features/s390-tevx-linux64.c", "features/s390x-vx-linux64.c", and
|
|
|
0b42f8 |
+ "features/s390x-tevx-linux64.c".
|
|
|
0b42f8 |
+ (struct gdbarch_tdep) <v0_full_regnum>: New field.
|
|
|
0b42f8 |
+ (s390_dwarf_regmap): Add vector registers. Remove bogus entries
|
|
|
0b42f8 |
+ for "GNU/Linux-specific registers".
|
|
|
0b42f8 |
+ (s390_dwarf_reg_r0l): New enum value.
|
|
|
0b42f8 |
+ (s390_dwarf_reg_to_regnum): Support vector registers.
|
|
|
0b42f8 |
+ (s390_adjust_frame_regnum): Adjust pseudo DWARF register numbers
|
|
|
0b42f8 |
+ of GPR lower halves.
|
|
|
0b42f8 |
+ (regnum_is_vxr_full): New function.
|
|
|
0b42f8 |
+ (s390_register_name): New function.
|
|
|
0b42f8 |
+ (s390_pseudo_register_name): Handle v0-v15, which are composed of
|
|
|
0b42f8 |
+ f0-f15 and v0l-v15l.
|
|
|
0b42f8 |
+ (s390_pseudo_register_type): Likewise.
|
|
|
0b42f8 |
+ (s390_pseudo_register_read): Likewise.
|
|
|
0b42f8 |
+ (s390_pseudo_register_write): Likewise.
|
|
|
0b42f8 |
+ (s390_value_from_register): Account for the fact that values are
|
|
|
0b42f8 |
+ placed left-justified in vector registers.
|
|
|
0b42f8 |
+ (s390_pseudo_register_reggroup_p): Add pseudo registers v0-v15 to
|
|
|
0b42f8 |
+ the vector reggroup and omit them from the general reggroup.
|
|
|
0b42f8 |
+ (s390_regmap_vxrs_low, s390_regmap_vxrs_high): New register maps.
|
|
|
0b42f8 |
+ (s390_vxrs_low_regset, s390_vxrs_high_regset): New regsets.
|
|
|
0b42f8 |
+ (s390_iterate_over_regset_sections): Add iterations for the two
|
|
|
0b42f8 |
+ new vector regsets.
|
|
|
0b42f8 |
+ (s390_core_read_description): Yield a target description with
|
|
|
0b42f8 |
+ vector registers if applicable.
|
|
|
0b42f8 |
+ (s390_gdbarch_init): Handle target descriptions with vector
|
|
|
0b42f8 |
+ registers. Add "register_name" gdbarch method.
|
|
|
0b42f8 |
+ (_initialize_s390_tdep): Call new tdesc initialization functions.
|
|
|
0b42f8 |
+ * s390-linux-tdep.h (HWCAP_S390_VX): New macro.
|
|
|
0b42f8 |
+ (S390_V0_LOWER_REGNUM, S390_V1_LOWER_REGNUM, S390_V2_LOWER_REGNUM)
|
|
|
0b42f8 |
+ (S390_V3_LOWER_REGNUM, S390_V4_LOWER_REGNUM, S390_V5_LOWER_REGNUM)
|
|
|
0b42f8 |
+ (S390_V6_LOWER_REGNUM, S390_V7_LOWER_REGNUM, S390_V8_LOWER_REGNUM)
|
|
|
0b42f8 |
+ (S390_V9_LOWER_REGNUM, S390_V10_LOWER_REGNUM)
|
|
|
0b42f8 |
+ (S390_V11_LOWER_REGNUM, S390_V12_LOWER_REGNUM)
|
|
|
0b42f8 |
+ (S390_V13_LOWER_REGNUM, S390_V14_LOWER_REGNUM)
|
|
|
0b42f8 |
+ (S390_V15_LOWER_REGNUM, S390_V16_REGNUM, S390_V17_REGNUM)
|
|
|
0b42f8 |
+ (S390_V18_REGNUM, S390_V19_REGNUM, S390_V20_REGNUM)
|
|
|
0b42f8 |
+ (S390_V21_REGNUM, S390_V22_REGNUM, S390_V23_REGNUM)
|
|
|
0b42f8 |
+ (S390_V24_REGNUM, S390_V25_REGNUM, S390_V26_REGNUM)
|
|
|
0b42f8 |
+ (S390_V27_REGNUM, S390_V28_REGNUM, S390_V29_REGNUM)
|
|
|
0b42f8 |
+ (S390_V30_REGNUM, S390_V31_REGNUM): New macros.
|
|
|
0b42f8 |
+ (S390_NUM_REGS): Adjust value.
|
|
|
0b42f8 |
+ (s390_vxrs_low_regset, s390_vxrs_high_regset): Declare.
|
|
|
0b42f8 |
+ (tdesc_s390_vx_linux64, tdesc_s390_tevx_linux64)
|
|
|
0b42f8 |
+ (tdesc_s390x_vx_linux64, tdesc_s390x_tevx_linux64): Likewise.
|
|
|
0b42f8 |
+ * NEWS: Announce S/390 vector register support.
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
+2015-03-02 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
* features/s390-tevx-linux64.xml: New file.
|
|
|
0b42f8 |
* features/s390-vx-linux64.xml: New file.
|
|
|
0b42f8 |
* features/s390-vx.xml: New file.
|
|
|
0b42f8 |
Index: gdb-7.6.1/gdb/NEWS
|
|
|
0b42f8 |
===================================================================
|
|
|
0b42f8 |
--- gdb-7.6.1.orig/gdb/NEWS 2016-03-19 19:52:24.031620964 +0100
|
|
|
0b42f8 |
+++ gdb-7.6.1/gdb/NEWS 2016-03-19 19:52:24.427623861 +0100
|
|
|
0b42f8 |
@@ -18,6 +18,9 @@
|
|
|
0b42f8 |
the program interruption transaction diagnostic block (TDB) is now
|
|
|
0b42f8 |
represented as a number of additional "registers" in GDB.
|
|
|
0b42f8 |
|
|
|
0b42f8 |
+* GDB now supports access to vector registers on S/390 GNU/Linux
|
|
|
0b42f8 |
+ targets.
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
* GDB now honors the content of the file /proc/PID/coredump_filter
|
|
|
0b42f8 |
(PID is the process ID) on GNU/Linux systems. This file can be used
|
|
|
0b42f8 |
to specify the types of memory mappings that will be included in a
|
|
|
0b42f8 |
Index: gdb-7.6.1/gdb/s390-nat.c
|
|
|
0b42f8 |
===================================================================
|
|
|
0b42f8 |
--- gdb-7.6.1.orig/gdb/s390-nat.c 2016-03-19 19:52:23.963620467 +0100
|
|
|
0b42f8 |
+++ gdb-7.6.1/gdb/s390-nat.c 2016-03-19 19:52:24.427623861 +0100
|
|
|
0b42f8 |
@@ -48,6 +48,7 @@
|
|
|
0b42f8 |
static int have_regset_last_break = 0;
|
|
|
0b42f8 |
static int have_regset_system_call = 0;
|
|
|
0b42f8 |
static int have_regset_tdb = 0;
|
|
|
0b42f8 |
+static int have_regset_vxrs = 0;
|
|
|
0b42f8 |
|
|
|
0b42f8 |
/* Map registers to gregset/ptrace offsets.
|
|
|
0b42f8 |
These arrays are defined in s390-tdep.c. */
|
|
|
0b42f8 |
@@ -399,6 +400,18 @@
|
|
|
0b42f8 |
if (regnum == -1 || S390_IS_TDBREGSET_REGNUM (regnum))
|
|
|
0b42f8 |
fetch_regset (regcache, tid, NT_S390_TDB, s390_sizeof_tdbregset,
|
|
|
0b42f8 |
s390_regmap_tdb);
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
+ if (have_regset_vxrs)
|
|
|
0b42f8 |
+ {
|
|
|
0b42f8 |
+ if (regnum == -1 || (regnum >= S390_V0_LOWER_REGNUM
|
|
|
0b42f8 |
+ && regnum <= S390_V15_LOWER_REGNUM))
|
|
|
0b42f8 |
+ fetch_regset (regcache, tid, NT_S390_VXRS_LOW, 16 * 8,
|
|
|
0b42f8 |
+ s390_regmap_vxrs_low);
|
|
|
0b42f8 |
+ if (regnum == -1 || (regnum >= S390_V16_REGNUM
|
|
|
0b42f8 |
+ && regnum <= S390_V31_REGNUM))
|
|
|
0b42f8 |
+ fetch_regset (regcache, tid, NT_S390_VXRS_HIGH, 16 * 16,
|
|
|
0b42f8 |
+ s390_regmap_vxrs_high);
|
|
|
0b42f8 |
+ }
|
|
|
0b42f8 |
}
|
|
|
0b42f8 |
|
|
|
0b42f8 |
/* Store register REGNUM back into the child process. If REGNUM is
|
|
|
0b42f8 |
@@ -421,6 +434,18 @@
|
|
|
0b42f8 |
if (regnum == -1 || regnum == S390_SYSTEM_CALL_REGNUM)
|
|
|
0b42f8 |
store_regset (regcache, tid, NT_S390_SYSTEM_CALL, 4,
|
|
|
0b42f8 |
s390_regmap_system_call);
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
+ if (have_regset_vxrs)
|
|
|
0b42f8 |
+ {
|
|
|
0b42f8 |
+ if (regnum == -1 || (regnum >= S390_V0_LOWER_REGNUM
|
|
|
0b42f8 |
+ && regnum <= S390_V15_LOWER_REGNUM))
|
|
|
0b42f8 |
+ store_regset (regcache, tid, NT_S390_VXRS_LOW, 16 * 8,
|
|
|
0b42f8 |
+ s390_regmap_vxrs_low);
|
|
|
0b42f8 |
+ if (regnum == -1 || (regnum >= S390_V16_REGNUM
|
|
|
0b42f8 |
+ && regnum <= S390_V31_REGNUM))
|
|
|
0b42f8 |
+ store_regset (regcache, tid, NT_S390_VXRS_HIGH, 16 * 16,
|
|
|
0b42f8 |
+ s390_regmap_vxrs_high);
|
|
|
0b42f8 |
+ }
|
|
|
0b42f8 |
}
|
|
|
0b42f8 |
|
|
|
0b42f8 |
|
|
|
0b42f8 |
@@ -619,19 +644,6 @@
|
|
|
0b42f8 |
return 1;
|
|
|
0b42f8 |
}
|
|
|
0b42f8 |
|
|
|
0b42f8 |
-#ifdef __s390x__
|
|
|
0b42f8 |
-static unsigned long
|
|
|
0b42f8 |
-s390_get_hwcap (void)
|
|
|
0b42f8 |
-{
|
|
|
0b42f8 |
- CORE_ADDR field;
|
|
|
0b42f8 |
-
|
|
|
0b42f8 |
- if (target_auxv_search (¤t_target, AT_HWCAP, &field))
|
|
|
0b42f8 |
- return (unsigned long) field;
|
|
|
0b42f8 |
-
|
|
|
0b42f8 |
- return 0;
|
|
|
0b42f8 |
-}
|
|
|
0b42f8 |
-#endif
|
|
|
0b42f8 |
-
|
|
|
0b42f8 |
static const struct target_desc *
|
|
|
0b42f8 |
s390_read_description (struct target_ops *ops)
|
|
|
0b42f8 |
{
|
|
|
0b42f8 |
@@ -642,27 +654,41 @@
|
|
|
0b42f8 |
have_regset_system_call
|
|
|
0b42f8 |
= check_regset (tid, NT_S390_SYSTEM_CALL, 4);
|
|
|
0b42f8 |
|
|
|
0b42f8 |
-#ifdef __s390x__
|
|
|
0b42f8 |
/* If GDB itself is compiled as 64-bit, we are running on a machine in
|
|
|
0b42f8 |
z/Architecture mode. If the target is running in 64-bit addressing
|
|
|
0b42f8 |
mode, report s390x architecture. If the target is running in 31-bit
|
|
|
0b42f8 |
addressing mode, but the kernel supports using 64-bit registers in
|
|
|
0b42f8 |
that mode, report s390 architecture with 64-bit GPRs. */
|
|
|
0b42f8 |
+#ifdef __s390x__
|
|
|
0b42f8 |
+ {
|
|
|
0b42f8 |
+ CORE_ADDR hwcap = 0;
|
|
|
0b42f8 |
|
|
|
0b42f8 |
- have_regset_tdb = (s390_get_hwcap () & HWCAP_S390_TE) ?
|
|
|
0b42f8 |
- check_regset (tid, NT_S390_TDB, s390_sizeof_tdbregset) : 0;
|
|
|
0b42f8 |
-
|
|
|
0b42f8 |
- if (s390_target_wordsize () == 8)
|
|
|
0b42f8 |
- return (have_regset_tdb ? tdesc_s390x_te_linux64 :
|
|
|
0b42f8 |
- have_regset_system_call? tdesc_s390x_linux64v2 :
|
|
|
0b42f8 |
- have_regset_last_break? tdesc_s390x_linux64v1 :
|
|
|
0b42f8 |
- tdesc_s390x_linux64);
|
|
|
0b42f8 |
-
|
|
|
0b42f8 |
- if (s390_get_hwcap () & HWCAP_S390_HIGH_GPRS)
|
|
|
0b42f8 |
- return (have_regset_tdb ? tdesc_s390_te_linux64 :
|
|
|
0b42f8 |
- have_regset_system_call? tdesc_s390_linux64v2 :
|
|
|
0b42f8 |
- have_regset_last_break? tdesc_s390_linux64v1 :
|
|
|
0b42f8 |
- tdesc_s390_linux64);
|
|
|
0b42f8 |
+ target_auxv_search (¤t_target, AT_HWCAP, &hwcap);
|
|
|
0b42f8 |
+ have_regset_tdb = (hwcap & HWCAP_S390_TE)
|
|
|
0b42f8 |
+ && check_regset (tid, NT_S390_TDB, s390_sizeof_tdbregset);
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
+ have_regset_vxrs = (hwcap & HWCAP_S390_VX)
|
|
|
0b42f8 |
+ && check_regset (tid, NT_S390_VXRS_LOW, 16 * 8)
|
|
|
0b42f8 |
+ && check_regset (tid, NT_S390_VXRS_HIGH, 16 * 16);
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
+ if (s390_target_wordsize () == 8)
|
|
|
0b42f8 |
+ return (have_regset_vxrs ?
|
|
|
0b42f8 |
+ (have_regset_tdb ? tdesc_s390x_tevx_linux64 :
|
|
|
0b42f8 |
+ tdesc_s390x_vx_linux64) :
|
|
|
0b42f8 |
+ have_regset_tdb ? tdesc_s390x_te_linux64 :
|
|
|
0b42f8 |
+ have_regset_system_call ? tdesc_s390x_linux64v2 :
|
|
|
0b42f8 |
+ have_regset_last_break ? tdesc_s390x_linux64v1 :
|
|
|
0b42f8 |
+ tdesc_s390x_linux64);
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
+ if (hwcap & HWCAP_S390_HIGH_GPRS)
|
|
|
0b42f8 |
+ return (have_regset_vxrs ?
|
|
|
0b42f8 |
+ (have_regset_tdb ? tdesc_s390_tevx_linux64 :
|
|
|
0b42f8 |
+ tdesc_s390_vx_linux64) :
|
|
|
0b42f8 |
+ have_regset_tdb ? tdesc_s390_te_linux64 :
|
|
|
0b42f8 |
+ have_regset_system_call ? tdesc_s390_linux64v2 :
|
|
|
0b42f8 |
+ have_regset_last_break ? tdesc_s390_linux64v1 :
|
|
|
0b42f8 |
+ tdesc_s390_linux64);
|
|
|
0b42f8 |
+ }
|
|
|
0b42f8 |
#endif
|
|
|
0b42f8 |
|
|
|
0b42f8 |
/* If GDB itself is compiled as 31-bit, or if we're running a 31-bit inferior
|
|
|
0b42f8 |
Index: gdb-7.6.1/gdb/s390-tdep.c
|
|
|
0b42f8 |
===================================================================
|
|
|
0b42f8 |
--- gdb-7.6.1.orig/gdb/s390-tdep.c 2016-03-19 19:52:24.414623766 +0100
|
|
|
0b42f8 |
+++ gdb-7.6.1/gdb/s390-tdep.c 2016-03-19 19:52:41.875751479 +0100
|
|
|
0b42f8 |
@@ -61,10 +61,14 @@
|
|
|
0b42f8 |
#include "features/s390-linux64v1.c"
|
|
|
0b42f8 |
#include "features/s390-linux64v2.c"
|
|
|
0b42f8 |
#include "features/s390-te-linux64.c"
|
|
|
0b42f8 |
+#include "features/s390-vx-linux64.c"
|
|
|
0b42f8 |
+#include "features/s390-tevx-linux64.c"
|
|
|
0b42f8 |
#include "features/s390x-linux64.c"
|
|
|
0b42f8 |
#include "features/s390x-linux64v1.c"
|
|
|
0b42f8 |
#include "features/s390x-linux64v2.c"
|
|
|
0b42f8 |
#include "features/s390x-te-linux64.c"
|
|
|
0b42f8 |
+#include "features/s390x-vx-linux64.c"
|
|
|
0b42f8 |
+#include "features/s390x-tevx-linux64.c"
|
|
|
0b42f8 |
|
|
|
0b42f8 |
/* The tdep structure. */
|
|
|
0b42f8 |
|
|
|
0b42f8 |
@@ -77,6 +81,7 @@
|
|
|
0b42f8 |
int gpr_full_regnum;
|
|
|
0b42f8 |
int pc_regnum;
|
|
|
0b42f8 |
int cc_regnum;
|
|
|
0b42f8 |
+ int v0_full_regnum;
|
|
|
0b42f8 |
|
|
|
0b42f8 |
/* Core file register sets. */
|
|
|
0b42f8 |
const struct regset *gregset;
|
|
|
0b42f8 |
@@ -151,61 +156,83 @@
|
|
|
0b42f8 |
|
|
|
0b42f8 |
static const short s390_dwarf_regmap[] =
|
|
|
0b42f8 |
{
|
|
|
0b42f8 |
- /* General Purpose Registers. */
|
|
|
0b42f8 |
+ /* 0-15: General Purpose Registers. */
|
|
|
0b42f8 |
S390_R0_REGNUM, S390_R1_REGNUM, S390_R2_REGNUM, S390_R3_REGNUM,
|
|
|
0b42f8 |
S390_R4_REGNUM, S390_R5_REGNUM, S390_R6_REGNUM, S390_R7_REGNUM,
|
|
|
0b42f8 |
S390_R8_REGNUM, S390_R9_REGNUM, S390_R10_REGNUM, S390_R11_REGNUM,
|
|
|
0b42f8 |
S390_R12_REGNUM, S390_R13_REGNUM, S390_R14_REGNUM, S390_R15_REGNUM,
|
|
|
0b42f8 |
|
|
|
0b42f8 |
- /* Floating Point Registers. */
|
|
|
0b42f8 |
+ /* 16-31: Floating Point Registers / Vector Registers 0-15. */
|
|
|
0b42f8 |
S390_F0_REGNUM, S390_F2_REGNUM, S390_F4_REGNUM, S390_F6_REGNUM,
|
|
|
0b42f8 |
S390_F1_REGNUM, S390_F3_REGNUM, S390_F5_REGNUM, S390_F7_REGNUM,
|
|
|
0b42f8 |
S390_F8_REGNUM, S390_F10_REGNUM, S390_F12_REGNUM, S390_F14_REGNUM,
|
|
|
0b42f8 |
S390_F9_REGNUM, S390_F11_REGNUM, S390_F13_REGNUM, S390_F15_REGNUM,
|
|
|
0b42f8 |
|
|
|
0b42f8 |
- /* Control Registers (not mapped). */
|
|
|
0b42f8 |
- -1, -1, -1, -1, -1, -1, -1, -1,
|
|
|
0b42f8 |
- -1, -1, -1, -1, -1, -1, -1, -1,
|
|
|
0b42f8 |
+ /* 32-47: Control Registers (not mapped). */
|
|
|
0b42f8 |
+ -1, -1, -1, -1, -1, -1, -1, -1,
|
|
|
0b42f8 |
+ -1, -1, -1, -1, -1, -1, -1, -1,
|
|
|
0b42f8 |
|
|
|
0b42f8 |
- /* Access Registers. */
|
|
|
0b42f8 |
+ /* 48-63: Access Registers. */
|
|
|
0b42f8 |
S390_A0_REGNUM, S390_A1_REGNUM, S390_A2_REGNUM, S390_A3_REGNUM,
|
|
|
0b42f8 |
S390_A4_REGNUM, S390_A5_REGNUM, S390_A6_REGNUM, S390_A7_REGNUM,
|
|
|
0b42f8 |
S390_A8_REGNUM, S390_A9_REGNUM, S390_A10_REGNUM, S390_A11_REGNUM,
|
|
|
0b42f8 |
S390_A12_REGNUM, S390_A13_REGNUM, S390_A14_REGNUM, S390_A15_REGNUM,
|
|
|
0b42f8 |
|
|
|
0b42f8 |
- /* Program Status Word. */
|
|
|
0b42f8 |
+ /* 64-65: Program Status Word. */
|
|
|
0b42f8 |
S390_PSWM_REGNUM,
|
|
|
0b42f8 |
S390_PSWA_REGNUM,
|
|
|
0b42f8 |
|
|
|
0b42f8 |
+ /* 66-67: Reserved. */
|
|
|
0b42f8 |
+ -1, -1,
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
+ /* 68-83: Vector Registers 16-31. */
|
|
|
0b42f8 |
+ S390_V16_REGNUM, S390_V18_REGNUM, S390_V20_REGNUM, S390_V22_REGNUM,
|
|
|
0b42f8 |
+ S390_V17_REGNUM, S390_V19_REGNUM, S390_V21_REGNUM, S390_V23_REGNUM,
|
|
|
0b42f8 |
+ S390_V24_REGNUM, S390_V26_REGNUM, S390_V28_REGNUM, S390_V30_REGNUM,
|
|
|
0b42f8 |
+ S390_V25_REGNUM, S390_V27_REGNUM, S390_V29_REGNUM, S390_V31_REGNUM,
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
+ /* End of "official" DWARF registers. The remainder of the map is
|
|
|
0b42f8 |
+ for GDB internal use only. */
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
/* GPR Lower Half Access. */
|
|
|
0b42f8 |
S390_R0_REGNUM, S390_R1_REGNUM, S390_R2_REGNUM, S390_R3_REGNUM,
|
|
|
0b42f8 |
S390_R4_REGNUM, S390_R5_REGNUM, S390_R6_REGNUM, S390_R7_REGNUM,
|
|
|
0b42f8 |
S390_R8_REGNUM, S390_R9_REGNUM, S390_R10_REGNUM, S390_R11_REGNUM,
|
|
|
0b42f8 |
S390_R12_REGNUM, S390_R13_REGNUM, S390_R14_REGNUM, S390_R15_REGNUM,
|
|
|
0b42f8 |
-
|
|
|
0b42f8 |
- /* GNU/Linux-specific registers (not mapped). */
|
|
|
0b42f8 |
- -1, -1, -1,
|
|
|
0b42f8 |
};
|
|
|
0b42f8 |
|
|
|
0b42f8 |
+enum { s390_dwarf_reg_r0l = ARRAY_SIZE (s390_dwarf_regmap) - 16 };
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
/* Convert DWARF register number REG to the appropriate register
|
|
|
0b42f8 |
number used by GDB. */
|
|
|
0b42f8 |
static int
|
|
|
0b42f8 |
s390_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int reg)
|
|
|
0b42f8 |
{
|
|
|
0b42f8 |
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
|
|
0b42f8 |
+ int gdb_reg = -1;
|
|
|
0b42f8 |
|
|
|
0b42f8 |
- /* In a 32-on-64 debug scenario, debug info refers to the full 64-bit
|
|
|
0b42f8 |
- GPRs. Note that call frame information still refers to the 32-bit
|
|
|
0b42f8 |
- lower halves, because s390_adjust_frame_regnum uses register numbers
|
|
|
0b42f8 |
- 66 .. 81 to access GPRs. */
|
|
|
0b42f8 |
+ /* In a 32-on-64 debug scenario, debug info refers to the full
|
|
|
0b42f8 |
+ 64-bit GPRs. Note that call frame information still refers to
|
|
|
0b42f8 |
+ the 32-bit lower halves, because s390_adjust_frame_regnum uses
|
|
|
0b42f8 |
+ special register numbers to access GPRs. */
|
|
|
0b42f8 |
if (tdep->gpr_full_regnum != -1 && reg >= 0 && reg < 16)
|
|
|
0b42f8 |
return tdep->gpr_full_regnum + reg;
|
|
|
0b42f8 |
|
|
|
0b42f8 |
if (reg >= 0 && reg < ARRAY_SIZE (s390_dwarf_regmap))
|
|
|
0b42f8 |
- return s390_dwarf_regmap[reg];
|
|
|
0b42f8 |
+ gdb_reg = s390_dwarf_regmap[reg];
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
+ if (tdep->v0_full_regnum == -1)
|
|
|
0b42f8 |
+ {
|
|
|
0b42f8 |
+ if (gdb_reg >= S390_V16_REGNUM && gdb_reg <= S390_V31_REGNUM)
|
|
|
0b42f8 |
+ gdb_reg = -1;
|
|
|
0b42f8 |
+ }
|
|
|
0b42f8 |
+ else
|
|
|
0b42f8 |
+ {
|
|
|
0b42f8 |
+ if (gdb_reg >= S390_F0_REGNUM && gdb_reg <= S390_F15_REGNUM)
|
|
|
0b42f8 |
+ gdb_reg = gdb_reg - S390_F0_REGNUM + tdep->v0_full_regnum;
|
|
|
0b42f8 |
+ }
|
|
|
0b42f8 |
|
|
|
0b42f8 |
- warning (_("Unmapped DWARF Register #%d encountered."), reg);
|
|
|
0b42f8 |
- return -1;
|
|
|
0b42f8 |
+ return gdb_reg;
|
|
|
0b42f8 |
}
|
|
|
0b42f8 |
|
|
|
0b42f8 |
/* Translate a .eh_frame register to DWARF register, or adjust a
|
|
|
0b42f8 |
@@ -214,7 +241,7 @@
|
|
|
0b42f8 |
s390_adjust_frame_regnum (struct gdbarch *gdbarch, int num, int eh_frame_p)
|
|
|
0b42f8 |
{
|
|
|
0b42f8 |
/* See s390_dwarf_reg_to_regnum for comments. */
|
|
|
0b42f8 |
- return (num >= 0 && num < 16)? num + 66 : num;
|
|
|
0b42f8 |
+ return (num >= 0 && num < 16) ? num + s390_dwarf_reg_r0l : num;
|
|
|
0b42f8 |
}
|
|
|
0b42f8 |
|
|
|
0b42f8 |
|
|
|
0b42f8 |
@@ -228,6 +255,29 @@
|
|
|
0b42f8 |
&& regnum <= tdep->gpr_full_regnum + 15);
|
|
|
0b42f8 |
}
|
|
|
0b42f8 |
|
|
|
0b42f8 |
+/* Check whether REGNUM indicates a full vector register (v0-v15).
|
|
|
0b42f8 |
+ These pseudo-registers are composed of f0-f15 and v0l-v15l. */
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
+static int
|
|
|
0b42f8 |
+regnum_is_vxr_full (struct gdbarch_tdep *tdep, int regnum)
|
|
|
0b42f8 |
+{
|
|
|
0b42f8 |
+ return (tdep->v0_full_regnum != -1
|
|
|
0b42f8 |
+ && regnum >= tdep->v0_full_regnum
|
|
|
0b42f8 |
+ && regnum <= tdep->v0_full_regnum + 15);
|
|
|
0b42f8 |
+}
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
+/* Return the name of register REGNO. Return NULL for registers that
|
|
|
0b42f8 |
+ shouldn't be visible. */
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
+static const char *
|
|
|
0b42f8 |
+s390_register_name (struct gdbarch *gdbarch, int regnum)
|
|
|
0b42f8 |
+{
|
|
|
0b42f8 |
+ if (regnum >= S390_V0_LOWER_REGNUM
|
|
|
0b42f8 |
+ && regnum <= S390_V15_LOWER_REGNUM)
|
|
|
0b42f8 |
+ return NULL;
|
|
|
0b42f8 |
+ return tdesc_register_name (gdbarch, regnum);
|
|
|
0b42f8 |
+}
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
static const char *
|
|
|
0b42f8 |
s390_pseudo_register_name (struct gdbarch *gdbarch, int regnum)
|
|
|
0b42f8 |
{
|
|
|
0b42f8 |
@@ -248,6 +298,15 @@
|
|
|
0b42f8 |
return full_name[regnum - tdep->gpr_full_regnum];
|
|
|
0b42f8 |
}
|
|
|
0b42f8 |
|
|
|
0b42f8 |
+ if (regnum_is_vxr_full (tdep, regnum))
|
|
|
0b42f8 |
+ {
|
|
|
0b42f8 |
+ static const char *full_name[] = {
|
|
|
0b42f8 |
+ "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7",
|
|
|
0b42f8 |
+ "v8", "v9", "v10", "v11", "v12", "v13", "v14", "v15"
|
|
|
0b42f8 |
+ };
|
|
|
0b42f8 |
+ return full_name[regnum - tdep->v0_full_regnum];
|
|
|
0b42f8 |
+ }
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
internal_error (__FILE__, __LINE__, _("invalid regnum"));
|
|
|
0b42f8 |
}
|
|
|
0b42f8 |
|
|
|
0b42f8 |
@@ -265,6 +324,9 @@
|
|
|
0b42f8 |
if (regnum_is_gpr_full (tdep, regnum))
|
|
|
0b42f8 |
return builtin_type (gdbarch)->builtin_uint64;
|
|
|
0b42f8 |
|
|
|
0b42f8 |
+ if (regnum_is_vxr_full (tdep, regnum))
|
|
|
0b42f8 |
+ return tdesc_find_type (gdbarch, "vec128");
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
internal_error (__FILE__, __LINE__, _("invalid regnum"));
|
|
|
0b42f8 |
}
|
|
|
0b42f8 |
|
|
|
0b42f8 |
@@ -326,6 +388,19 @@
|
|
|
0b42f8 |
return status;
|
|
|
0b42f8 |
}
|
|
|
0b42f8 |
|
|
|
0b42f8 |
+ if (regnum_is_vxr_full (tdep, regnum))
|
|
|
0b42f8 |
+ {
|
|
|
0b42f8 |
+ enum register_status status;
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
+ regnum -= tdep->v0_full_regnum;
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
+ status = regcache_raw_read (regcache, S390_F0_REGNUM + regnum, buf);
|
|
|
0b42f8 |
+ if (status == REG_VALID)
|
|
|
0b42f8 |
+ status = regcache_raw_read (regcache,
|
|
|
0b42f8 |
+ S390_V0_LOWER_REGNUM + regnum, buf + 8);
|
|
|
0b42f8 |
+ return status;
|
|
|
0b42f8 |
+ }
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
internal_error (__FILE__, __LINE__, _("invalid regnum"));
|
|
|
0b42f8 |
}
|
|
|
0b42f8 |
|
|
|
0b42f8 |
@@ -373,22 +448,35 @@
|
|
|
0b42f8 |
return;
|
|
|
0b42f8 |
}
|
|
|
0b42f8 |
|
|
|
0b42f8 |
+ if (regnum_is_vxr_full (tdep, regnum))
|
|
|
0b42f8 |
+ {
|
|
|
0b42f8 |
+ regnum -= tdep->v0_full_regnum;
|
|
|
0b42f8 |
+ regcache_raw_write (regcache, S390_F0_REGNUM + regnum, buf);
|
|
|
0b42f8 |
+ regcache_raw_write (regcache, S390_V0_LOWER_REGNUM + regnum, buf + 8);
|
|
|
0b42f8 |
+ return;
|
|
|
0b42f8 |
+ }
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
internal_error (__FILE__, __LINE__, _("invalid regnum"));
|
|
|
0b42f8 |
}
|
|
|
0b42f8 |
|
|
|
0b42f8 |
/* 'float' values are stored in the upper half of floating-point
|
|
|
0b42f8 |
- registers, even though we are otherwise a big-endian platform. */
|
|
|
0b42f8 |
+ registers, even though we are otherwise a big-endian platform. The
|
|
|
0b42f8 |
+ same applies to a 'float' value within a vector. */
|
|
|
0b42f8 |
|
|
|
0b42f8 |
static struct value *
|
|
|
0b42f8 |
s390_value_from_register (struct type *type, int regnum,
|
|
|
0b42f8 |
struct frame_info *frame)
|
|
|
0b42f8 |
{
|
|
|
0b42f8 |
+ struct gdbarch *gdbarch = get_frame_arch (frame);
|
|
|
0b42f8 |
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
|
|
0b42f8 |
struct value *value = default_value_from_register (type, regnum, frame);
|
|
|
0b42f8 |
|
|
|
0b42f8 |
check_typedef (type);
|
|
|
0b42f8 |
|
|
|
0b42f8 |
- if (regnum >= S390_F0_REGNUM && regnum <= S390_F15_REGNUM
|
|
|
0b42f8 |
- && TYPE_LENGTH (type) < 8)
|
|
|
0b42f8 |
+ if ((regnum >= S390_F0_REGNUM && regnum <= S390_F15_REGNUM
|
|
|
0b42f8 |
+ && TYPE_LENGTH (type) < 8)
|
|
|
0b42f8 |
+ || regnum_is_vxr_full (tdep, regnum)
|
|
|
0b42f8 |
+ || (regnum >= S390_V16_REGNUM && regnum <= S390_V31_REGNUM))
|
|
|
0b42f8 |
set_value_offset (value, 0);
|
|
|
0b42f8 |
|
|
|
0b42f8 |
return value;
|
|
|
0b42f8 |
@@ -413,9 +501,57 @@
|
|
|
0b42f8 |
if (group == save_reggroup || group == restore_reggroup)
|
|
|
0b42f8 |
return regnum == tdep->pc_regnum || regnum == tdep->cc_regnum;
|
|
|
0b42f8 |
|
|
|
0b42f8 |
+ if (group == vector_reggroup)
|
|
|
0b42f8 |
+ return regnum_is_vxr_full (tdep, regnum);
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
+ if (group == general_reggroup && regnum_is_vxr_full (tdep, regnum))
|
|
|
0b42f8 |
+ return 0;
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
return default_register_reggroup_p (gdbarch, regnum, group);
|
|
|
0b42f8 |
}
|
|
|
0b42f8 |
|
|
|
0b42f8 |
+const short s390_regmap_vxrs_low[] =
|
|
|
0b42f8 |
+ {
|
|
|
0b42f8 |
+ 0x00, S390_V0_LOWER_REGNUM,
|
|
|
0b42f8 |
+ 0x08, S390_V1_LOWER_REGNUM,
|
|
|
0b42f8 |
+ 0x10, S390_V2_LOWER_REGNUM,
|
|
|
0b42f8 |
+ 0x18, S390_V3_LOWER_REGNUM,
|
|
|
0b42f8 |
+ 0x20, S390_V4_LOWER_REGNUM,
|
|
|
0b42f8 |
+ 0x28, S390_V5_LOWER_REGNUM,
|
|
|
0b42f8 |
+ 0x30, S390_V6_LOWER_REGNUM,
|
|
|
0b42f8 |
+ 0x38, S390_V7_LOWER_REGNUM,
|
|
|
0b42f8 |
+ 0x40, S390_V8_LOWER_REGNUM,
|
|
|
0b42f8 |
+ 0x48, S390_V9_LOWER_REGNUM,
|
|
|
0b42f8 |
+ 0x50, S390_V10_LOWER_REGNUM,
|
|
|
0b42f8 |
+ 0x58, S390_V11_LOWER_REGNUM,
|
|
|
0b42f8 |
+ 0x60, S390_V12_LOWER_REGNUM,
|
|
|
0b42f8 |
+ 0x68, S390_V13_LOWER_REGNUM,
|
|
|
0b42f8 |
+ 0x70, S390_V14_LOWER_REGNUM,
|
|
|
0b42f8 |
+ 0x78, S390_V15_LOWER_REGNUM,
|
|
|
0b42f8 |
+ -1, -1,
|
|
|
0b42f8 |
+ };
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
+const short s390_regmap_vxrs_high[] =
|
|
|
0b42f8 |
+ {
|
|
|
0b42f8 |
+ 0x00, S390_V16_REGNUM,
|
|
|
0b42f8 |
+ 0x10, S390_V17_REGNUM,
|
|
|
0b42f8 |
+ 0x20, S390_V18_REGNUM,
|
|
|
0b42f8 |
+ 0x30, S390_V19_REGNUM,
|
|
|
0b42f8 |
+ 0x40, S390_V20_REGNUM,
|
|
|
0b42f8 |
+ 0x50, S390_V21_REGNUM,
|
|
|
0b42f8 |
+ 0x60, S390_V22_REGNUM,
|
|
|
0b42f8 |
+ 0x70, S390_V23_REGNUM,
|
|
|
0b42f8 |
+ 0x80, S390_V24_REGNUM,
|
|
|
0b42f8 |
+ 0x90, S390_V25_REGNUM,
|
|
|
0b42f8 |
+ 0xa0, S390_V26_REGNUM,
|
|
|
0b42f8 |
+ 0xb0, S390_V27_REGNUM,
|
|
|
0b42f8 |
+ 0xc0, S390_V28_REGNUM,
|
|
|
0b42f8 |
+ 0xd0, S390_V29_REGNUM,
|
|
|
0b42f8 |
+ 0xe0, S390_V30_REGNUM,
|
|
|
0b42f8 |
+ 0xf0, S390_V31_REGNUM,
|
|
|
0b42f8 |
+ -1, -1,
|
|
|
0b42f8 |
+ };
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
|
|
|
0b42f8 |
/* Maps for register sets. */
|
|
|
0b42f8 |
|
|
|
0b42f8 |
@@ -695,6 +831,18 @@
|
|
|
0b42f8 |
s390_collect_regset
|
|
|
0b42f8 |
};
|
|
|
0b42f8 |
|
|
|
0b42f8 |
+static const struct regset s390_vxrs_low_regset = {
|
|
|
0b42f8 |
+ s390_regmap_vxrs_low,
|
|
|
0b42f8 |
+ s390_supply_regset,
|
|
|
0b42f8 |
+ s390_collect_regset
|
|
|
0b42f8 |
+};
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
+static const struct regset s390_vxrs_high_regset = {
|
|
|
0b42f8 |
+ s390_regmap_vxrs_high,
|
|
|
0b42f8 |
+ s390_supply_regset,
|
|
|
0b42f8 |
+ s390_collect_regset
|
|
|
0b42f8 |
+};
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
/* Return the appropriate register set for the core section identified
|
|
|
0b42f8 |
by SECT_NAME and SECT_SIZE. */
|
|
|
0b42f8 |
static const struct regset *
|
|
|
0b42f8 |
@@ -722,6 +870,12 @@
|
|
|
0b42f8 |
if (strcmp (sect_name, ".reg-s390-tdb") == 0 && sect_size >= 256)
|
|
|
0b42f8 |
return &s390_tdb_regset;
|
|
|
0b42f8 |
|
|
|
0b42f8 |
+ if (strcmp (sect_name, ".reg-s390-vxrs-low") == 0 && sect_size >= 128)
|
|
|
0b42f8 |
+ return &s390_vxrs_low_regset;
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
+ if (strcmp (sect_name, ".reg-s390-vxrs-high") == 0 && sect_size >= 256)
|
|
|
0b42f8 |
+ return &s390_vxrs_high_regset;
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
return NULL;
|
|
|
0b42f8 |
}
|
|
|
0b42f8 |
|
|
|
0b42f8 |
@@ -755,37 +909,54 @@
|
|
|
0b42f8 |
|| REG_VALID == regcache_register_status (regcache,
|
|
|
0b42f8 |
S390_TDB_DWORD0_REGNUM)))
|
|
|
0b42f8 |
cb (".reg-s390-tdb", s390_sizeof_tdbregset, "s390 TDB", cb_data);
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
+ if (tdep->v0_full_regnum != -1)
|
|
|
0b42f8 |
+ {
|
|
|
0b42f8 |
+ cb (".reg-s390-vxrs-low", 16 * 8,
|
|
|
0b42f8 |
+ "s390 vector registers 0-15 lower half", cb_data);
|
|
|
0b42f8 |
+ cb (".reg-s390-vxrs-high", 16 * 16,
|
|
|
0b42f8 |
+ "s390 vector registers 16-31", cb_data);
|
|
|
0b42f8 |
+ }
|
|
|
0b42f8 |
}
|
|
|
0b42f8 |
|
|
|
0b42f8 |
static const struct target_desc *
|
|
|
0b42f8 |
s390_core_read_description (struct gdbarch *gdbarch,
|
|
|
0b42f8 |
struct target_ops *target, bfd *abfd)
|
|
|
0b42f8 |
{
|
|
|
0b42f8 |
- asection *high_gprs = bfd_get_section_by_name (abfd, ".reg-s390-high-gprs");
|
|
|
0b42f8 |
- asection *v1 = bfd_get_section_by_name (abfd, ".reg-s390-last-break");
|
|
|
0b42f8 |
- asection *v2 = bfd_get_section_by_name (abfd, ".reg-s390-system-call");
|
|
|
0b42f8 |
asection *section = bfd_get_section_by_name (abfd, ".reg");
|
|
|
0b42f8 |
CORE_ADDR hwcap = 0;
|
|
|
0b42f8 |
+ int high_gprs, v1, v2, te, vx;
|
|
|
0b42f8 |
|
|
|
0b42f8 |
target_auxv_search (target, AT_HWCAP, &hwcap);
|
|
|
0b42f8 |
if (!section)
|
|
|
0b42f8 |
return NULL;
|
|
|
0b42f8 |
|
|
|
0b42f8 |
+ high_gprs = (bfd_get_section_by_name (abfd, ".reg-s390-high-gprs")
|
|
|
0b42f8 |
+ != NULL);
|
|
|
0b42f8 |
+ v1 = (bfd_get_section_by_name (abfd, ".reg-s390-last-break") != NULL);
|
|
|
0b42f8 |
+ v2 = (bfd_get_section_by_name (abfd, ".reg-s390-system-call") != NULL);
|
|
|
0b42f8 |
+ vx = (hwcap & HWCAP_S390_VX);
|
|
|
0b42f8 |
+ te = (hwcap & HWCAP_S390_TE);
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
switch (bfd_section_size (abfd, section))
|
|
|
0b42f8 |
{
|
|
|
0b42f8 |
case s390_sizeof_gregset:
|
|
|
0b42f8 |
if (high_gprs)
|
|
|
0b42f8 |
- return ((hwcap & HWCAP_S390_TE) ? tdesc_s390_te_linux64 :
|
|
|
0b42f8 |
- v2? tdesc_s390_linux64v2 :
|
|
|
0b42f8 |
- v1? tdesc_s390_linux64v1 : tdesc_s390_linux64);
|
|
|
0b42f8 |
+ return (te && vx ? tdesc_s390_tevx_linux64 :
|
|
|
0b42f8 |
+ vx ? tdesc_s390_vx_linux64 :
|
|
|
0b42f8 |
+ te ? tdesc_s390_te_linux64 :
|
|
|
0b42f8 |
+ v2 ? tdesc_s390_linux64v2 :
|
|
|
0b42f8 |
+ v1 ? tdesc_s390_linux64v1 : tdesc_s390_linux64);
|
|
|
0b42f8 |
else
|
|
|
0b42f8 |
- return (v2? tdesc_s390_linux32v2 :
|
|
|
0b42f8 |
- v1? tdesc_s390_linux32v1 : tdesc_s390_linux32);
|
|
|
0b42f8 |
+ return (v2 ? tdesc_s390_linux32v2 :
|
|
|
0b42f8 |
+ v1 ? tdesc_s390_linux32v1 : tdesc_s390_linux32);
|
|
|
0b42f8 |
|
|
|
0b42f8 |
case s390x_sizeof_gregset:
|
|
|
0b42f8 |
- return ((hwcap & HWCAP_S390_TE) ? tdesc_s390x_te_linux64 :
|
|
|
0b42f8 |
- v2? tdesc_s390x_linux64v2 :
|
|
|
0b42f8 |
- v1? tdesc_s390x_linux64v1 : tdesc_s390x_linux64);
|
|
|
0b42f8 |
+ return (te && vx ? tdesc_s390x_tevx_linux64 :
|
|
|
0b42f8 |
+ vx ? tdesc_s390x_vx_linux64 :
|
|
|
0b42f8 |
+ te ? tdesc_s390x_te_linux64 :
|
|
|
0b42f8 |
+ v2 ? tdesc_s390x_linux64v2 :
|
|
|
0b42f8 |
+ v1 ? tdesc_s390x_linux64v1 : tdesc_s390x_linux64);
|
|
|
0b42f8 |
|
|
|
0b42f8 |
default:
|
|
|
0b42f8 |
return NULL;
|
|
|
0b42f8 |
@@ -2990,6 +3161,7 @@
|
|
|
0b42f8 |
int have_linux_v1 = 0;
|
|
|
0b42f8 |
int have_linux_v2 = 0;
|
|
|
0b42f8 |
int have_tdb = 0;
|
|
|
0b42f8 |
+ int have_vx = 0;
|
|
|
0b42f8 |
int first_pseudo_reg, last_pseudo_reg;
|
|
|
0b42f8 |
static const char *const stap_register_prefixes[] = { "%", NULL };
|
|
|
0b42f8 |
static const char *const stap_register_indirection_prefixes[] = { "(",
|
|
|
0b42f8 |
@@ -3049,6 +3221,14 @@
|
|
|
0b42f8 |
"tr0", "tr1", "tr2", "tr3", "tr4", "tr5", "tr6", "tr7",
|
|
|
0b42f8 |
"tr8", "tr9", "tr10", "tr11", "tr12", "tr13", "tr14", "tr15"
|
|
|
0b42f8 |
};
|
|
|
0b42f8 |
+ static const char *const vxrs_low[] = {
|
|
|
0b42f8 |
+ "v0l", "v1l", "v2l", "v3l", "v4l", "v5l", "v6l", "v7l", "v8l",
|
|
|
0b42f8 |
+ "v9l", "v10l", "v11l", "v12l", "v13l", "v14l", "v15l",
|
|
|
0b42f8 |
+ };
|
|
|
0b42f8 |
+ static const char *const vxrs_high[] = {
|
|
|
0b42f8 |
+ "v16", "v17", "v18", "v19", "v20", "v21", "v22", "v23", "v24",
|
|
|
0b42f8 |
+ "v25", "v26", "v27", "v28", "v29", "v30", "v31",
|
|
|
0b42f8 |
+ };
|
|
|
0b42f8 |
const struct tdesc_feature *feature;
|
|
|
0b42f8 |
int i, valid_p = 1;
|
|
|
0b42f8 |
|
|
|
0b42f8 |
@@ -3137,6 +3317,21 @@
|
|
|
0b42f8 |
have_tdb = 1;
|
|
|
0b42f8 |
}
|
|
|
0b42f8 |
|
|
|
0b42f8 |
+ /* Vector registers. */
|
|
|
0b42f8 |
+ feature = tdesc_find_feature (tdesc, "org.gnu.gdb.s390.vx");
|
|
|
0b42f8 |
+ if (feature)
|
|
|
0b42f8 |
+ {
|
|
|
0b42f8 |
+ for (i = 0; i < 16; i++)
|
|
|
0b42f8 |
+ valid_p &= tdesc_numbered_register (feature, tdesc_data,
|
|
|
0b42f8 |
+ S390_V0_LOWER_REGNUM + i,
|
|
|
0b42f8 |
+ vxrs_low[i]);
|
|
|
0b42f8 |
+ for (i = 0; i < 16; i++)
|
|
|
0b42f8 |
+ valid_p &= tdesc_numbered_register (feature, tdesc_data,
|
|
|
0b42f8 |
+ S390_V16_REGNUM + i,
|
|
|
0b42f8 |
+ vxrs_high[i]);
|
|
|
0b42f8 |
+ have_vx = 1;
|
|
|
0b42f8 |
+ }
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
if (!valid_p)
|
|
|
0b42f8 |
{
|
|
|
0b42f8 |
tdesc_data_cleanup (tdesc_data);
|
|
|
0b42f8 |
@@ -3208,6 +3403,7 @@
|
|
|
0b42f8 |
set_tdesc_pseudo_register_reggroup_p (gdbarch,
|
|
|
0b42f8 |
s390_pseudo_register_reggroup_p);
|
|
|
0b42f8 |
tdesc_use_registers (gdbarch, tdesc, tdesc_data);
|
|
|
0b42f8 |
+ set_gdbarch_register_name (gdbarch, s390_register_name);
|
|
|
0b42f8 |
|
|
|
0b42f8 |
/* Assign pseudo register numbers. */
|
|
|
0b42f8 |
first_pseudo_reg = gdbarch_num_regs (gdbarch);
|
|
|
0b42f8 |
@@ -3218,6 +3414,12 @@
|
|
|
0b42f8 |
tdep->gpr_full_regnum = last_pseudo_reg;
|
|
|
0b42f8 |
last_pseudo_reg += 16;
|
|
|
0b42f8 |
}
|
|
|
0b42f8 |
+ tdep->v0_full_regnum = -1;
|
|
|
0b42f8 |
+ if (have_vx)
|
|
|
0b42f8 |
+ {
|
|
|
0b42f8 |
+ tdep->v0_full_regnum = last_pseudo_reg;
|
|
|
0b42f8 |
+ last_pseudo_reg += 16;
|
|
|
0b42f8 |
+ }
|
|
|
0b42f8 |
tdep->pc_regnum = last_pseudo_reg++;
|
|
|
0b42f8 |
tdep->cc_regnum = last_pseudo_reg++;
|
|
|
0b42f8 |
set_gdbarch_pc_regnum (gdbarch, tdep->pc_regnum);
|
|
|
0b42f8 |
@@ -3326,8 +3528,12 @@
|
|
|
0b42f8 |
initialize_tdesc_s390_linux64v1 ();
|
|
|
0b42f8 |
initialize_tdesc_s390_linux64v2 ();
|
|
|
0b42f8 |
initialize_tdesc_s390_te_linux64 ();
|
|
|
0b42f8 |
+ initialize_tdesc_s390_vx_linux64 ();
|
|
|
0b42f8 |
+ initialize_tdesc_s390_tevx_linux64 ();
|
|
|
0b42f8 |
initialize_tdesc_s390x_linux64 ();
|
|
|
0b42f8 |
initialize_tdesc_s390x_linux64v1 ();
|
|
|
0b42f8 |
initialize_tdesc_s390x_linux64v2 ();
|
|
|
0b42f8 |
initialize_tdesc_s390x_te_linux64 ();
|
|
|
0b42f8 |
+ initialize_tdesc_s390x_vx_linux64 ();
|
|
|
0b42f8 |
+ initialize_tdesc_s390x_tevx_linux64 ();
|
|
|
0b42f8 |
}
|
|
|
0b42f8 |
Index: gdb-7.6.1/gdb/s390-tdep.h
|
|
|
0b42f8 |
===================================================================
|
|
|
0b42f8 |
--- gdb-7.6.1.orig/gdb/s390-tdep.h 2016-03-19 19:52:23.908620065 +0100
|
|
|
0b42f8 |
+++ gdb-7.6.1/gdb/s390-tdep.h 2016-03-19 19:52:24.428623868 +0100
|
|
|
0b42f8 |
@@ -29,6 +29,10 @@
|
|
|
0b42f8 |
#define HWCAP_S390_TE 1024
|
|
|
0b42f8 |
#endif
|
|
|
0b42f8 |
|
|
|
0b42f8 |
+#ifndef HWCAP_S390_VX
|
|
|
0b42f8 |
+#define HWCAP_S390_VX 2048
|
|
|
0b42f8 |
+#endif
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
/* Register information. */
|
|
|
0b42f8 |
|
|
|
0b42f8 |
/* Program Status Word. */
|
|
|
0b42f8 |
@@ -129,8 +133,41 @@
|
|
|
0b42f8 |
#define S390_TDB_R13_REGNUM 87
|
|
|
0b42f8 |
#define S390_TDB_R14_REGNUM 88
|
|
|
0b42f8 |
#define S390_TDB_R15_REGNUM 89
|
|
|
0b42f8 |
+/* Vector registers. */
|
|
|
0b42f8 |
+#define S390_V0_LOWER_REGNUM 90
|
|
|
0b42f8 |
+#define S390_V1_LOWER_REGNUM 91
|
|
|
0b42f8 |
+#define S390_V2_LOWER_REGNUM 92
|
|
|
0b42f8 |
+#define S390_V3_LOWER_REGNUM 93
|
|
|
0b42f8 |
+#define S390_V4_LOWER_REGNUM 94
|
|
|
0b42f8 |
+#define S390_V5_LOWER_REGNUM 95
|
|
|
0b42f8 |
+#define S390_V6_LOWER_REGNUM 96
|
|
|
0b42f8 |
+#define S390_V7_LOWER_REGNUM 97
|
|
|
0b42f8 |
+#define S390_V8_LOWER_REGNUM 98
|
|
|
0b42f8 |
+#define S390_V9_LOWER_REGNUM 99
|
|
|
0b42f8 |
+#define S390_V10_LOWER_REGNUM 100
|
|
|
0b42f8 |
+#define S390_V11_LOWER_REGNUM 101
|
|
|
0b42f8 |
+#define S390_V12_LOWER_REGNUM 102
|
|
|
0b42f8 |
+#define S390_V13_LOWER_REGNUM 103
|
|
|
0b42f8 |
+#define S390_V14_LOWER_REGNUM 104
|
|
|
0b42f8 |
+#define S390_V15_LOWER_REGNUM 105
|
|
|
0b42f8 |
+#define S390_V16_REGNUM 106
|
|
|
0b42f8 |
+#define S390_V17_REGNUM 107
|
|
|
0b42f8 |
+#define S390_V18_REGNUM 108
|
|
|
0b42f8 |
+#define S390_V19_REGNUM 109
|
|
|
0b42f8 |
+#define S390_V20_REGNUM 110
|
|
|
0b42f8 |
+#define S390_V21_REGNUM 111
|
|
|
0b42f8 |
+#define S390_V22_REGNUM 112
|
|
|
0b42f8 |
+#define S390_V23_REGNUM 113
|
|
|
0b42f8 |
+#define S390_V24_REGNUM 114
|
|
|
0b42f8 |
+#define S390_V25_REGNUM 115
|
|
|
0b42f8 |
+#define S390_V26_REGNUM 116
|
|
|
0b42f8 |
+#define S390_V27_REGNUM 117
|
|
|
0b42f8 |
+#define S390_V28_REGNUM 118
|
|
|
0b42f8 |
+#define S390_V29_REGNUM 119
|
|
|
0b42f8 |
+#define S390_V30_REGNUM 120
|
|
|
0b42f8 |
+#define S390_V31_REGNUM 121
|
|
|
0b42f8 |
/* Total. */
|
|
|
0b42f8 |
-#define S390_NUM_REGS 90
|
|
|
0b42f8 |
+#define S390_NUM_REGS 122
|
|
|
0b42f8 |
|
|
|
0b42f8 |
/* Special register usage. */
|
|
|
0b42f8 |
#define S390_SP_REGNUM S390_R15_REGNUM
|
|
|
0b42f8 |
@@ -160,6 +197,8 @@
|
|
|
0b42f8 |
extern const short s390_regmap_system_call[];
|
|
|
0b42f8 |
extern const short s390_regmap_tdb[];
|
|
|
0b42f8 |
#define s390_sizeof_tdbregset 0x100
|
|
|
0b42f8 |
+extern const short s390_regmap_vxrs_low[];
|
|
|
0b42f8 |
+extern const short s390_regmap_vxrs_high[];
|
|
|
0b42f8 |
|
|
|
0b42f8 |
/* GNU/Linux target descriptions. */
|
|
|
0b42f8 |
extern struct target_desc *tdesc_s390_linux32;
|
|
|
0b42f8 |
@@ -169,10 +208,14 @@
|
|
|
0b42f8 |
extern struct target_desc *tdesc_s390_linux64v1;
|
|
|
0b42f8 |
extern struct target_desc *tdesc_s390_linux64v2;
|
|
|
0b42f8 |
extern struct target_desc *tdesc_s390_te_linux64;
|
|
|
0b42f8 |
+extern struct target_desc *tdesc_s390_vx_linux64;
|
|
|
0b42f8 |
+extern struct target_desc *tdesc_s390_tevx_linux64;
|
|
|
0b42f8 |
extern struct target_desc *tdesc_s390x_linux64;
|
|
|
0b42f8 |
extern struct target_desc *tdesc_s390x_linux64v1;
|
|
|
0b42f8 |
extern struct target_desc *tdesc_s390x_linux64v2;
|
|
|
0b42f8 |
extern struct target_desc *tdesc_s390x_te_linux64;
|
|
|
0b42f8 |
+extern struct target_desc *tdesc_s390x_vx_linux64;
|
|
|
0b42f8 |
+extern struct target_desc *tdesc_s390x_tevx_linux64;
|
|
|
0b42f8 |
|
|
|
0b42f8 |
#endif
|
|
|
0b42f8 |
|