|
|
15e4b0 |
commit ad3396348e0ebb61fdf71cff307bac08175ed366
|
|
|
15e4b0 |
Author: Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
15e4b0 |
Date: Mon Sep 25 16:02:23 2017 +0200
|
|
|
15e4b0 |
|
|
|
15e4b0 |
S390: Add guarded-storage register support to gdbserver
|
|
|
15e4b0 |
|
|
|
15e4b0 |
Enable gdbserver to deal with the new guarded-storage register sets.
|
|
|
15e4b0 |
|
|
|
15e4b0 |
gdb/gdbserver/ChangeLog:
|
|
|
15e4b0 |
|
|
|
15e4b0 |
* configure.srv (s390*-*-linux*): Add s390-gs-linux64.o and
|
|
|
15e4b0 |
s390x-gs-linux64.o to srv_regobj. Add s390-gs-linux64.xml,
|
|
|
15e4b0 |
s390x-gs-linux64.xml, s390-gs.xml, and s390-gsbc.xml to
|
|
|
15e4b0 |
srv_xmlfiles. Add s390-gs-linux64-ipa.o and
|
|
|
15e4b0 |
s390x-gs-linux64-ipa.o to ipa_obj.
|
|
|
15e4b0 |
* linux-s390-low.c (HWCAP_S390_GS): New define.
|
|
|
15e4b0 |
(s390_fill_gs, s390_store_gs, s390_fill_gsbc, s390_store_gsbc):
|
|
|
15e4b0 |
New functions.
|
|
|
15e4b0 |
(s390_regsets): Add regsets for NT_S390_GS_CB and NT_S390_GS_BC.
|
|
|
15e4b0 |
(s390_arch_setup): Check for guarded-storage support and choose
|
|
|
15e4b0 |
appropriate tdesc.
|
|
|
15e4b0 |
(initialize_low_arch): Invoke init_registers_s390_gs_linux64 and
|
|
|
15e4b0 |
init_registers_s390x_gs_linux64.
|
|
|
15e4b0 |
* linux-s390-tdesc.h (enum s390_linux_tdesc) <S390_TDESC_GS>: New
|
|
|
15e4b0 |
enum value.
|
|
|
15e4b0 |
(init_registers_s390x_gs_linux64, tdesc_s390x_gs_linux64)
|
|
|
15e4b0 |
(init_registers_s390_gs_linux64, tdesc_s390_gs_linux64): Declare.
|
|
|
15e4b0 |
|
|
|
15e4b0 |
### a/gdb/gdbserver/ChangeLog
|
|
|
15e4b0 |
### b/gdb/gdbserver/ChangeLog
|
|
|
15e4b0 |
## -1,3 +1,23 @@
|
|
|
15e4b0 |
+2017-09-25 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
15e4b0 |
+
|
|
|
15e4b0 |
+ * configure.srv (s390*-*-linux*): Add s390-gs-linux64.o and
|
|
|
15e4b0 |
+ s390x-gs-linux64.o to srv_regobj. Add s390-gs-linux64.xml,
|
|
|
15e4b0 |
+ s390x-gs-linux64.xml, s390-gs.xml, and s390-gsbc.xml to
|
|
|
15e4b0 |
+ srv_xmlfiles. Add s390-gs-linux64-ipa.o and
|
|
|
15e4b0 |
+ s390x-gs-linux64-ipa.o to ipa_obj.
|
|
|
15e4b0 |
+ * linux-s390-low.c (HWCAP_S390_GS): New define.
|
|
|
15e4b0 |
+ (s390_fill_gs, s390_store_gs, s390_fill_gsbc, s390_store_gsbc):
|
|
|
15e4b0 |
+ New functions.
|
|
|
15e4b0 |
+ (s390_regsets): Add regsets for NT_S390_GS_CB and NT_S390_GS_BC.
|
|
|
15e4b0 |
+ (s390_arch_setup): Check for guarded-storage support and choose
|
|
|
15e4b0 |
+ appropriate tdesc.
|
|
|
15e4b0 |
+ (initialize_low_arch): Invoke init_registers_s390_gs_linux64 and
|
|
|
15e4b0 |
+ init_registers_s390x_gs_linux64.
|
|
|
15e4b0 |
+ * linux-s390-tdesc.h (enum s390_linux_tdesc) <S390_TDESC_GS>: New
|
|
|
15e4b0 |
+ enum value.
|
|
|
15e4b0 |
+ (init_registers_s390x_gs_linux64, tdesc_s390x_gs_linux64)
|
|
|
15e4b0 |
+ (init_registers_s390_gs_linux64, tdesc_s390_gs_linux64): Declare.
|
|
|
15e4b0 |
+
|
|
|
15e4b0 |
2017-09-22 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
15e4b0 |
|
|
|
15e4b0 |
* win32-i386-low.c (i386_arch_setup): Call init_target_desc.
|
|
|
15e4b0 |
--- a/gdb/gdbserver/configure.srv
|
|
|
15e4b0 |
+++ b/gdb/gdbserver/configure.srv
|
|
|
15e4b0 |
@@ -285,12 +285,14 @@ case "${target}" in
|
|
|
15e4b0 |
srv_regobj="${srv_regobj} s390-te-linux64.o"
|
|
|
15e4b0 |
srv_regobj="${srv_regobj} s390-vx-linux64.o"
|
|
|
15e4b0 |
srv_regobj="${srv_regobj} s390-tevx-linux64.o"
|
|
|
15e4b0 |
+ srv_regobj="${srv_regobj} s390-gs-linux64.o"
|
|
|
15e4b0 |
srv_regobj="${srv_regobj} s390x-linux64.o"
|
|
|
15e4b0 |
srv_regobj="${srv_regobj} s390x-linux64v1.o"
|
|
|
15e4b0 |
srv_regobj="${srv_regobj} s390x-linux64v2.o"
|
|
|
15e4b0 |
srv_regobj="${srv_regobj} s390x-te-linux64.o"
|
|
|
15e4b0 |
srv_regobj="${srv_regobj} s390x-vx-linux64.o"
|
|
|
15e4b0 |
srv_regobj="${srv_regobj} s390x-tevx-linux64.o"
|
|
|
15e4b0 |
+ srv_regobj="${srv_regobj} s390x-gs-linux64.o"
|
|
|
15e4b0 |
srv_tgtobj="$srv_linux_obj linux-s390-low.o"
|
|
|
15e4b0 |
srv_xmlfiles="s390-linux32.xml"
|
|
|
15e4b0 |
srv_xmlfiles="${srv_xmlfiles} s390-linux32v1.xml"
|
|
|
15e4b0 |
@@ -301,12 +303,14 @@ case "${target}" in
|
|
|
15e4b0 |
srv_xmlfiles="${srv_xmlfiles} s390-te-linux64.xml"
|
|
|
15e4b0 |
srv_xmlfiles="${srv_xmlfiles} s390-vx-linux64.xml"
|
|
|
15e4b0 |
srv_xmlfiles="${srv_xmlfiles} s390-tevx-linux64.xml"
|
|
|
15e4b0 |
+ srv_xmlfiles="${srv_xmlfiles} s390-gs-linux64.xml"
|
|
|
15e4b0 |
srv_xmlfiles="${srv_xmlfiles} s390x-linux64.xml"
|
|
|
15e4b0 |
srv_xmlfiles="${srv_xmlfiles} s390x-linux64v1.xml"
|
|
|
15e4b0 |
srv_xmlfiles="${srv_xmlfiles} s390x-linux64v2.xml"
|
|
|
15e4b0 |
srv_xmlfiles="${srv_xmlfiles} s390x-te-linux64.xml"
|
|
|
15e4b0 |
srv_xmlfiles="${srv_xmlfiles} s390x-vx-linux64.xml"
|
|
|
15e4b0 |
srv_xmlfiles="${srv_xmlfiles} s390x-tevx-linux64.xml"
|
|
|
15e4b0 |
+ srv_xmlfiles="${srv_xmlfiles} s390x-gs-linux64.xml"
|
|
|
15e4b0 |
srv_xmlfiles="${srv_xmlfiles} s390-core32.xml"
|
|
|
15e4b0 |
srv_xmlfiles="${srv_xmlfiles} s390-core64.xml"
|
|
|
15e4b0 |
srv_xmlfiles="${srv_xmlfiles} s390x-core64.xml"
|
|
|
15e4b0 |
@@ -314,6 +318,8 @@ case "${target}" in
|
|
|
15e4b0 |
srv_xmlfiles="${srv_xmlfiles} s390-fpr.xml"
|
|
|
15e4b0 |
srv_xmlfiles="${srv_xmlfiles} s390-tdb.xml"
|
|
|
15e4b0 |
srv_xmlfiles="${srv_xmlfiles} s390-vx.xml"
|
|
|
15e4b0 |
+ srv_xmlfiles="${srv_xmlfiles} s390-gs.xml"
|
|
|
15e4b0 |
+ srv_xmlfiles="${srv_xmlfiles} s390-gsbc.xml"
|
|
|
15e4b0 |
srv_linux_usrregs=yes
|
|
|
15e4b0 |
srv_linux_regsets=yes
|
|
|
15e4b0 |
srv_linux_thread_db=yes
|
|
|
15e4b0 |
@@ -327,12 +333,14 @@ case "${target}" in
|
|
|
15e4b0 |
ipa_obj="${ipa_obj} s390-vx-linux64-ipa.o"
|
|
|
15e4b0 |
ipa_obj="${ipa_obj} s390-te-linux64-ipa.o"
|
|
|
15e4b0 |
ipa_obj="${ipa_obj} s390-tevx-linux64-ipa.o"
|
|
|
15e4b0 |
+ ipa_obj="${ipa_obj} s390-gs-linux64-ipa.o"
|
|
|
15e4b0 |
ipa_obj="${ipa_obj} s390x-linux64-ipa.o"
|
|
|
15e4b0 |
ipa_obj="${ipa_obj} s390x-linux64v1-ipa.o"
|
|
|
15e4b0 |
ipa_obj="${ipa_obj} s390x-linux64v2-ipa.o"
|
|
|
15e4b0 |
ipa_obj="${ipa_obj} s390x-vx-linux64-ipa.o"
|
|
|
15e4b0 |
ipa_obj="${ipa_obj} s390x-te-linux64-ipa.o"
|
|
|
15e4b0 |
ipa_obj="${ipa_obj} s390x-tevx-linux64-ipa.o"
|
|
|
15e4b0 |
+ ipa_obj="${ipa_obj} s390x-gs-linux64-ipa.o"
|
|
|
15e4b0 |
;;
|
|
|
15e4b0 |
sh*-*-linux*) srv_regobj=reg-sh.o
|
|
|
15e4b0 |
srv_tgtobj="$srv_linux_obj linux-sh-low.o"
|
|
|
15e4b0 |
--- a/gdb/gdbserver/linux-s390-low.c
|
|
|
15e4b0 |
+++ b/gdb/gdbserver/linux-s390-low.c
|
|
|
15e4b0 |
@@ -45,6 +45,10 @@
|
|
|
15e4b0 |
#define HWCAP_S390_VX 2048
|
|
|
15e4b0 |
#endif
|
|
|
15e4b0 |
|
|
|
15e4b0 |
+#ifndef HWCAP_S390_GS
|
|
|
15e4b0 |
+#define HWCAP_S390_GS 16384
|
|
|
15e4b0 |
+#endif
|
|
|
15e4b0 |
+
|
|
|
15e4b0 |
#define s390_num_regs 52
|
|
|
15e4b0 |
|
|
|
15e4b0 |
static int s390_regmap[] = {
|
|
|
15e4b0 |
@@ -370,6 +374,46 @@ s390_store_vxrs_high (struct regcache *regcache, const void *buf)
|
|
|
15e4b0 |
supply_register (regcache, v16 + i, (const char *) buf + 16 * i);
|
|
|
15e4b0 |
}
|
|
|
15e4b0 |
|
|
|
15e4b0 |
+static void
|
|
|
15e4b0 |
+s390_fill_gs (struct regcache *regcache, void *buf)
|
|
|
15e4b0 |
+{
|
|
|
15e4b0 |
+ int gsd = find_regno (regcache->tdesc, "gsd");
|
|
|
15e4b0 |
+ int i;
|
|
|
15e4b0 |
+
|
|
|
15e4b0 |
+ for (i = 0; i < 3; i++)
|
|
|
15e4b0 |
+ collect_register (regcache, gsd + i, (char *) buf + 8 * (i + 1));
|
|
|
15e4b0 |
+}
|
|
|
15e4b0 |
+
|
|
|
15e4b0 |
+static void
|
|
|
15e4b0 |
+s390_store_gs (struct regcache *regcache, const void *buf)
|
|
|
15e4b0 |
+{
|
|
|
15e4b0 |
+ int gsd = find_regno (regcache->tdesc, "gsd");
|
|
|
15e4b0 |
+ int i;
|
|
|
15e4b0 |
+
|
|
|
15e4b0 |
+ for (i = 0; i < 3; i++)
|
|
|
15e4b0 |
+ supply_register (regcache, gsd + i, (const char *) buf + 8 * (i + 1));
|
|
|
15e4b0 |
+}
|
|
|
15e4b0 |
+
|
|
|
15e4b0 |
+static void
|
|
|
15e4b0 |
+s390_fill_gsbc (struct regcache *regcache, void *buf)
|
|
|
15e4b0 |
+{
|
|
|
15e4b0 |
+ int bc_gsd = find_regno (regcache->tdesc, "bc_gsd");
|
|
|
15e4b0 |
+ int i;
|
|
|
15e4b0 |
+
|
|
|
15e4b0 |
+ for (i = 0; i < 3; i++)
|
|
|
15e4b0 |
+ collect_register (regcache, bc_gsd + i, (char *) buf + 8 * (i + 1));
|
|
|
15e4b0 |
+}
|
|
|
15e4b0 |
+
|
|
|
15e4b0 |
+static void
|
|
|
15e4b0 |
+s390_store_gsbc (struct regcache *regcache, const void *buf)
|
|
|
15e4b0 |
+{
|
|
|
15e4b0 |
+ int bc_gsd = find_regno (regcache->tdesc, "bc_gsd");
|
|
|
15e4b0 |
+ int i;
|
|
|
15e4b0 |
+
|
|
|
15e4b0 |
+ for (i = 0; i < 3; i++)
|
|
|
15e4b0 |
+ supply_register (regcache, bc_gsd + i, (const char *) buf + 8 * (i + 1));
|
|
|
15e4b0 |
+}
|
|
|
15e4b0 |
+
|
|
|
15e4b0 |
static struct regset_info s390_regsets[] = {
|
|
|
15e4b0 |
{ 0, 0, 0, 0, GENERAL_REGS, s390_fill_gregset, NULL },
|
|
|
15e4b0 |
#ifndef __s390x__
|
|
|
15e4b0 |
@@ -388,6 +432,10 @@ static struct regset_info s390_regsets[] = {
|
|
|
15e4b0 |
EXTENDED_REGS, s390_fill_vxrs_low, s390_store_vxrs_low },
|
|
|
15e4b0 |
{ PTRACE_GETREGSET, PTRACE_SETREGSET, NT_S390_VXRS_HIGH, 0,
|
|
|
15e4b0 |
EXTENDED_REGS, s390_fill_vxrs_high, s390_store_vxrs_high },
|
|
|
15e4b0 |
+ { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_S390_GS_CB, 0,
|
|
|
15e4b0 |
+ EXTENDED_REGS, s390_fill_gs, s390_store_gs },
|
|
|
15e4b0 |
+ { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_S390_GS_BC, 0,
|
|
|
15e4b0 |
+ EXTENDED_REGS, s390_fill_gsbc, s390_store_gsbc },
|
|
|
15e4b0 |
NULL_REGSET
|
|
|
15e4b0 |
};
|
|
|
15e4b0 |
|
|
|
15e4b0 |
@@ -501,6 +549,8 @@ s390_arch_setup (void)
|
|
|
15e4b0 |
int have_regset_tdb = s390_check_regset (pid, NT_S390_TDB, 256);
|
|
|
15e4b0 |
int have_regset_vxrs = s390_check_regset (pid, NT_S390_VXRS_LOW, 128)
|
|
|
15e4b0 |
&& s390_check_regset (pid, NT_S390_VXRS_HIGH, 256);
|
|
|
15e4b0 |
+ int have_regset_gs = s390_check_regset (pid, NT_S390_GS_CB, 32)
|
|
|
15e4b0 |
+ && s390_check_regset (pid, NT_S390_GS_BC, 32);
|
|
|
15e4b0 |
|
|
|
15e4b0 |
/* Assume 31-bit inferior process. */
|
|
|
15e4b0 |
if (have_regset_system_call)
|
|
|
15e4b0 |
@@ -529,8 +579,13 @@ s390_arch_setup (void)
|
|
|
15e4b0 |
if (have_regset_vxrs)
|
|
|
15e4b0 |
have_regset_vxrs =
|
|
|
15e4b0 |
(s390_get_hwcap (tdesc_s390x_linux64v2) & HWCAP_S390_VX) != 0;
|
|
|
15e4b0 |
+ if (have_regset_gs)
|
|
|
15e4b0 |
+ have_regset_gs =
|
|
|
15e4b0 |
+ (s390_get_hwcap (tdesc_s390x_linux64v2) & HWCAP_S390_GS) != 0;
|
|
|
15e4b0 |
|
|
|
15e4b0 |
- if (have_regset_vxrs)
|
|
|
15e4b0 |
+ if (have_regset_gs)
|
|
|
15e4b0 |
+ tdesc = tdesc_s390x_gs_linux64;
|
|
|
15e4b0 |
+ else if (have_regset_vxrs)
|
|
|
15e4b0 |
tdesc = (have_regset_tdb ? tdesc_s390x_tevx_linux64 :
|
|
|
15e4b0 |
tdesc_s390x_vx_linux64);
|
|
|
15e4b0 |
else if (have_regset_tdb)
|
|
|
15e4b0 |
@@ -554,8 +609,12 @@ s390_arch_setup (void)
|
|
|
15e4b0 |
have_regset_tdb = (s390_get_hwcap (tdesc) & HWCAP_S390_TE) != 0;
|
|
|
15e4b0 |
if (have_regset_vxrs)
|
|
|
15e4b0 |
have_regset_vxrs = (s390_get_hwcap (tdesc) & HWCAP_S390_VX) != 0;
|
|
|
15e4b0 |
+ if (have_regset_gs)
|
|
|
15e4b0 |
+ have_regset_gs = (s390_get_hwcap (tdesc) & HWCAP_S390_GS) != 0;
|
|
|
15e4b0 |
|
|
|
15e4b0 |
- if (have_regset_vxrs)
|
|
|
15e4b0 |
+ if (have_regset_gs)
|
|
|
15e4b0 |
+ tdesc = tdesc_s390_gs_linux64;
|
|
|
15e4b0 |
+ else if (have_regset_vxrs)
|
|
|
15e4b0 |
tdesc = (have_regset_tdb ? tdesc_s390_tevx_linux64 :
|
|
|
15e4b0 |
tdesc_s390_vx_linux64);
|
|
|
15e4b0 |
else if (have_regset_tdb)
|
|
|
15e4b0 |
@@ -596,6 +655,9 @@ s390_arch_setup (void)
|
|
|
15e4b0 |
case NT_S390_VXRS_HIGH:
|
|
|
15e4b0 |
regset->size = have_regset_vxrs ? 256 : 0;
|
|
|
15e4b0 |
break;
|
|
|
15e4b0 |
+ case NT_S390_GS_CB:
|
|
|
15e4b0 |
+ case NT_S390_GS_BC:
|
|
|
15e4b0 |
+ regset->size = have_regset_gs ? 32 : 0;
|
|
|
15e4b0 |
default:
|
|
|
15e4b0 |
break;
|
|
|
15e4b0 |
}
|
|
|
15e4b0 |
@@ -2797,6 +2859,7 @@ initialize_low_arch (void)
|
|
|
15e4b0 |
init_registers_s390_te_linux64 ();
|
|
|
15e4b0 |
init_registers_s390_vx_linux64 ();
|
|
|
15e4b0 |
init_registers_s390_tevx_linux64 ();
|
|
|
15e4b0 |
+ init_registers_s390_gs_linux64 ();
|
|
|
15e4b0 |
#ifdef __s390x__
|
|
|
15e4b0 |
init_registers_s390x_linux64 ();
|
|
|
15e4b0 |
init_registers_s390x_linux64v1 ();
|
|
|
15e4b0 |
@@ -2804,6 +2867,7 @@ initialize_low_arch (void)
|
|
|
15e4b0 |
init_registers_s390x_te_linux64 ();
|
|
|
15e4b0 |
init_registers_s390x_vx_linux64 ();
|
|
|
15e4b0 |
init_registers_s390x_tevx_linux64 ();
|
|
|
15e4b0 |
+ init_registers_s390x_gs_linux64 ();
|
|
|
15e4b0 |
#endif
|
|
|
15e4b0 |
|
|
|
15e4b0 |
initialize_regsets_info (&s390_regsets_info);
|
|
|
15e4b0 |
--- a/gdb/gdbserver/linux-s390-tdesc.h
|
|
|
15e4b0 |
+++ b/gdb/gdbserver/linux-s390-tdesc.h
|
|
|
15e4b0 |
@@ -31,6 +31,7 @@ enum s390_linux_tdesc {
|
|
|
15e4b0 |
S390_TDESC_TE,
|
|
|
15e4b0 |
S390_TDESC_VX,
|
|
|
15e4b0 |
S390_TDESC_TEVX,
|
|
|
15e4b0 |
+ S390_TDESC_GS,
|
|
|
15e4b0 |
};
|
|
|
15e4b0 |
|
|
|
15e4b0 |
#ifdef __s390x__
|
|
|
15e4b0 |
@@ -59,6 +60,10 @@ extern const struct target_desc *tdesc_s390x_vx_linux64;
|
|
|
15e4b0 |
void init_registers_s390x_tevx_linux64 (void);
|
|
|
15e4b0 |
extern const struct target_desc *tdesc_s390x_tevx_linux64;
|
|
|
15e4b0 |
|
|
|
15e4b0 |
+/* Defined in auto-generated file s390x-gs-linux64.c. */
|
|
|
15e4b0 |
+void init_registers_s390x_gs_linux64 (void);
|
|
|
15e4b0 |
+extern const struct target_desc *tdesc_s390x_gs_linux64;
|
|
|
15e4b0 |
+
|
|
|
15e4b0 |
#endif
|
|
|
15e4b0 |
|
|
|
15e4b0 |
#if !defined __s390x__ || !defined IN_PROCESS_AGENT
|
|
|
15e4b0 |
@@ -99,4 +104,8 @@ extern const struct target_desc *tdesc_s390_vx_linux64;
|
|
|
15e4b0 |
void init_registers_s390_tevx_linux64 (void);
|
|
|
15e4b0 |
extern const struct target_desc *tdesc_s390_tevx_linux64;
|
|
|
15e4b0 |
|
|
|
15e4b0 |
+/* Defined in auto-generated file s390-gs-linux64.c. */
|
|
|
15e4b0 |
+void init_registers_s390_gs_linux64 (void);
|
|
|
15e4b0 |
+extern const struct target_desc *tdesc_s390_gs_linux64;
|
|
|
15e4b0 |
+
|
|
|
15e4b0 |
#endif
|