Accepting request 342250 from devel:gcc
- Rebase to gdb version 7.9.1: fixes PR python/18299, python/18285. - Add gdb-s390-reorder-arch.diff [bnc #936050] - Added patches for fate#318039, s390 z13 support: 0001-S390-Fix-compiler-invocation-with-compile-command.patch 0001-S390-Support-new-vector-register-sections.patch 0001-S390-Add-target-descriptions-for-vector-register-set.patch 0002-S390-Add-vector-register-support-to-gdb.patch 0003-S390-Add-vector-register-support-to-gdbserver.patch 0004-S390-Vector-register-test-case.patch 0005-S390-Name-invisible-registers-with-the-empty-string-.patch OBS-URL: https://build.opensuse.org/request/show/342250 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/gdb?expand=0&rev=107
This commit is contained in:
commit
ff70ab1c17
1471
0001-S390-Add-target-descriptions-for-vector-register-set.patch
Normal file
1471
0001-S390-Add-target-descriptions-for-vector-register-set.patch
Normal file
File diff suppressed because it is too large
Load Diff
73
0001-S390-Fix-compiler-invocation-with-compile-command.patch
Normal file
73
0001-S390-Fix-compiler-invocation-with-compile-command.patch
Normal file
@ -0,0 +1,73 @@
|
||||
From 60abeae4f219a7a445d11ebaf72d2939413ffe80 Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Arnez <arnez@linux.vnet.ibm.com>
|
||||
Date: Fri, 27 Feb 2015 10:47:54 +0100
|
||||
Subject: [PATCH] S390: Fix compiler invocation with "compile" command
|
||||
|
||||
On 64-bit S390 platforms the "compile" command always failed because
|
||||
gcc was not invoked correctly. This patch fixes the compiler
|
||||
invocation.
|
||||
|
||||
gdb/ChangeLog:
|
||||
|
||||
* s390-linux-tdep.c (s390_gcc_target_options): Not just handle
|
||||
31-bit targets, but 64-bit targets as well.
|
||||
(s390_gnu_triplet_regexp): New function.
|
||||
(s390_gdbarch_init): Set the gcc_target_options gdbarch method for
|
||||
64-bit targets as well. Set the gnu_triplet_regexp gdbarch
|
||||
method.
|
||||
---
|
||||
gdb/ChangeLog | 9 +++++++++
|
||||
gdb/s390-linux-tdep.c | 19 ++++++++++++++++---
|
||||
2 files changed, 25 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/gdb/s390-linux-tdep.c b/gdb/s390-linux-tdep.c
|
||||
index 9bd25fe..803779c 100644
|
||||
--- a/gdb/s390-linux-tdep.c
|
||||
+++ b/gdb/s390-linux-tdep.c
|
||||
@@ -2808,12 +2808,24 @@ s390_address_class_name_to_type_flags (struct gdbarch *gdbarch,
|
||||
return 0;
|
||||
}
|
||||
|
||||
-/* Implement gdbarch_gcc_target_options. GCC does not know "-m32". */
|
||||
+/* Implement gdbarch_gcc_target_options. GCC does not know "-m32" or
|
||||
+ "-mcmodel=large". */
|
||||
|
||||
static char *
|
||||
s390_gcc_target_options (struct gdbarch *gdbarch)
|
||||
{
|
||||
- return xstrdup ("-m31");
|
||||
+ return xstrdup (gdbarch_ptr_bit (gdbarch) == 64 ? "-m64" : "-m31");
|
||||
+}
|
||||
+
|
||||
+/* Implement gdbarch_gnu_triplet_regexp. Target triplets are "s390-*"
|
||||
+ for 31-bit and "s390x-*" for 64-bit, while the BFD arch name is
|
||||
+ always "s390". Note that an s390x compiler supports "-m31" as
|
||||
+ well. */
|
||||
+
|
||||
+static const char *
|
||||
+s390_gnu_triplet_regexp (struct gdbarch *gdbarch)
|
||||
+{
|
||||
+ return "s390x?";
|
||||
}
|
||||
|
||||
/* Implementation of `gdbarch_stap_is_single_operand', as defined in
|
||||
@@ -3112,7 +3124,6 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
{
|
||||
case ABI_LINUX_S390:
|
||||
set_gdbarch_addr_bits_remove (gdbarch, s390_addr_bits_remove);
|
||||
- set_gdbarch_gcc_target_options (gdbarch, s390_gcc_target_options);
|
||||
set_solib_svr4_fetch_link_map_offsets
|
||||
(gdbarch, svr4_ilp32_fetch_link_map_offsets);
|
||||
|
||||
@@ -3152,6 +3163,8 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
set_gdbarch_stap_register_indirection_suffixes (gdbarch,
|
||||
stap_register_indirection_suffixes);
|
||||
set_gdbarch_stap_is_single_operand (gdbarch, s390_stap_is_single_operand);
|
||||
+ set_gdbarch_gcc_target_options (gdbarch, s390_gcc_target_options);
|
||||
+ set_gdbarch_gnu_triplet_regexp (gdbarch, s390_gnu_triplet_regexp);
|
||||
|
||||
return gdbarch;
|
||||
}
|
||||
--
|
||||
1.8.1.4
|
||||
|
157
0001-S390-Support-new-vector-register-sections.patch
Normal file
157
0001-S390-Support-new-vector-register-sections.patch
Normal file
@ -0,0 +1,157 @@
|
||||
From 4ef9f41a9538c9c7e4e540277e437b137cb64c4c Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Arnez <arnez@linux.vnet.ibm.com>
|
||||
Date: Fri, 20 Feb 2015 10:39:53 +0100
|
||||
Subject: [PATCH] S390: Support new vector register sections
|
||||
|
||||
The IBM z13 has new 128-bit wide vector registers v0-v31, where v0-v15
|
||||
include the existing 64-bit wide floating point registers. The Linux
|
||||
kernel presents the vector registers as two additional register sets,
|
||||
one for the right halves of v0-v15 and another one for the full
|
||||
registers v16-v31. Thus a new core file may contain two new register
|
||||
note sections, and this patch adds support to binutils for them.
|
||||
|
||||
bfd/
|
||||
* elf-bfd.h (elfcore_write_s390_vxrs_low): Add prototype.
|
||||
(elfcore_write_s390_vxrs_high): Likewise.
|
||||
* elf.c (elfcore_grok_s390_vxrs_low): New function.
|
||||
(elfcore_grok_s390_vxrs_high): New function.
|
||||
(elfcore_grok_note): Call them.
|
||||
(elfcore_write_s390_vxrs_low): New function.
|
||||
(elfcore_write_s390_vxrs_high): New function.
|
||||
(elfcore_write_register_note): Call them.
|
||||
|
||||
binutils/
|
||||
* readelf.c (get_note_type): Add NT_S390_VXRS_LOW and
|
||||
NT_S390_VXRS_HIGH.
|
||||
|
||||
include/elf/
|
||||
* common.h (NT_S390_VXRS_LOW): New macro.
|
||||
(NT_S390_VXRS_HIGH): Likewise.
|
||||
---
|
||||
bfd/ChangeLog | 11 +++++++++++
|
||||
bfd/elf-bfd.h | 4 ++++
|
||||
bfd/elf.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
include/elf/ChangeLog | 5 +++++
|
||||
include/elf/common.h | 4 ++++
|
||||
7 files changed, 88 insertions(+)
|
||||
|
||||
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
|
||||
index 495053d..156eec7 100644
|
||||
--- a/bfd/elf-bfd.h
|
||||
+++ b/bfd/elf-bfd.h
|
||||
@@ -2285,6 +2285,10 @@ extern char *elfcore_write_s390_system_call
|
||||
(bfd *, char *, int *, const void *, int);
|
||||
extern char *elfcore_write_s390_tdb
|
||||
(bfd *, char *, int *, const void *, int);
|
||||
+extern char *elfcore_write_s390_vxrs_low
|
||||
+ (bfd *, char *, int *, const void *, int);
|
||||
+extern char *elfcore_write_s390_vxrs_high
|
||||
+ (bfd *, char *, int *, const void *, int);
|
||||
extern char *elfcore_write_arm_vfp
|
||||
(bfd *, char *, int *, const void *, int);
|
||||
extern char *elfcore_write_aarch_tls
|
||||
diff --git a/bfd/elf.c b/bfd/elf.c
|
||||
index 0aa5f8e..14bc531 100644
|
||||
--- a/bfd/elf.c
|
||||
+++ b/bfd/elf.c
|
||||
@@ -8251,6 +8251,18 @@ elfcore_grok_s390_tdb (bfd *abfd, Elf_Internal_Note *note)
|
||||
}
|
||||
|
||||
static bfd_boolean
|
||||
+elfcore_grok_s390_vxrs_low (bfd *abfd, Elf_Internal_Note *note)
|
||||
+{
|
||||
+ return elfcore_make_note_pseudosection (abfd, ".reg-s390-vxrs-low", note);
|
||||
+}
|
||||
+
|
||||
+static bfd_boolean
|
||||
+elfcore_grok_s390_vxrs_high (bfd *abfd, Elf_Internal_Note *note)
|
||||
+{
|
||||
+ return elfcore_make_note_pseudosection (abfd, ".reg-s390-vxrs-high", note);
|
||||
+}
|
||||
+
|
||||
+static bfd_boolean
|
||||
elfcore_grok_arm_vfp (bfd *abfd, Elf_Internal_Note *note)
|
||||
{
|
||||
return elfcore_make_note_pseudosection (abfd, ".reg-arm-vfp", note);
|
||||
@@ -8714,6 +8726,20 @@ elfcore_grok_note (bfd *abfd, Elf_Internal_Note *note)
|
||||
else
|
||||
return TRUE;
|
||||
|
||||
+ case NT_S390_VXRS_LOW:
|
||||
+ if (note->namesz == 6
|
||||
+ && strcmp (note->namedata, "LINUX") == 0)
|
||||
+ return elfcore_grok_s390_vxrs_low (abfd, note);
|
||||
+ else
|
||||
+ return TRUE;
|
||||
+
|
||||
+ case NT_S390_VXRS_HIGH:
|
||||
+ if (note->namesz == 6
|
||||
+ && strcmp (note->namedata, "LINUX") == 0)
|
||||
+ return elfcore_grok_s390_vxrs_high (abfd, note);
|
||||
+ else
|
||||
+ return TRUE;
|
||||
+
|
||||
case NT_ARM_VFP:
|
||||
if (note->namesz == 6
|
||||
&& strcmp (note->namedata, "LINUX") == 0)
|
||||
@@ -9580,6 +9606,31 @@ elfcore_write_s390_tdb (bfd *abfd,
|
||||
}
|
||||
|
||||
char *
|
||||
+elfcore_write_s390_vxrs_low (bfd *abfd,
|
||||
+ char *buf,
|
||||
+ int *bufsiz,
|
||||
+ const void *s390_vxrs_low,
|
||||
+ int size)
|
||||
+{
|
||||
+ char *note_name = "LINUX";
|
||||
+ return elfcore_write_note (abfd, buf, bufsiz,
|
||||
+ note_name, NT_S390_VXRS_LOW, s390_vxrs_low, size);
|
||||
+}
|
||||
+
|
||||
+char *
|
||||
+elfcore_write_s390_vxrs_high (bfd *abfd,
|
||||
+ char *buf,
|
||||
+ int *bufsiz,
|
||||
+ const void *s390_vxrs_high,
|
||||
+ int size)
|
||||
+{
|
||||
+ char *note_name = "LINUX";
|
||||
+ return elfcore_write_note (abfd, buf, bufsiz,
|
||||
+ note_name, NT_S390_VXRS_HIGH,
|
||||
+ s390_vxrs_high, size);
|
||||
+}
|
||||
+
|
||||
+char *
|
||||
elfcore_write_arm_vfp (bfd *abfd,
|
||||
char *buf,
|
||||
int *bufsiz,
|
||||
@@ -9663,6 +9714,10 @@ elfcore_write_register_note (bfd *abfd,
|
||||
return elfcore_write_s390_system_call (abfd, buf, bufsiz, data, size);
|
||||
if (strcmp (section, ".reg-s390-tdb") == 0)
|
||||
return elfcore_write_s390_tdb (abfd, buf, bufsiz, data, size);
|
||||
+ if (strcmp (section, ".reg-s390-vxrs-low") == 0)
|
||||
+ return elfcore_write_s390_vxrs_low (abfd, buf, bufsiz, data, size);
|
||||
+ if (strcmp (section, ".reg-s390-vxrs-high") == 0)
|
||||
+ return elfcore_write_s390_vxrs_high (abfd, buf, bufsiz, data, size);
|
||||
if (strcmp (section, ".reg-arm-vfp") == 0)
|
||||
return elfcore_write_arm_vfp (abfd, buf, bufsiz, data, size);
|
||||
if (strcmp (section, ".reg-aarch-tls") == 0)
|
||||
diff --git a/include/elf/common.h b/include/elf/common.h
|
||||
index ae7b5f8..70778bf 100644
|
||||
--- a/include/elf/common.h
|
||||
+++ b/include/elf/common.h
|
||||
@@ -557,6 +557,10 @@
|
||||
/* note name must be "LINUX". */
|
||||
#define NT_S390_TDB 0x308 /* S390 transaction diagnostic block */
|
||||
/* note name must be "LINUX". */
|
||||
+#define NT_S390_VXRS_LOW 0x309 /* S390 vector registers 0-15 upper half */
|
||||
+ /* note name must be "LINUX". */
|
||||
+#define NT_S390_VXRS_HIGH 0x30a /* S390 vector registers 16-31 */
|
||||
+ /* note name must be "LINUX". */
|
||||
#define NT_ARM_VFP 0x400 /* ARM VFP registers */
|
||||
/* The following definitions should really use NT_AARCH_..., but defined
|
||||
this way for compatibility with Linux. */
|
||||
--
|
||||
1.8.1.4
|
||||
|
744
0002-S390-Add-vector-register-support-to-gdb.patch
Normal file
744
0002-S390-Add-vector-register-support-to-gdb.patch
Normal file
@ -0,0 +1,744 @@
|
||||
Part of fate#318039
|
||||
|
||||
From 550bdf96cae94bc3e6c0f7e7e9a6793399dd8fe6 Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Arnez <arnez@linux.vnet.ibm.com>
|
||||
Date: Mon, 2 Mar 2015 10:57:39 +0100
|
||||
Subject: [PATCH] S390: Add vector register support to gdb
|
||||
|
||||
Recognize S/390 targets with the new vector feature and present their
|
||||
vector registers appropriately: as 32 new 128-bit wide registers
|
||||
v0-v31, where the first 16 embed the floating point registers f0-f15.
|
||||
Each of the full registers v0-v15 is modelled as a pseudo register.
|
||||
|
||||
gdb/ChangeLog:
|
||||
|
||||
* s390-linux-nat.c (have_regset_vxrs): New static variable.
|
||||
(s390_linux_fetch_inferior_registers): Handle vector registers, if
|
||||
present.
|
||||
(s390_linux_store_inferior_registers): Likewise.
|
||||
(s390_get_hwcap): Remove function. Embed its logic...
|
||||
(s390_read_description): ...here. Yield a target description with
|
||||
vector registers if applicable.
|
||||
* s390-linux-tdep.c: Include "features/s390-vx-linux64.c",
|
||||
"features/s390-tevx-linux64.c", "features/s390x-vx-linux64.c", and
|
||||
"features/s390x-tevx-linux64.c".
|
||||
(struct gdbarch_tdep) <v0_full_regnum>: New field.
|
||||
(s390_dwarf_regmap): Add vector registers. Remove bogus entries
|
||||
for "GNU/Linux-specific registers".
|
||||
(s390_dwarf_reg_r0l): New enum value.
|
||||
(s390_dwarf_reg_to_regnum): Support vector registers.
|
||||
(s390_adjust_frame_regnum): Adjust pseudo DWARF register numbers
|
||||
of GPR lower halves.
|
||||
(regnum_is_vxr_full): New function.
|
||||
(s390_register_name): New function.
|
||||
(s390_pseudo_register_name): Handle v0-v15, which are composed of
|
||||
f0-f15 and v0l-v15l.
|
||||
(s390_pseudo_register_type): Likewise.
|
||||
(s390_pseudo_register_read): Likewise.
|
||||
(s390_pseudo_register_write): Likewise.
|
||||
(s390_value_from_register): Account for the fact that values are
|
||||
placed left-justified in vector registers.
|
||||
(s390_pseudo_register_reggroup_p): Add pseudo registers v0-v15 to
|
||||
the vector reggroup and omit them from the general reggroup.
|
||||
(s390_regmap_vxrs_low, s390_regmap_vxrs_high): New register maps.
|
||||
(s390_vxrs_low_regset, s390_vxrs_high_regset): New regsets.
|
||||
(s390_iterate_over_regset_sections): Add iterations for the two
|
||||
new vector regsets.
|
||||
(s390_core_read_description): Yield a target description with
|
||||
vector registers if applicable.
|
||||
(s390_gdbarch_init): Handle target descriptions with vector
|
||||
registers. Add "register_name" gdbarch method.
|
||||
(_initialize_s390_tdep): Call new tdesc initialization functions.
|
||||
* s390-linux-tdep.h (HWCAP_S390_VX): New macro.
|
||||
(S390_V0_LOWER_REGNUM, S390_V1_LOWER_REGNUM, S390_V2_LOWER_REGNUM)
|
||||
(S390_V3_LOWER_REGNUM, S390_V4_LOWER_REGNUM, S390_V5_LOWER_REGNUM)
|
||||
(S390_V6_LOWER_REGNUM, S390_V7_LOWER_REGNUM, S390_V8_LOWER_REGNUM)
|
||||
(S390_V9_LOWER_REGNUM, S390_V10_LOWER_REGNUM)
|
||||
(S390_V11_LOWER_REGNUM, S390_V12_LOWER_REGNUM)
|
||||
(S390_V13_LOWER_REGNUM, S390_V14_LOWER_REGNUM)
|
||||
(S390_V15_LOWER_REGNUM, S390_V16_REGNUM, S390_V17_REGNUM)
|
||||
(S390_V18_REGNUM, S390_V19_REGNUM, S390_V20_REGNUM)
|
||||
(S390_V21_REGNUM, S390_V22_REGNUM, S390_V23_REGNUM)
|
||||
(S390_V24_REGNUM, S390_V25_REGNUM, S390_V26_REGNUM)
|
||||
(S390_V27_REGNUM, S390_V28_REGNUM, S390_V29_REGNUM)
|
||||
(S390_V30_REGNUM, S390_V31_REGNUM): New macros.
|
||||
(S390_NUM_REGS): Adjust value.
|
||||
(s390_vxrs_low_regset, s390_vxrs_high_regset): Declare.
|
||||
(tdesc_s390_vx_linux64, tdesc_s390_tevx_linux64)
|
||||
(tdesc_s390x_vx_linux64, tdesc_s390x_tevx_linux64): Likewise.
|
||||
* NEWS: Announce S/390 vector register support.
|
||||
---
|
||||
gdb/ChangeLog | 58 +++++++++++++
|
||||
gdb/NEWS | 3 +
|
||||
gdb/s390-linux-nat.c | 84 +++++++++++-------
|
||||
gdb/s390-linux-tdep.c | 229 +++++++++++++++++++++++++++++++++++++++++++-------
|
||||
gdb/s390-linux-tdep.h | 45 +++++++++-
|
||||
5 files changed, 359 insertions(+), 60 deletions(-)
|
||||
|
||||
Index: gdb-7.9.1/gdb/NEWS
|
||||
===================================================================
|
||||
--- gdb-7.9.1.orig/gdb/NEWS 2015-07-10 16:18:29.000000000 +0200
|
||||
+++ gdb-7.9.1/gdb/NEWS 2015-07-10 16:18:36.000000000 +0200
|
||||
@@ -7,6 +7,9 @@
|
||||
|
||||
** Xmethods can now specify a result type.
|
||||
|
||||
+* GDB now supports access to vector registers on S/390 GNU/Linux
|
||||
+ targets.
|
||||
+
|
||||
*** Changes in GDB 7.9
|
||||
|
||||
* GDB now supports hardware watchpoints on x86 GNU Hurd.
|
||||
Index: gdb-7.9.1/gdb/s390-linux-nat.c
|
||||
===================================================================
|
||||
--- gdb-7.9.1.orig/gdb/s390-linux-nat.c 2015-07-10 16:18:29.000000000 +0200
|
||||
+++ gdb-7.9.1/gdb/s390-linux-nat.c 2015-07-10 16:18:36.000000000 +0200
|
||||
@@ -49,6 +49,7 @@
|
||||
static int have_regset_last_break = 0;
|
||||
static int have_regset_system_call = 0;
|
||||
static int have_regset_tdb = 0;
|
||||
+static int have_regset_vxrs = 0;
|
||||
|
||||
/* Register map for 32-bit executables running under a 64-bit
|
||||
kernel. */
|
||||
@@ -367,6 +368,18 @@ s390_linux_fetch_inferior_registers (str
|
||||
if (regnum == -1 || S390_IS_TDBREGSET_REGNUM (regnum))
|
||||
fetch_regset (regcache, tid, NT_S390_TDB, s390_sizeof_tdbregset,
|
||||
&s390_tdb_regset);
|
||||
+
|
||||
+ if (have_regset_vxrs)
|
||||
+ {
|
||||
+ if (regnum == -1 || (regnum >= S390_V0_LOWER_REGNUM
|
||||
+ && regnum <= S390_V15_LOWER_REGNUM))
|
||||
+ fetch_regset (regcache, tid, NT_S390_VXRS_LOW, 16 * 8,
|
||||
+ &s390_vxrs_low_regset);
|
||||
+ if (regnum == -1 || (regnum >= S390_V16_REGNUM
|
||||
+ && regnum <= S390_V31_REGNUM))
|
||||
+ fetch_regset (regcache, tid, NT_S390_VXRS_HIGH, 16 * 16,
|
||||
+ &s390_vxrs_high_regset);
|
||||
+ }
|
||||
}
|
||||
|
||||
/* Store register REGNUM back into the child process. If REGNUM is
|
||||
@@ -389,6 +402,18 @@ s390_linux_store_inferior_registers (str
|
||||
if (regnum == -1 || regnum == S390_SYSTEM_CALL_REGNUM)
|
||||
store_regset (regcache, tid, NT_S390_SYSTEM_CALL, 4,
|
||||
&s390_system_call_regset);
|
||||
+
|
||||
+ if (have_regset_vxrs)
|
||||
+ {
|
||||
+ if (regnum == -1 || (regnum >= S390_V0_LOWER_REGNUM
|
||||
+ && regnum <= S390_V15_LOWER_REGNUM))
|
||||
+ store_regset (regcache, tid, NT_S390_VXRS_LOW, 16 * 8,
|
||||
+ &s390_vxrs_low_regset);
|
||||
+ if (regnum == -1 || (regnum >= S390_V16_REGNUM
|
||||
+ && regnum <= S390_V31_REGNUM))
|
||||
+ store_regset (regcache, tid, NT_S390_VXRS_HIGH, 16 * 16,
|
||||
+ &s390_vxrs_high_regset);
|
||||
+ }
|
||||
}
|
||||
|
||||
|
||||
@@ -591,19 +616,6 @@ s390_auxv_parse (struct target_ops *ops,
|
||||
return 1;
|
||||
}
|
||||
|
||||
-#ifdef __s390x__
|
||||
-static unsigned long
|
||||
-s390_get_hwcap (void)
|
||||
-{
|
||||
- CORE_ADDR field;
|
||||
-
|
||||
- if (target_auxv_search (¤t_target, AT_HWCAP, &field))
|
||||
- return (unsigned long) field;
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-#endif
|
||||
-
|
||||
static const struct target_desc *
|
||||
s390_read_description (struct target_ops *ops)
|
||||
{
|
||||
@@ -614,27 +626,41 @@ s390_read_description (struct target_ops
|
||||
have_regset_system_call
|
||||
= check_regset (tid, NT_S390_SYSTEM_CALL, 4);
|
||||
|
||||
-#ifdef __s390x__
|
||||
/* If GDB itself is compiled as 64-bit, we are running on a machine in
|
||||
z/Architecture mode. If the target is running in 64-bit addressing
|
||||
mode, report s390x architecture. If the target is running in 31-bit
|
||||
addressing mode, but the kernel supports using 64-bit registers in
|
||||
that mode, report s390 architecture with 64-bit GPRs. */
|
||||
+#ifdef __s390x__
|
||||
+ {
|
||||
+ CORE_ADDR hwcap = 0;
|
||||
|
||||
- have_regset_tdb = (s390_get_hwcap () & HWCAP_S390_TE) ?
|
||||
- check_regset (tid, NT_S390_TDB, s390_sizeof_tdbregset) : 0;
|
||||
-
|
||||
- if (s390_target_wordsize () == 8)
|
||||
- return (have_regset_tdb ? tdesc_s390x_te_linux64 :
|
||||
- have_regset_system_call? tdesc_s390x_linux64v2 :
|
||||
- have_regset_last_break? tdesc_s390x_linux64v1 :
|
||||
- tdesc_s390x_linux64);
|
||||
-
|
||||
- if (s390_get_hwcap () & HWCAP_S390_HIGH_GPRS)
|
||||
- return (have_regset_tdb ? tdesc_s390_te_linux64 :
|
||||
- have_regset_system_call? tdesc_s390_linux64v2 :
|
||||
- have_regset_last_break? tdesc_s390_linux64v1 :
|
||||
- tdesc_s390_linux64);
|
||||
+ target_auxv_search (¤t_target, AT_HWCAP, &hwcap);
|
||||
+ have_regset_tdb = (hwcap & HWCAP_S390_TE)
|
||||
+ && check_regset (tid, NT_S390_TDB, s390_sizeof_tdbregset);
|
||||
+
|
||||
+ have_regset_vxrs = (hwcap & HWCAP_S390_VX)
|
||||
+ && check_regset (tid, NT_S390_VXRS_LOW, 16 * 8)
|
||||
+ && check_regset (tid, NT_S390_VXRS_HIGH, 16 * 16);
|
||||
+
|
||||
+ if (s390_target_wordsize () == 8)
|
||||
+ return (have_regset_vxrs ?
|
||||
+ (have_regset_tdb ? tdesc_s390x_tevx_linux64 :
|
||||
+ tdesc_s390x_vx_linux64) :
|
||||
+ have_regset_tdb ? tdesc_s390x_te_linux64 :
|
||||
+ have_regset_system_call ? tdesc_s390x_linux64v2 :
|
||||
+ have_regset_last_break ? tdesc_s390x_linux64v1 :
|
||||
+ tdesc_s390x_linux64);
|
||||
+
|
||||
+ if (hwcap & HWCAP_S390_HIGH_GPRS)
|
||||
+ return (have_regset_vxrs ?
|
||||
+ (have_regset_tdb ? tdesc_s390_tevx_linux64 :
|
||||
+ tdesc_s390_vx_linux64) :
|
||||
+ have_regset_tdb ? tdesc_s390_te_linux64 :
|
||||
+ have_regset_system_call ? tdesc_s390_linux64v2 :
|
||||
+ have_regset_last_break ? tdesc_s390_linux64v1 :
|
||||
+ tdesc_s390_linux64);
|
||||
+ }
|
||||
#endif
|
||||
|
||||
/* If GDB itself is compiled as 31-bit, or if we're running a 31-bit inferior
|
||||
Index: gdb-7.9.1/gdb/s390-linux-tdep.c
|
||||
===================================================================
|
||||
--- gdb-7.9.1.orig/gdb/s390-linux-tdep.c 2015-07-10 16:18:29.000000000 +0200
|
||||
+++ gdb-7.9.1/gdb/s390-linux-tdep.c 2015-07-10 16:18:36.000000000 +0200
|
||||
@@ -62,10 +62,14 @@
|
||||
#include "features/s390-linux64v1.c"
|
||||
#include "features/s390-linux64v2.c"
|
||||
#include "features/s390-te-linux64.c"
|
||||
+#include "features/s390-vx-linux64.c"
|
||||
+#include "features/s390-tevx-linux64.c"
|
||||
#include "features/s390x-linux64.c"
|
||||
#include "features/s390x-linux64v1.c"
|
||||
#include "features/s390x-linux64v2.c"
|
||||
#include "features/s390x-te-linux64.c"
|
||||
+#include "features/s390x-vx-linux64.c"
|
||||
+#include "features/s390x-tevx-linux64.c"
|
||||
|
||||
#define XML_SYSCALL_FILENAME_S390 "syscalls/s390-linux.xml"
|
||||
#define XML_SYSCALL_FILENAME_S390X "syscalls/s390x-linux.xml"
|
||||
@@ -81,6 +85,7 @@ struct gdbarch_tdep
|
||||
int gpr_full_regnum;
|
||||
int pc_regnum;
|
||||
int cc_regnum;
|
||||
+ int v0_full_regnum;
|
||||
|
||||
int have_linux_v1;
|
||||
int have_linux_v2;
|
||||
@@ -148,61 +153,83 @@ s390_write_pc (struct regcache *regcache
|
||||
|
||||
static const short s390_dwarf_regmap[] =
|
||||
{
|
||||
- /* General Purpose Registers. */
|
||||
+ /* 0-15: General Purpose Registers. */
|
||||
S390_R0_REGNUM, S390_R1_REGNUM, S390_R2_REGNUM, S390_R3_REGNUM,
|
||||
S390_R4_REGNUM, S390_R5_REGNUM, S390_R6_REGNUM, S390_R7_REGNUM,
|
||||
S390_R8_REGNUM, S390_R9_REGNUM, S390_R10_REGNUM, S390_R11_REGNUM,
|
||||
S390_R12_REGNUM, S390_R13_REGNUM, S390_R14_REGNUM, S390_R15_REGNUM,
|
||||
|
||||
- /* Floating Point Registers. */
|
||||
+ /* 16-31: Floating Point Registers / Vector Registers 0-15. */
|
||||
S390_F0_REGNUM, S390_F2_REGNUM, S390_F4_REGNUM, S390_F6_REGNUM,
|
||||
S390_F1_REGNUM, S390_F3_REGNUM, S390_F5_REGNUM, S390_F7_REGNUM,
|
||||
S390_F8_REGNUM, S390_F10_REGNUM, S390_F12_REGNUM, S390_F14_REGNUM,
|
||||
S390_F9_REGNUM, S390_F11_REGNUM, S390_F13_REGNUM, S390_F15_REGNUM,
|
||||
|
||||
- /* Control Registers (not mapped). */
|
||||
+ /* 32-47: Control Registers (not mapped). */
|
||||
-1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1,
|
||||
|
||||
- /* Access Registers. */
|
||||
+ /* 48-63: Access Registers. */
|
||||
S390_A0_REGNUM, S390_A1_REGNUM, S390_A2_REGNUM, S390_A3_REGNUM,
|
||||
S390_A4_REGNUM, S390_A5_REGNUM, S390_A6_REGNUM, S390_A7_REGNUM,
|
||||
S390_A8_REGNUM, S390_A9_REGNUM, S390_A10_REGNUM, S390_A11_REGNUM,
|
||||
S390_A12_REGNUM, S390_A13_REGNUM, S390_A14_REGNUM, S390_A15_REGNUM,
|
||||
|
||||
- /* Program Status Word. */
|
||||
+ /* 64-65: Program Status Word. */
|
||||
S390_PSWM_REGNUM,
|
||||
S390_PSWA_REGNUM,
|
||||
|
||||
+ /* 66-67: Reserved. */
|
||||
+ -1, -1,
|
||||
+
|
||||
+ /* 68-83: Vector Registers 16-31. */
|
||||
+ S390_V16_REGNUM, S390_V18_REGNUM, S390_V20_REGNUM, S390_V22_REGNUM,
|
||||
+ S390_V17_REGNUM, S390_V19_REGNUM, S390_V21_REGNUM, S390_V23_REGNUM,
|
||||
+ S390_V24_REGNUM, S390_V26_REGNUM, S390_V28_REGNUM, S390_V30_REGNUM,
|
||||
+ S390_V25_REGNUM, S390_V27_REGNUM, S390_V29_REGNUM, S390_V31_REGNUM,
|
||||
+
|
||||
+ /* End of "official" DWARF registers. The remainder of the map is
|
||||
+ for GDB internal use only. */
|
||||
+
|
||||
/* GPR Lower Half Access. */
|
||||
S390_R0_REGNUM, S390_R1_REGNUM, S390_R2_REGNUM, S390_R3_REGNUM,
|
||||
S390_R4_REGNUM, S390_R5_REGNUM, S390_R6_REGNUM, S390_R7_REGNUM,
|
||||
S390_R8_REGNUM, S390_R9_REGNUM, S390_R10_REGNUM, S390_R11_REGNUM,
|
||||
S390_R12_REGNUM, S390_R13_REGNUM, S390_R14_REGNUM, S390_R15_REGNUM,
|
||||
-
|
||||
- /* GNU/Linux-specific registers (not mapped). */
|
||||
- -1, -1, -1,
|
||||
};
|
||||
|
||||
+enum { s390_dwarf_reg_r0l = ARRAY_SIZE (s390_dwarf_regmap) - 16 };
|
||||
+
|
||||
/* Convert DWARF register number REG to the appropriate register
|
||||
number used by GDB. */
|
||||
static int
|
||||
s390_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int reg)
|
||||
{
|
||||
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
||||
+ int gdb_reg = -1;
|
||||
|
||||
- /* In a 32-on-64 debug scenario, debug info refers to the full 64-bit
|
||||
- GPRs. Note that call frame information still refers to the 32-bit
|
||||
- lower halves, because s390_adjust_frame_regnum uses register numbers
|
||||
- 66 .. 81 to access GPRs. */
|
||||
+ /* In a 32-on-64 debug scenario, debug info refers to the full
|
||||
+ 64-bit GPRs. Note that call frame information still refers to
|
||||
+ the 32-bit lower halves, because s390_adjust_frame_regnum uses
|
||||
+ special register numbers to access GPRs. */
|
||||
if (tdep->gpr_full_regnum != -1 && reg >= 0 && reg < 16)
|
||||
return tdep->gpr_full_regnum + reg;
|
||||
|
||||
if (reg >= 0 && reg < ARRAY_SIZE (s390_dwarf_regmap))
|
||||
- return s390_dwarf_regmap[reg];
|
||||
+ gdb_reg = s390_dwarf_regmap[reg];
|
||||
+
|
||||
+ if (tdep->v0_full_regnum == -1)
|
||||
+ {
|
||||
+ if (gdb_reg >= S390_V16_REGNUM && gdb_reg <= S390_V31_REGNUM)
|
||||
+ gdb_reg = -1;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ if (gdb_reg >= S390_F0_REGNUM && gdb_reg <= S390_F15_REGNUM)
|
||||
+ gdb_reg = gdb_reg - S390_F0_REGNUM + tdep->v0_full_regnum;
|
||||
+ }
|
||||
|
||||
- warning (_("Unmapped DWARF Register #%d encountered."), reg);
|
||||
- return -1;
|
||||
+ return gdb_reg;
|
||||
}
|
||||
|
||||
/* Translate a .eh_frame register to DWARF register, or adjust a
|
||||
@@ -211,7 +238,7 @@ static int
|
||||
s390_adjust_frame_regnum (struct gdbarch *gdbarch, int num, int eh_frame_p)
|
||||
{
|
||||
/* See s390_dwarf_reg_to_regnum for comments. */
|
||||
- return (num >= 0 && num < 16)? num + 66 : num;
|
||||
+ return (num >= 0 && num < 16) ? num + s390_dwarf_reg_r0l : num;
|
||||
}
|
||||
|
||||
|
||||
@@ -225,6 +252,29 @@ regnum_is_gpr_full (struct gdbarch_tdep
|
||||
&& regnum <= tdep->gpr_full_regnum + 15);
|
||||
}
|
||||
|
||||
+/* Check whether REGNUM indicates a full vector register (v0-v15).
|
||||
+ These pseudo-registers are composed of f0-f15 and v0l-v15l. */
|
||||
+
|
||||
+static int
|
||||
+regnum_is_vxr_full (struct gdbarch_tdep *tdep, int regnum)
|
||||
+{
|
||||
+ return (tdep->v0_full_regnum != -1
|
||||
+ && regnum >= tdep->v0_full_regnum
|
||||
+ && regnum <= tdep->v0_full_regnum + 15);
|
||||
+}
|
||||
+
|
||||
+/* Return the name of register REGNO. Return NULL for registers that
|
||||
+ shouldn't be visible. */
|
||||
+
|
||||
+static const char *
|
||||
+s390_register_name (struct gdbarch *gdbarch, int regnum)
|
||||
+{
|
||||
+ if (regnum >= S390_V0_LOWER_REGNUM
|
||||
+ && regnum <= S390_V15_LOWER_REGNUM)
|
||||
+ return NULL;
|
||||
+ return tdesc_register_name (gdbarch, regnum);
|
||||
+}
|
||||
+
|
||||
static const char *
|
||||
s390_pseudo_register_name (struct gdbarch *gdbarch, int regnum)
|
||||
{
|
||||
@@ -245,6 +295,15 @@ s390_pseudo_register_name (struct gdbarc
|
||||
return full_name[regnum - tdep->gpr_full_regnum];
|
||||
}
|
||||
|
||||
+ if (regnum_is_vxr_full (tdep, regnum))
|
||||
+ {
|
||||
+ static const char *full_name[] = {
|
||||
+ "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7",
|
||||
+ "v8", "v9", "v10", "v11", "v12", "v13", "v14", "v15"
|
||||
+ };
|
||||
+ return full_name[regnum - tdep->v0_full_regnum];
|
||||
+ }
|
||||
+
|
||||
internal_error (__FILE__, __LINE__, _("invalid regnum"));
|
||||
}
|
||||
|
||||
@@ -262,6 +321,9 @@ s390_pseudo_register_type (struct gdbarc
|
||||
if (regnum_is_gpr_full (tdep, regnum))
|
||||
return builtin_type (gdbarch)->builtin_uint64;
|
||||
|
||||
+ if (regnum_is_vxr_full (tdep, regnum))
|
||||
+ return tdesc_find_type (gdbarch, "vec128");
|
||||
+
|
||||
internal_error (__FILE__, __LINE__, _("invalid regnum"));
|
||||
}
|
||||
|
||||
@@ -323,6 +385,19 @@ s390_pseudo_register_read (struct gdbarc
|
||||
return status;
|
||||
}
|
||||
|
||||
+ if (regnum_is_vxr_full (tdep, regnum))
|
||||
+ {
|
||||
+ enum register_status status;
|
||||
+
|
||||
+ regnum -= tdep->v0_full_regnum;
|
||||
+
|
||||
+ status = regcache_raw_read (regcache, S390_F0_REGNUM + regnum, buf);
|
||||
+ if (status == REG_VALID)
|
||||
+ status = regcache_raw_read (regcache,
|
||||
+ S390_V0_LOWER_REGNUM + regnum, buf + 8);
|
||||
+ return status;
|
||||
+ }
|
||||
+
|
||||
internal_error (__FILE__, __LINE__, _("invalid regnum"));
|
||||
}
|
||||
|
||||
@@ -370,22 +445,34 @@ s390_pseudo_register_write (struct gdbar
|
||||
return;
|
||||
}
|
||||
|
||||
+ if (regnum_is_vxr_full (tdep, regnum))
|
||||
+ {
|
||||
+ regnum -= tdep->v0_full_regnum;
|
||||
+ regcache_raw_write (regcache, S390_F0_REGNUM + regnum, buf);
|
||||
+ regcache_raw_write (regcache, S390_V0_LOWER_REGNUM + regnum, buf + 8);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
internal_error (__FILE__, __LINE__, _("invalid regnum"));
|
||||
}
|
||||
|
||||
/* 'float' values are stored in the upper half of floating-point
|
||||
- registers, even though we are otherwise a big-endian platform. */
|
||||
+ registers, even though we are otherwise a big-endian platform. The
|
||||
+ same applies to a 'float' value within a vector. */
|
||||
|
||||
static struct value *
|
||||
s390_value_from_register (struct gdbarch *gdbarch, struct type *type,
|
||||
int regnum, struct frame_id frame_id)
|
||||
{
|
||||
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
||||
struct value *value = default_value_from_register (gdbarch, type,
|
||||
regnum, frame_id);
|
||||
check_typedef (type);
|
||||
|
||||
- if (regnum >= S390_F0_REGNUM && regnum <= S390_F15_REGNUM
|
||||
- && TYPE_LENGTH (type) < 8)
|
||||
+ if ((regnum >= S390_F0_REGNUM && regnum <= S390_F15_REGNUM
|
||||
+ && TYPE_LENGTH (type) < 8)
|
||||
+ || regnum_is_vxr_full (tdep, regnum)
|
||||
+ || (regnum >= S390_V16_REGNUM && regnum <= S390_V31_REGNUM))
|
||||
set_value_offset (value, 0);
|
||||
|
||||
return value;
|
||||
@@ -410,6 +497,12 @@ s390_pseudo_register_reggroup_p (struct
|
||||
if (group == save_reggroup || group == restore_reggroup)
|
||||
return regnum == tdep->pc_regnum || regnum == tdep->cc_regnum;
|
||||
|
||||
+ if (group == vector_reggroup)
|
||||
+ return regnum_is_vxr_full (tdep, regnum);
|
||||
+
|
||||
+ if (group == general_reggroup && regnum_is_vxr_full (tdep, regnum))
|
||||
+ return 0;
|
||||
+
|
||||
return default_register_reggroup_p (gdbarch, regnum, group);
|
||||
}
|
||||
|
||||
@@ -469,6 +562,18 @@ static const struct regcache_map_entry s
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
+static const struct regcache_map_entry s390_regmap_vxrs_low[] =
|
||||
+ {
|
||||
+ { 16, S390_V0_LOWER_REGNUM, 8 },
|
||||
+ { 0 }
|
||||
+ };
|
||||
+
|
||||
+static const struct regcache_map_entry s390_regmap_vxrs_high[] =
|
||||
+ {
|
||||
+ { 16, S390_V16_REGNUM, 16 },
|
||||
+ { 0 }
|
||||
+ };
|
||||
+
|
||||
|
||||
/* Supply the TDB regset. Like regcache_supply_regset, but invalidate
|
||||
the TDB registers unless the TDB format field is valid. */
|
||||
@@ -529,6 +634,18 @@ const struct regset s390_tdb_regset = {
|
||||
regcache_collect_regset
|
||||
};
|
||||
|
||||
+const struct regset s390_vxrs_low_regset = {
|
||||
+ s390_regmap_vxrs_low,
|
||||
+ regcache_supply_regset,
|
||||
+ regcache_collect_regset
|
||||
+};
|
||||
+
|
||||
+const struct regset s390_vxrs_high_regset = {
|
||||
+ s390_regmap_vxrs_high,
|
||||
+ regcache_supply_regset,
|
||||
+ regcache_collect_regset
|
||||
+};
|
||||
+
|
||||
/* Iterate over supported core file register note sections. */
|
||||
|
||||
static void
|
||||
@@ -567,37 +684,54 @@ s390_iterate_over_regset_sections (struc
|
||||
S390_TDB_DWORD0_REGNUM)))
|
||||
cb (".reg-s390-tdb", s390_sizeof_tdbregset, &s390_tdb_regset,
|
||||
"s390 TDB", cb_data);
|
||||
+
|
||||
+ if (tdep->v0_full_regnum != -1)
|
||||
+ {
|
||||
+ cb (".reg-s390-vxrs-low", 16 * 8, &s390_vxrs_low_regset,
|
||||
+ "s390 vector registers 0-15 lower half", cb_data);
|
||||
+ cb (".reg-s390-vxrs-high", 16 * 16, &s390_vxrs_high_regset,
|
||||
+ "s390 vector registers 16-31", cb_data);
|
||||
+ }
|
||||
}
|
||||
|
||||
static const struct target_desc *
|
||||
s390_core_read_description (struct gdbarch *gdbarch,
|
||||
struct target_ops *target, bfd *abfd)
|
||||
{
|
||||
- asection *high_gprs = bfd_get_section_by_name (abfd, ".reg-s390-high-gprs");
|
||||
- asection *v1 = bfd_get_section_by_name (abfd, ".reg-s390-last-break");
|
||||
- asection *v2 = bfd_get_section_by_name (abfd, ".reg-s390-system-call");
|
||||
asection *section = bfd_get_section_by_name (abfd, ".reg");
|
||||
CORE_ADDR hwcap = 0;
|
||||
+ int high_gprs, v1, v2, te, vx;
|
||||
|
||||
target_auxv_search (target, AT_HWCAP, &hwcap);
|
||||
if (!section)
|
||||
return NULL;
|
||||
|
||||
+ high_gprs = (bfd_get_section_by_name (abfd, ".reg-s390-high-gprs")
|
||||
+ != NULL);
|
||||
+ v1 = (bfd_get_section_by_name (abfd, ".reg-s390-last-break") != NULL);
|
||||
+ v2 = (bfd_get_section_by_name (abfd, ".reg-s390-system-call") != NULL);
|
||||
+ vx = (hwcap & HWCAP_S390_VX);
|
||||
+ te = (hwcap & HWCAP_S390_TE);
|
||||
+
|
||||
switch (bfd_section_size (abfd, section))
|
||||
{
|
||||
case s390_sizeof_gregset:
|
||||
if (high_gprs)
|
||||
- return ((hwcap & HWCAP_S390_TE) ? tdesc_s390_te_linux64 :
|
||||
- v2? tdesc_s390_linux64v2 :
|
||||
- v1? tdesc_s390_linux64v1 : tdesc_s390_linux64);
|
||||
+ return (te && vx ? tdesc_s390_tevx_linux64 :
|
||||
+ vx ? tdesc_s390_vx_linux64 :
|
||||
+ te ? tdesc_s390_te_linux64 :
|
||||
+ v2 ? tdesc_s390_linux64v2 :
|
||||
+ v1 ? tdesc_s390_linux64v1 : tdesc_s390_linux64);
|
||||
else
|
||||
- return (v2? tdesc_s390_linux32v2 :
|
||||
- v1? tdesc_s390_linux32v1 : tdesc_s390_linux32);
|
||||
+ return (v2 ? tdesc_s390_linux32v2 :
|
||||
+ v1 ? tdesc_s390_linux32v1 : tdesc_s390_linux32);
|
||||
|
||||
case s390x_sizeof_gregset:
|
||||
- return ((hwcap & HWCAP_S390_TE) ? tdesc_s390x_te_linux64 :
|
||||
- v2? tdesc_s390x_linux64v2 :
|
||||
- v1? tdesc_s390x_linux64v1 : tdesc_s390x_linux64);
|
||||
+ return (te && vx ? tdesc_s390x_tevx_linux64 :
|
||||
+ vx ? tdesc_s390x_vx_linux64 :
|
||||
+ te ? tdesc_s390x_te_linux64 :
|
||||
+ v2 ? tdesc_s390x_linux64v2 :
|
||||
+ v1 ? tdesc_s390x_linux64v1 : tdesc_s390x_linux64);
|
||||
|
||||
default:
|
||||
return NULL;
|
||||
@@ -2842,6 +2976,7 @@ s390_gdbarch_init (struct gdbarch_info i
|
||||
int have_linux_v1 = 0;
|
||||
int have_linux_v2 = 0;
|
||||
int have_tdb = 0;
|
||||
+ int have_vx = 0;
|
||||
int first_pseudo_reg, last_pseudo_reg;
|
||||
static const char *const stap_register_prefixes[] = { "%", NULL };
|
||||
static const char *const stap_register_indirection_prefixes[] = { "(",
|
||||
@@ -2901,6 +3036,14 @@ s390_gdbarch_init (struct gdbarch_info i
|
||||
"tr0", "tr1", "tr2", "tr3", "tr4", "tr5", "tr6", "tr7",
|
||||
"tr8", "tr9", "tr10", "tr11", "tr12", "tr13", "tr14", "tr15"
|
||||
};
|
||||
+ static const char *const vxrs_low[] = {
|
||||
+ "v0l", "v1l", "v2l", "v3l", "v4l", "v5l", "v6l", "v7l", "v8l",
|
||||
+ "v9l", "v10l", "v11l", "v12l", "v13l", "v14l", "v15l",
|
||||
+ };
|
||||
+ static const char *const vxrs_high[] = {
|
||||
+ "v16", "v17", "v18", "v19", "v20", "v21", "v22", "v23", "v24",
|
||||
+ "v25", "v26", "v27", "v28", "v29", "v30", "v31",
|
||||
+ };
|
||||
const struct tdesc_feature *feature;
|
||||
int i, valid_p = 1;
|
||||
|
||||
@@ -2989,6 +3132,21 @@ s390_gdbarch_init (struct gdbarch_info i
|
||||
have_tdb = 1;
|
||||
}
|
||||
|
||||
+ /* Vector registers. */
|
||||
+ feature = tdesc_find_feature (tdesc, "org.gnu.gdb.s390.vx");
|
||||
+ if (feature)
|
||||
+ {
|
||||
+ for (i = 0; i < 16; i++)
|
||||
+ valid_p &= tdesc_numbered_register (feature, tdesc_data,
|
||||
+ S390_V0_LOWER_REGNUM + i,
|
||||
+ vxrs_low[i]);
|
||||
+ for (i = 0; i < 16; i++)
|
||||
+ valid_p &= tdesc_numbered_register (feature, tdesc_data,
|
||||
+ S390_V16_REGNUM + i,
|
||||
+ vxrs_high[i]);
|
||||
+ have_vx = 1;
|
||||
+ }
|
||||
+
|
||||
if (!valid_p)
|
||||
{
|
||||
tdesc_data_cleanup (tdesc_data);
|
||||
@@ -3058,6 +3216,7 @@ s390_gdbarch_init (struct gdbarch_info i
|
||||
set_tdesc_pseudo_register_reggroup_p (gdbarch,
|
||||
s390_pseudo_register_reggroup_p);
|
||||
tdesc_use_registers (gdbarch, tdesc, tdesc_data);
|
||||
+ set_gdbarch_register_name (gdbarch, s390_register_name);
|
||||
|
||||
/* Assign pseudo register numbers. */
|
||||
first_pseudo_reg = gdbarch_num_regs (gdbarch);
|
||||
@@ -3068,6 +3227,12 @@ s390_gdbarch_init (struct gdbarch_info i
|
||||
tdep->gpr_full_regnum = last_pseudo_reg;
|
||||
last_pseudo_reg += 16;
|
||||
}
|
||||
+ tdep->v0_full_regnum = -1;
|
||||
+ if (have_vx)
|
||||
+ {
|
||||
+ tdep->v0_full_regnum = last_pseudo_reg;
|
||||
+ last_pseudo_reg += 16;
|
||||
+ }
|
||||
tdep->pc_regnum = last_pseudo_reg++;
|
||||
tdep->cc_regnum = last_pseudo_reg++;
|
||||
set_gdbarch_pc_regnum (gdbarch, tdep->pc_regnum);
|
||||
@@ -3173,8 +3338,12 @@ _initialize_s390_tdep (void)
|
||||
initialize_tdesc_s390_linux64v1 ();
|
||||
initialize_tdesc_s390_linux64v2 ();
|
||||
initialize_tdesc_s390_te_linux64 ();
|
||||
+ initialize_tdesc_s390_vx_linux64 ();
|
||||
+ initialize_tdesc_s390_tevx_linux64 ();
|
||||
initialize_tdesc_s390x_linux64 ();
|
||||
initialize_tdesc_s390x_linux64v1 ();
|
||||
initialize_tdesc_s390x_linux64v2 ();
|
||||
initialize_tdesc_s390x_te_linux64 ();
|
||||
+ initialize_tdesc_s390x_vx_linux64 ();
|
||||
+ initialize_tdesc_s390x_tevx_linux64 ();
|
||||
}
|
||||
Index: gdb-7.9.1/gdb/s390-linux-tdep.h
|
||||
===================================================================
|
||||
--- gdb-7.9.1.orig/gdb/s390-linux-tdep.h 2015-07-10 16:18:29.000000000 +0200
|
||||
+++ gdb-7.9.1/gdb/s390-linux-tdep.h 2015-07-10 16:18:36.000000000 +0200
|
||||
@@ -29,6 +29,10 @@
|
||||
#define HWCAP_S390_TE 1024
|
||||
#endif
|
||||
|
||||
+#ifndef HWCAP_S390_VX
|
||||
+#define HWCAP_S390_VX 2048
|
||||
+#endif
|
||||
+
|
||||
/* Register information. */
|
||||
|
||||
/* Program Status Word. */
|
||||
@@ -129,8 +133,41 @@
|
||||
#define S390_TDB_R13_REGNUM 87
|
||||
#define S390_TDB_R14_REGNUM 88
|
||||
#define S390_TDB_R15_REGNUM 89
|
||||
+/* Vector registers. */
|
||||
+#define S390_V0_LOWER_REGNUM 90
|
||||
+#define S390_V1_LOWER_REGNUM 91
|
||||
+#define S390_V2_LOWER_REGNUM 92
|
||||
+#define S390_V3_LOWER_REGNUM 93
|
||||
+#define S390_V4_LOWER_REGNUM 94
|
||||
+#define S390_V5_LOWER_REGNUM 95
|
||||
+#define S390_V6_LOWER_REGNUM 96
|
||||
+#define S390_V7_LOWER_REGNUM 97
|
||||
+#define S390_V8_LOWER_REGNUM 98
|
||||
+#define S390_V9_LOWER_REGNUM 99
|
||||
+#define S390_V10_LOWER_REGNUM 100
|
||||
+#define S390_V11_LOWER_REGNUM 101
|
||||
+#define S390_V12_LOWER_REGNUM 102
|
||||
+#define S390_V13_LOWER_REGNUM 103
|
||||
+#define S390_V14_LOWER_REGNUM 104
|
||||
+#define S390_V15_LOWER_REGNUM 105
|
||||
+#define S390_V16_REGNUM 106
|
||||
+#define S390_V17_REGNUM 107
|
||||
+#define S390_V18_REGNUM 108
|
||||
+#define S390_V19_REGNUM 109
|
||||
+#define S390_V20_REGNUM 110
|
||||
+#define S390_V21_REGNUM 111
|
||||
+#define S390_V22_REGNUM 112
|
||||
+#define S390_V23_REGNUM 113
|
||||
+#define S390_V24_REGNUM 114
|
||||
+#define S390_V25_REGNUM 115
|
||||
+#define S390_V26_REGNUM 116
|
||||
+#define S390_V27_REGNUM 117
|
||||
+#define S390_V28_REGNUM 118
|
||||
+#define S390_V29_REGNUM 119
|
||||
+#define S390_V30_REGNUM 120
|
||||
+#define S390_V31_REGNUM 121
|
||||
/* Total. */
|
||||
-#define S390_NUM_REGS 90
|
||||
+#define S390_NUM_REGS 122
|
||||
|
||||
/* Special register usage. */
|
||||
#define S390_SP_REGNUM S390_R15_REGNUM
|
||||
@@ -159,6 +196,8 @@ extern const struct regset s390x_last_br
|
||||
extern const struct regset s390_system_call_regset;
|
||||
extern const struct regset s390_tdb_regset;
|
||||
#define s390_sizeof_tdbregset 0x100
|
||||
+extern const struct regset s390_vxrs_low_regset;
|
||||
+extern const struct regset s390_vxrs_high_regset;
|
||||
|
||||
/* GNU/Linux target descriptions. */
|
||||
extern struct target_desc *tdesc_s390_linux32;
|
||||
@@ -168,9 +207,13 @@ extern struct target_desc *tdesc_s390_li
|
||||
extern struct target_desc *tdesc_s390_linux64v1;
|
||||
extern struct target_desc *tdesc_s390_linux64v2;
|
||||
extern struct target_desc *tdesc_s390_te_linux64;
|
||||
+extern struct target_desc *tdesc_s390_vx_linux64;
|
||||
+extern struct target_desc *tdesc_s390_tevx_linux64;
|
||||
extern struct target_desc *tdesc_s390x_linux64;
|
||||
extern struct target_desc *tdesc_s390x_linux64v1;
|
||||
extern struct target_desc *tdesc_s390x_linux64v2;
|
||||
extern struct target_desc *tdesc_s390x_te_linux64;
|
||||
+extern struct target_desc *tdesc_s390x_vx_linux64;
|
||||
+extern struct target_desc *tdesc_s390x_tevx_linux64;
|
||||
|
||||
#endif
|
293
0003-S390-Add-vector-register-support-to-gdbserver.patch
Normal file
293
0003-S390-Add-vector-register-support-to-gdbserver.patch
Normal file
@ -0,0 +1,293 @@
|
||||
Part of fate#318039
|
||||
|
||||
From bf2d68ab8c9da89a7caec2abdd2cc27c607f4a04 Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Arnez <arnez@linux.vnet.ibm.com>
|
||||
Date: Mon, 2 Mar 2015 10:57:40 +0100
|
||||
Subject: [PATCH] S390: Add vector register support to gdbserver
|
||||
|
||||
On S/390 targets with vector registers, enable gdbserver to advertise
|
||||
and handle the feature "org.gnu.gdb.s390.vx".
|
||||
|
||||
gdb/gdbserver/ChangeLog:
|
||||
|
||||
* Makefile.in (s390-vx-linux64.c, s390-tevx-linux64.c)
|
||||
(s390x-vx-linux64.c, s390x-tevx-linux64.c): New rules.
|
||||
(clean): Add "rm -f" for above C files.
|
||||
* configure.srv (srv_regobj): Add s390-vx-linux64.o,
|
||||
s390-tevx-linux64.o, s390x-vx-linux64.o, and s390x-tevx-linux64.o.
|
||||
(srv_xmlfiles): Add s390-vx-linux64.xml, s390-tevx-linux64.xml,
|
||||
s390x-vx-linux64.xml, s390x-tevx-linux64.xml, and s390-vx.xml.
|
||||
* linux-s390-low.c (HWCAP_S390_VX): New macro.
|
||||
(init_registers_s390_vx_linux64, init_registers_s390_tevx_linux64)
|
||||
(init_registers_s390x_vx_linux64)
|
||||
(init_registers_s390x_tevx_linux64)
|
||||
(tdesc_s390_vx_linux64, tdesc_s390_tevx_linux64)
|
||||
(tdesc_s390x_vx_linux64, tdesc_s390x_tevx_linux64): New extern
|
||||
declarations.
|
||||
(s390_fill_vxrs_low, s390_store_vxrs_low, s390_fill_vxrs_high)
|
||||
(s390_store_vxrs_high): New functions.
|
||||
(s390_regsets): Add entries for NT_S390_VXRS_LOW and
|
||||
NT_S390_VXRS_HIGH.
|
||||
(s390_arch_setup): Add logic for selecting one of the new target
|
||||
descriptions. Activate the new vector regsets if applicable.
|
||||
(initialize_low_arch): Also invoke init_registers_s390_vx_linux64,
|
||||
init_registers_s390_tevx_linux64, init_registers_s390x_vx_linux64,
|
||||
and init_registers_s390x_tevx_linux64.
|
||||
---
|
||||
gdb/gdbserver/ChangeLog | 26 ++++++++++++
|
||||
gdb/gdbserver/Makefile.in | 12 +++++-
|
||||
gdb/gdbserver/configure.srv | 9 ++++
|
||||
gdb/gdbserver/linux-s390-low.c | 94 ++++++++++++++++++++++++++++++++++++++++--
|
||||
4 files changed, 137 insertions(+), 4 deletions(-)
|
||||
|
||||
Index: gdb-7.9.1/gdb/gdbserver/Makefile.in
|
||||
===================================================================
|
||||
--- gdb-7.9.1.orig/gdb/gdbserver/Makefile.in 2015-07-10 16:18:29.000000000 +0200
|
||||
+++ gdb-7.9.1/gdb/gdbserver/Makefile.in 2015-07-10 16:19:13.000000000 +0200
|
||||
@@ -356,7 +356,9 @@ clean:
|
||||
rm -f s390-linux32.c s390-linux64.c s390x-linux64.c
|
||||
rm -f s390-linux32v1.c s390-linux32v2.c s390-linux64v1.c
|
||||
rm -f s390-linux64v2.c s390x-linux64v1.c s390x-linux64v2.c
|
||||
- rm -f s390-te-linux32.c s390-te-linux64.c
|
||||
+ rm -f s390-te-linux64.c s390x-te-linux64.c
|
||||
+ rm -f s390-vx-linux64.c s390x-vx-linux64.c
|
||||
+ rm -f s390-tevx-linux64.c s390x-tevx-linux64.c
|
||||
rm -f tic6x-c64xp-linux.c tic6x-c64x-linux.c tic6x-c62x-linux.c
|
||||
rm -f xml-builtin.c stamp-xml
|
||||
rm -f i386-avx.c i386-avx-linux.c
|
||||
@@ -684,6 +686,10 @@ s390-linux64v2.c : $(srcdir)/../regforma
|
||||
$(SHELL) $(regdat_sh) $(srcdir)/../regformats/s390-linux64v2.dat s390-linux64v2.c
|
||||
s390-te-linux64.c : $(srcdir)/../regformats/s390-te-linux64.dat $(regdat_sh)
|
||||
$(SHELL) $(regdat_sh) $(srcdir)/../regformats/s390-te-linux64.dat s390-te-linux64.c
|
||||
+s390-vx-linux64.c : $(srcdir)/../regformats/s390-vx-linux64.dat $(regdat_sh)
|
||||
+ $(SHELL) $(regdat_sh) $(srcdir)/../regformats/s390-vx-linux64.dat s390-vx-linux64.c
|
||||
+s390-tevx-linux64.c : $(srcdir)/../regformats/s390-tevx-linux64.dat $(regdat_sh)
|
||||
+ $(SHELL) $(regdat_sh) $(srcdir)/../regformats/s390-tevx-linux64.dat s390-tevx-linux64.c
|
||||
s390x-linux64.c : $(srcdir)/../regformats/s390x-linux64.dat $(regdat_sh)
|
||||
$(SHELL) $(regdat_sh) $(srcdir)/../regformats/s390x-linux64.dat s390x-linux64.c
|
||||
s390x-linux64v1.c : $(srcdir)/../regformats/s390x-linux64v1.dat $(regdat_sh)
|
||||
@@ -692,6 +698,10 @@ s390x-linux64v2.c : $(srcdir)/../regform
|
||||
$(SHELL) $(regdat_sh) $(srcdir)/../regformats/s390x-linux64v2.dat s390x-linux64v2.c
|
||||
s390x-te-linux64.c : $(srcdir)/../regformats/s390x-te-linux64.dat $(regdat_sh)
|
||||
$(SHELL) $(regdat_sh) $(srcdir)/../regformats/s390x-te-linux64.dat s390x-te-linux64.c
|
||||
+s390x-vx-linux64.c : $(srcdir)/../regformats/s390x-vx-linux64.dat $(regdat_sh)
|
||||
+ $(SHELL) $(regdat_sh) $(srcdir)/../regformats/s390x-vx-linux64.dat s390x-vx-linux64.c
|
||||
+s390x-tevx-linux64.c : $(srcdir)/../regformats/s390x-tevx-linux64.dat $(regdat_sh)
|
||||
+ $(SHELL) $(regdat_sh) $(srcdir)/../regformats/s390x-tevx-linux64.dat s390x-tevx-linux64.c
|
||||
|
||||
tic6x-c64xp-linux.c : $(srcdir)/../regformats/tic6x-c64xp-linux.dat $(regdat_sh)
|
||||
$(SHELL) $(regdat_sh) $(srcdir)/../regformats/tic6x-c64xp-linux.dat tic6x-c64xp-linux.c
|
||||
Index: gdb-7.9.1/gdb/gdbserver/configure.srv
|
||||
===================================================================
|
||||
--- gdb-7.9.1.orig/gdb/gdbserver/configure.srv 2015-07-10 16:18:29.000000000 +0200
|
||||
+++ gdb-7.9.1/gdb/gdbserver/configure.srv 2015-07-10 16:19:13.000000000 +0200
|
||||
@@ -260,10 +260,14 @@ case "${target}" in
|
||||
srv_regobj="${srv_regobj} s390-linux64v1.o"
|
||||
srv_regobj="${srv_regobj} s390-linux64v2.o"
|
||||
srv_regobj="${srv_regobj} s390-te-linux64.o"
|
||||
+ srv_regobj="${srv_regobj} s390-vx-linux64.o"
|
||||
+ srv_regobj="${srv_regobj} s390-tevx-linux64.o"
|
||||
srv_regobj="${srv_regobj} s390x-linux64.o"
|
||||
srv_regobj="${srv_regobj} s390x-linux64v1.o"
|
||||
srv_regobj="${srv_regobj} s390x-linux64v2.o"
|
||||
srv_regobj="${srv_regobj} s390x-te-linux64.o"
|
||||
+ srv_regobj="${srv_regobj} s390x-vx-linux64.o"
|
||||
+ srv_regobj="${srv_regobj} s390x-tevx-linux64.o"
|
||||
srv_tgtobj="$srv_linux_obj linux-s390-low.o"
|
||||
srv_xmlfiles="s390-linux32.xml"
|
||||
srv_xmlfiles="${srv_xmlfiles} s390-linux32v1.xml"
|
||||
@@ -272,16 +276,21 @@ case "${target}" in
|
||||
srv_xmlfiles="${srv_xmlfiles} s390-linux64v1.xml"
|
||||
srv_xmlfiles="${srv_xmlfiles} s390-linux64v2.xml"
|
||||
srv_xmlfiles="${srv_xmlfiles} s390-te-linux64.xml"
|
||||
+ srv_xmlfiles="${srv_xmlfiles} s390-vx-linux64.xml"
|
||||
+ srv_xmlfiles="${srv_xmlfiles} s390-tevx-linux64.xml"
|
||||
srv_xmlfiles="${srv_xmlfiles} s390x-linux64.xml"
|
||||
srv_xmlfiles="${srv_xmlfiles} s390x-linux64v1.xml"
|
||||
srv_xmlfiles="${srv_xmlfiles} s390x-linux64v2.xml"
|
||||
srv_xmlfiles="${srv_xmlfiles} s390x-te-linux64.xml"
|
||||
+ srv_xmlfiles="${srv_xmlfiles} s390x-vx-linux64.xml"
|
||||
+ srv_xmlfiles="${srv_xmlfiles} s390x-tevx-linux64.xml"
|
||||
srv_xmlfiles="${srv_xmlfiles} s390-core32.xml"
|
||||
srv_xmlfiles="${srv_xmlfiles} s390-core64.xml"
|
||||
srv_xmlfiles="${srv_xmlfiles} s390x-core64.xml"
|
||||
srv_xmlfiles="${srv_xmlfiles} s390-acr.xml"
|
||||
srv_xmlfiles="${srv_xmlfiles} s390-fpr.xml"
|
||||
srv_xmlfiles="${srv_xmlfiles} s390-tdb.xml"
|
||||
+ srv_xmlfiles="${srv_xmlfiles} s390-vx.xml"
|
||||
srv_linux_usrregs=yes
|
||||
srv_linux_regsets=yes
|
||||
srv_linux_thread_db=yes
|
||||
Index: gdb-7.9.1/gdb/gdbserver/linux-s390-low.c
|
||||
===================================================================
|
||||
--- gdb-7.9.1.orig/gdb/gdbserver/linux-s390-low.c 2015-07-10 16:18:29.000000000 +0200
|
||||
+++ gdb-7.9.1/gdb/gdbserver/linux-s390-low.c 2015-07-10 16:19:13.000000000 +0200
|
||||
@@ -36,6 +36,10 @@
|
||||
#define HWCAP_S390_TE 1024
|
||||
#endif
|
||||
|
||||
+#ifndef HWCAP_S390_VX
|
||||
+#define HWCAP_S390_VX 2048
|
||||
+#endif
|
||||
+
|
||||
#ifndef PTRACE_GETREGSET
|
||||
#define PTRACE_GETREGSET 0x4204
|
||||
#endif
|
||||
@@ -72,6 +76,14 @@ extern const struct target_desc *tdesc_s
|
||||
void init_registers_s390_te_linux64 (void);
|
||||
extern const struct target_desc *tdesc_s390_te_linux64;
|
||||
|
||||
+/* Defined in auto-generated file s390-vx-linux64.c. */
|
||||
+void init_registers_s390_vx_linux64 (void);
|
||||
+extern const struct target_desc *tdesc_s390_vx_linux64;
|
||||
+
|
||||
+/* Defined in auto-generated file s390-tevx-linux64.c. */
|
||||
+void init_registers_s390_tevx_linux64 (void);
|
||||
+extern const struct target_desc *tdesc_s390_tevx_linux64;
|
||||
+
|
||||
/* Defined in auto-generated file s390x-linux64.c. */
|
||||
void init_registers_s390x_linux64 (void);
|
||||
extern const struct target_desc *tdesc_s390x_linux64;
|
||||
@@ -88,6 +100,14 @@ extern const struct target_desc *tdesc_s
|
||||
void init_registers_s390x_te_linux64 (void);
|
||||
extern const struct target_desc *tdesc_s390x_te_linux64;
|
||||
|
||||
+/* Defined in auto-generated file s390x-vx-linux64.c. */
|
||||
+void init_registers_s390x_vx_linux64 (void);
|
||||
+extern const struct target_desc *tdesc_s390x_vx_linux64;
|
||||
+
|
||||
+/* Defined in auto-generated file s390x-tevx-linux64.c. */
|
||||
+void init_registers_s390x_tevx_linux64 (void);
|
||||
+extern const struct target_desc *tdesc_s390x_tevx_linux64;
|
||||
+
|
||||
#define s390_num_regs 52
|
||||
|
||||
static int s390_regmap[] = {
|
||||
@@ -324,6 +344,46 @@ s390_store_tdb (struct regcache *regcach
|
||||
supply_register (regcache, tr0 + i, (const char *) buf + 8 * (16 + i));
|
||||
}
|
||||
|
||||
+static void
|
||||
+s390_fill_vxrs_low (struct regcache *regcache, void *buf)
|
||||
+{
|
||||
+ int v0 = find_regno (regcache->tdesc, "v0l");
|
||||
+ int i;
|
||||
+
|
||||
+ for (i = 0; i < 16; i++)
|
||||
+ collect_register (regcache, v0 + i, (char *) buf + 8 * i);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+s390_store_vxrs_low (struct regcache *regcache, const void *buf)
|
||||
+{
|
||||
+ int v0 = find_regno (regcache->tdesc, "v0l");
|
||||
+ int i;
|
||||
+
|
||||
+ for (i = 0; i < 16; i++)
|
||||
+ supply_register (regcache, v0 + i, (const char *) buf + 8 * i);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+s390_fill_vxrs_high (struct regcache *regcache, void *buf)
|
||||
+{
|
||||
+ int v16 = find_regno (regcache->tdesc, "v16");
|
||||
+ int i;
|
||||
+
|
||||
+ for (i = 0; i < 16; i++)
|
||||
+ collect_register (regcache, v16 + i, (char *) buf + 16 * i);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+s390_store_vxrs_high (struct regcache *regcache, const void *buf)
|
||||
+{
|
||||
+ int v16 = find_regno (regcache->tdesc, "v16");
|
||||
+ int i;
|
||||
+
|
||||
+ for (i = 0; i < 16; i++)
|
||||
+ supply_register (regcache, v16 + i, (const char *) buf + 16 * i);
|
||||
+}
|
||||
+
|
||||
static struct regset_info s390_regsets[] = {
|
||||
{ 0, 0, 0, 0, GENERAL_REGS, s390_fill_gregset, NULL },
|
||||
/* Last break address is read-only; no fill function. */
|
||||
@@ -334,6 +394,10 @@ static struct regset_info s390_regsets[]
|
||||
/* TDB is read-only. */
|
||||
{ PTRACE_GETREGSET, -1, NT_S390_TDB, 0, EXTENDED_REGS,
|
||||
NULL, s390_store_tdb },
|
||||
+ { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_S390_VXRS_LOW, 0,
|
||||
+ EXTENDED_REGS, s390_fill_vxrs_low, s390_store_vxrs_low },
|
||||
+ { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_S390_VXRS_HIGH, 0,
|
||||
+ EXTENDED_REGS, s390_fill_vxrs_high, s390_store_vxrs_high },
|
||||
{ 0, 0, 0, -1, -1, NULL, NULL }
|
||||
};
|
||||
|
||||
@@ -439,6 +503,8 @@ s390_arch_setup (void)
|
||||
int have_regset_system_call
|
||||
= s390_check_regset (pid, NT_S390_SYSTEM_CALL, 4);
|
||||
int have_regset_tdb = s390_check_regset (pid, NT_S390_TDB, 256);
|
||||
+ int have_regset_vxrs = s390_check_regset (pid, NT_S390_VXRS_LOW, 128)
|
||||
+ && s390_check_regset (pid, NT_S390_VXRS_HIGH, 256);
|
||||
|
||||
/* Assume 31-bit inferior process. */
|
||||
if (have_regset_system_call)
|
||||
@@ -464,8 +530,14 @@ s390_arch_setup (void)
|
||||
if (have_regset_tdb)
|
||||
have_regset_tdb =
|
||||
(s390_get_hwcap (tdesc_s390x_linux64v2) & HWCAP_S390_TE) != 0;
|
||||
-
|
||||
- if (have_regset_tdb)
|
||||
+ if (have_regset_vxrs)
|
||||
+ have_regset_vxrs =
|
||||
+ (s390_get_hwcap (tdesc_s390x_linux64v2) & HWCAP_S390_VX) != 0;
|
||||
+
|
||||
+ if (have_regset_vxrs)
|
||||
+ tdesc = (have_regset_tdb ? tdesc_s390x_tevx_linux64 :
|
||||
+ tdesc_s390x_vx_linux64);
|
||||
+ else if (have_regset_tdb)
|
||||
tdesc = tdesc_s390x_te_linux64;
|
||||
else if (have_regset_system_call)
|
||||
tdesc = tdesc_s390x_linux64v2;
|
||||
@@ -482,8 +554,13 @@ s390_arch_setup (void)
|
||||
have_hwcap_s390_high_gprs = 1;
|
||||
if (have_regset_tdb)
|
||||
have_regset_tdb = (s390_get_hwcap (tdesc) & HWCAP_S390_TE) != 0;
|
||||
+ if (have_regset_vxrs)
|
||||
+ have_regset_vxrs = (s390_get_hwcap (tdesc) & HWCAP_S390_VX) != 0;
|
||||
|
||||
- if (have_regset_tdb)
|
||||
+ if (have_regset_vxrs)
|
||||
+ tdesc = (have_regset_tdb ? tdesc_s390_tevx_linux64 :
|
||||
+ tdesc_s390_vx_linux64);
|
||||
+ else if (have_regset_tdb)
|
||||
tdesc = tdesc_s390_te_linux64;
|
||||
else if (have_regset_system_call)
|
||||
tdesc = tdesc_s390_linux64v2;
|
||||
@@ -508,6 +585,13 @@ s390_arch_setup (void)
|
||||
break;
|
||||
case NT_S390_TDB:
|
||||
regset->size = have_regset_tdb ? 256 : 0;
|
||||
+ break;
|
||||
+ case NT_S390_VXRS_LOW:
|
||||
+ regset->size = have_regset_vxrs ? 128 : 0;
|
||||
+ break;
|
||||
+ case NT_S390_VXRS_HIGH:
|
||||
+ regset->size = have_regset_vxrs ? 256 : 0;
|
||||
+ break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -615,10 +699,14 @@ initialize_low_arch (void)
|
||||
init_registers_s390_linux64v1 ();
|
||||
init_registers_s390_linux64v2 ();
|
||||
init_registers_s390_te_linux64 ();
|
||||
+ init_registers_s390_vx_linux64 ();
|
||||
+ init_registers_s390_tevx_linux64 ();
|
||||
init_registers_s390x_linux64 ();
|
||||
init_registers_s390x_linux64v1 ();
|
||||
init_registers_s390x_linux64v2 ();
|
||||
init_registers_s390x_te_linux64 ();
|
||||
+ init_registers_s390x_vx_linux64 ();
|
||||
+ init_registers_s390x_tevx_linux64 ();
|
||||
|
||||
initialize_regsets_info (&s390_regsets_info);
|
||||
#ifdef __s390x__
|
334
0004-S390-Vector-register-test-case.patch
Normal file
334
0004-S390-Vector-register-test-case.patch
Normal file
@ -0,0 +1,334 @@
|
||||
Part of fate#318039
|
||||
|
||||
From 4fa5d7b436815f58688ec9245f24fc83263364b9 Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Arnez <arnez@linux.vnet.ibm.com>
|
||||
Date: Mon, 2 Mar 2015 10:57:40 +0100
|
||||
Subject: [PATCH] S390: Vector register test case
|
||||
|
||||
Add a test case for S/390 vector registers support.
|
||||
|
||||
gdb/testsuite/ChangeLog:
|
||||
|
||||
* gdb.arch/s390-vregs.exp: New test.
|
||||
* gdb.arch/s390-vregs.S: New file.
|
||||
---
|
||||
gdb/testsuite/ChangeLog | 5 +
|
||||
gdb/testsuite/gdb.arch/s390-vregs.S | 96 ++++++++++++++++
|
||||
gdb/testsuite/gdb.arch/s390-vregs.exp | 202 ++++++++++++++++++++++++++++++++++
|
||||
3 files changed, 303 insertions(+)
|
||||
create mode 100644 gdb/testsuite/gdb.arch/s390-vregs.S
|
||||
create mode 100644 gdb/testsuite/gdb.arch/s390-vregs.exp
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.arch/s390-vregs.S b/gdb/testsuite/gdb.arch/s390-vregs.S
|
||||
new file mode 100644
|
||||
index 0000000..4b48a83
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.arch/s390-vregs.S
|
||||
@@ -0,0 +1,96 @@
|
||||
+/* Copyright 2015 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This file is part of GDB.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+ .text
|
||||
+
|
||||
+ /* 'check_vx': Yield SIGILL unless vector support is
|
||||
+ available. Have a "pit stop" breakpoint here. */
|
||||
+
|
||||
+ .align 8
|
||||
+ .type check_vx, @function
|
||||
+check_vx:
|
||||
+ .cfi_startproc
|
||||
+ /* vlr %v0,%v0 */
|
||||
+ .byte 0xe7,0x00,0x00,0x00,0x00,0x56
|
||||
+ br %r14
|
||||
+ .cfi_endproc
|
||||
+ .size check_vx, .-check_vx
|
||||
+
|
||||
+
|
||||
+ /* 'store_vrs': Store vector registers in save_area. */
|
||||
+
|
||||
+ .align 8
|
||||
+ .type store_vrs, @function
|
||||
+store_vrs:
|
||||
+ .cfi_startproc
|
||||
+ larl %r1,save_area
|
||||
+ /* vstm %v0,%v15,0(%r1) */
|
||||
+ .byte 0xe7,0x0f,0x10,0x00,0x00,0x3e
|
||||
+ /* vstm %v16,%v31,256(%r1) */
|
||||
+ .byte 0xe7,0x0f,0x11,0x00,0x0c,0x3e
|
||||
+ br %r14
|
||||
+ .cfi_endproc
|
||||
+ .size store_vrs, .-store_vrs
|
||||
+
|
||||
+
|
||||
+ /* 'change_vrs': Manipulate vector registers according to a
|
||||
+ simple algorithm. */
|
||||
+
|
||||
+ .align 8
|
||||
+ .type change_vrs, @function
|
||||
+change_vrs:
|
||||
+ .cfi_startproc
|
||||
+ lghi %r1,16
|
||||
+ lghi %r3,0xff
|
||||
+1: exrl %r3,2f
|
||||
+ exrl %r3,1f
|
||||
+ aghi %r3,-0x11
|
||||
+ brctg %r1,1b
|
||||
+ br %r14
|
||||
+ .cfi_endproc
|
||||
+ /* vmlf %v0,%v0,%v0 */
|
||||
+1: .byte 0xe7,0x00,0x00,0x00,0x20,0xa2
|
||||
+ /* vmlf %v16,%v16,%v0 */
|
||||
+2: .byte 0xe7,0x00,0x00,0x00,0x2c,0xa2
|
||||
+
|
||||
+
|
||||
+ /* 'main': Perform actions according to test case logic.
|
||||
+ Invoke check_vx whenever a pit stop is required. */
|
||||
+
|
||||
+ .section .text.startup,"ax",@progbits
|
||||
+ .align 8
|
||||
+.globl main
|
||||
+ .type main, @function
|
||||
+main:
|
||||
+ .cfi_startproc
|
||||
+ stmg %r14,%r15,112(%r15)
|
||||
+ aghi %r15,-160
|
||||
+ bras %r14,check_vx
|
||||
+ bras %r14,store_vrs
|
||||
+ bras %r14,check_vx
|
||||
+ bras %r14,change_vrs
|
||||
+ bras %r14,check_vx
|
||||
+ lmg %r14,%r15,272(%r15)
|
||||
+ lghi %r2,0
|
||||
+ br %r14
|
||||
+ .cfi_endproc
|
||||
+ .size main, .-main
|
||||
+
|
||||
+ .local save_area
|
||||
+ .comm save_area,512,16
|
||||
+
|
||||
+ .section .note.GNU-stack,"",@progbits
|
||||
diff --git a/gdb/testsuite/gdb.arch/s390-vregs.exp b/gdb/testsuite/gdb.arch/s390-vregs.exp
|
||||
new file mode 100644
|
||||
index 0000000..8333c32
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.arch/s390-vregs.exp
|
||||
@@ -0,0 +1,202 @@
|
||||
+# Copyright 2015 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+# Test vector register access for s390 platforms.
|
||||
+
|
||||
+if { ![istarget s390-*-*] && ![istarget s390x-*-* ] } {
|
||||
+ verbose "Skipping s390 vector register tests."
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
+standard_testfile .S
|
||||
+
|
||||
+if [isnative] {
|
||||
+ # Create a temporary directory, to take a core dump there later.
|
||||
+ set coredir [standard_output_file ${testfile}.d]
|
||||
+ remote_exec build "rm -rf $coredir"
|
||||
+ remote_exec build "mkdir $coredir"
|
||||
+}
|
||||
+
|
||||
+if { [prepare_for_testing ${testfile}.exp $testfile $srcfile] } {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+if ![runto_main] {
|
||||
+ untested "could not run to main"
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# Run to the first vector instruction and step it. If the inferior
|
||||
+# doesn't crash, we have vector support.
|
||||
+
|
||||
+gdb_breakpoint "check_vx"
|
||||
+gdb_continue_to_breakpoint "first vector insn"
|
||||
+set before_pc 0
|
||||
+gdb_test_multiple "x/i \$pc" "get PC at vector insn" {
|
||||
+ -re "(0x\\S+)\\s+\\S+\\s+vlr\\s+.*$gdb_prompt $" {
|
||||
+ set before_pc $expect_out(1,string)
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+gdb_test_multiple "stepi" "check for vector support" {
|
||||
+ -re "Program received signal SIGILL,.*\r\n$gdb_prompt $" {
|
||||
+ unsupported "no vector support."
|
||||
+ return
|
||||
+ }
|
||||
+ -re "\[0-9\]+.*\r\n$gdb_prompt $" {
|
||||
+ pass "vector support available"
|
||||
+ }
|
||||
+ -re "$gdb_prompt $" {
|
||||
+ fail "no vector support (unknown error)"
|
||||
+ return
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+# Has the PC advanced by the expected amount? The kernel may do
|
||||
+# something special for the first vector insn in the process.
|
||||
+
|
||||
+set after_pc 0
|
||||
+gdb_test_multiple "x/i \$pc" "get PC after vector insn" {
|
||||
+ -re "(0x\\S+)\\s+.*$gdb_prompt $" {
|
||||
+ set after_pc $expect_out(1,string)
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+if [expr $before_pc + 6 != $after_pc] {
|
||||
+ fail "stepping first vector insn"
|
||||
+}
|
||||
+
|
||||
+# Lift the core file limit, if possible, and change into the temporary
|
||||
+# directory.
|
||||
+
|
||||
+if { $coredir != "" } {
|
||||
+ gdb_test {print setrlimit (4, &(unsigned long [2]){~0UL, ~0UL})} \
|
||||
+ " = .*" "setrlimit"
|
||||
+ gdb_test "print chdir (\"${coredir}\")" " = 0" "chdir"
|
||||
+}
|
||||
+
|
||||
+# Initialize all vector registers with GDB "set" commands, using
|
||||
+# distinct values. Handle left and right halves separately, in
|
||||
+# pseudo-random order.
|
||||
+
|
||||
+set a_high 1
|
||||
+set a_low 2
|
||||
+set b_high 3
|
||||
+set b_low 5
|
||||
+
|
||||
+set a [expr ($a_high << 32) | $a_low]
|
||||
+set b [expr ($b_high << 32) | $b_low]
|
||||
+
|
||||
+for {set j 0} {$j < 32} {incr j 1} {
|
||||
+ set i [expr 17 * $j % 32]
|
||||
+ gdb_test_no_output \
|
||||
+ "set \$v$i.v2_int64\[0\] = [expr $a * ($i + 1)]" \
|
||||
+ "set v$i left"
|
||||
+ set i [expr 19 * (31 - $j) % 32]
|
||||
+ gdb_test_no_output \
|
||||
+ "set \$v$i.v2_int64\[1\] = [expr $b * (32 - $i)]" \
|
||||
+ "set v$i right"
|
||||
+}
|
||||
+
|
||||
+# Verify a vector register's union members.
|
||||
+
|
||||
+gdb_test "info register v0 v31" \
|
||||
+ "v4_float .* v2_double .* v16_int8 .* v8_int16 .* v4_int32 .* v2_int64 .* uint128\
|
||||
+ .*v4_float .* v2_double .* v16_int8 .* v8_int16 .* v4_int32 .* v2_int64 .* uint128 .*"
|
||||
+
|
||||
+# Let the inferior store all vector registers in a buffer, then dump
|
||||
+# the buffer and check it.
|
||||
+
|
||||
+gdb_continue_to_breakpoint "store vrs"
|
||||
+set vregs [capture_command_output "x/64xg &save_area" ""]
|
||||
+
|
||||
+set i 0
|
||||
+foreach {- left right} [regexp -all -inline -line {^.*:\s+(\w+)\s+(\w+)} $vregs] {
|
||||
+ if [expr $left != $a * ($i + 1) || $right != $b * (32 - $i)] {
|
||||
+ fail "verify \$v$i after set"
|
||||
+ }
|
||||
+ if { $i < 16 } {
|
||||
+ # Check that the FP register was updated accordingly.
|
||||
+ gdb_test "info register f$i" "raw ${left}.*"
|
||||
+ }
|
||||
+ incr i 1
|
||||
+}
|
||||
+
|
||||
+if { $i != 32 } {
|
||||
+ fail "dump save area (bad output)"
|
||||
+}
|
||||
+
|
||||
+# Let the inferior change all VRs according to a simple algorithm,
|
||||
+# then print all VRs and compare their values with our result of the
|
||||
+# same algorithm.
|
||||
+
|
||||
+gdb_continue_to_breakpoint "change vrs"
|
||||
+set vregs [capture_command_output "info registers vector" ""]
|
||||
+
|
||||
+set j 1
|
||||
+foreach {- r i val} [regexp -all -inline -line \
|
||||
+ {^(\D*)(\d+)\s+.*?uint128 = 0x([0-9a-f]+?)} $vregs] {
|
||||
+ if { $r ne "v" } {
|
||||
+ fail "info registers vector: bad line $j"
|
||||
+ } elseif { $val ne [format %08x%08x%08x%08x \
|
||||
+ [expr $a_high * ($i + 1) * $a_high ] \
|
||||
+ [expr $a_low * ($i + 1) * $a_low ] \
|
||||
+ [expr $b_high * (32 - $i) * $b_high * 32] \
|
||||
+ [expr $b_low * (32 - $i) * $b_low * 32] ] } {
|
||||
+ fail "compare \$v$i"
|
||||
+ }
|
||||
+ incr j 1
|
||||
+}
|
||||
+
|
||||
+if { $j != 33 } {
|
||||
+ fail "info registers vector"
|
||||
+}
|
||||
+
|
||||
+if { $coredir == "" } {
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
+# Take a core dump.
|
||||
+
|
||||
+gdb_test "signal SIGABRT" "Program terminated with signal SIGABRT, .*"
|
||||
+gdb_exit
|
||||
+
|
||||
+# Find the core file and rename it (avoid accumulating core files).
|
||||
+
|
||||
+set cores [glob -nocomplain -directory $coredir *core*]
|
||||
+if {[llength $cores] != 1} {
|
||||
+ untested "core file not found"
|
||||
+ remote_exec build "rm -rf $coredir"
|
||||
+ return -1
|
||||
+}
|
||||
+set destcore [standard_output_file ${testfile}.core]
|
||||
+remote_exec build "mv [file join $coredir [lindex $cores 0]] $destcore"
|
||||
+remote_exec build "rm -rf $coredir"
|
||||
+
|
||||
+# Restart gdb and load the core file. Compare the VRs.
|
||||
+
|
||||
+clean_restart ${testfile}
|
||||
+
|
||||
+with_test_prefix "core" {
|
||||
+ set core_loaded [gdb_core_cmd $destcore "load"]
|
||||
+ if { $core_loaded != -1 } {
|
||||
+ set vregs_from_core [capture_command_output "info registers vector" ""]
|
||||
+ if { $vregs_from_core eq $vregs } {
|
||||
+ pass "compare vector registers"
|
||||
+ } else {
|
||||
+ fail "vector registers mismatch"
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
1.8.1.4
|
||||
|
@ -0,0 +1,47 @@
|
||||
Part of fate#318039
|
||||
|
||||
From 87de11c05253566abb04479a4842cc934d0c822e Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Arnez <arnez@linux.vnet.ibm.com>
|
||||
Date: Wed, 4 Mar 2015 10:40:41 +0100
|
||||
Subject: [PATCH] S390: Name "invisible" registers with the empty string
|
||||
instead of NULL
|
||||
|
||||
When adding vector register support to GDB, s390_register_name() was
|
||||
added to suppress the right halves of the first 16 vector registers.
|
||||
However, that function returned NULL instead of an empty string in such
|
||||
a case. This leads to an incomplete list of registers returned by
|
||||
"complete info registers ", because completion stops at the first NULL
|
||||
return value from user_reg_map_regnum_to_name().
|
||||
|
||||
gdb/ChangeLog:
|
||||
|
||||
* s390-linux-tdep.c (s390_register_name): Return empty string
|
||||
instead of NULL for registers that shouldn't be visible.
|
||||
---
|
||||
gdb/ChangeLog | 5 +++++
|
||||
gdb/s390-linux-tdep.c | 6 +++---
|
||||
2 files changed, 8 insertions(+), 3 deletions(-)
|
||||
|
||||
Index: gdb-7.9.1/gdb/s390-linux-tdep.c
|
||||
===================================================================
|
||||
--- gdb-7.9.1.orig/gdb/s390-linux-tdep.c 2015-07-10 16:18:36.000000000 +0200
|
||||
+++ gdb-7.9.1/gdb/s390-linux-tdep.c 2015-07-10 16:19:20.000000000 +0200
|
||||
@@ -263,15 +263,15 @@ regnum_is_vxr_full (struct gdbarch_tdep
|
||||
&& regnum <= tdep->v0_full_regnum + 15);
|
||||
}
|
||||
|
||||
-/* Return the name of register REGNO. Return NULL for registers that
|
||||
- shouldn't be visible. */
|
||||
+/* Return the name of register REGNO. Return the empty string for
|
||||
+ registers that shouldn't be visible. */
|
||||
|
||||
static const char *
|
||||
s390_register_name (struct gdbarch *gdbarch, int regnum)
|
||||
{
|
||||
if (regnum >= S390_V0_LOWER_REGNUM
|
||||
&& regnum <= S390_V15_LOWER_REGNUM)
|
||||
- return NULL;
|
||||
+ return "";
|
||||
return tdesc_register_name (gdbarch, regnum);
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
Index: gdb-7.7/gdb/build-id.c
|
||||
Index: gdb-7.9.1/gdb/build-id.c
|
||||
===================================================================
|
||||
--- gdb-7.7.orig/gdb/build-id.c 2014-02-09 17:47:19.091979560 +0100
|
||||
+++ gdb-7.7/gdb/build-id.c 2014-02-09 17:50:48.936211228 +0100
|
||||
@@ -828,9 +828,9 @@ missing_rpm_enlist (const char *filename
|
||||
--- gdb-7.9.1.orig/gdb/build-id.c 2015-07-10 15:24:05.000000000 +0200
|
||||
+++ gdb-7.9.1/gdb/build-id.c 2015-07-10 15:24:51.000000000 +0200
|
||||
@@ -827,9 +827,9 @@ missing_rpm_enlist (const char *filename
|
||||
if (h == NULL)
|
||||
break;
|
||||
|
||||
@ -15,7 +15,7 @@ Index: gdb-7.7/gdb/build-id.c
|
||||
&err);
|
||||
if (!debuginfo)
|
||||
{
|
||||
@@ -838,60 +838,19 @@ missing_rpm_enlist (const char *filename
|
||||
@@ -837,60 +837,19 @@ missing_rpm_enlist (const char *filename
|
||||
err);
|
||||
continue;
|
||||
}
|
||||
@ -78,16 +78,19 @@ Index: gdb-7.7/gdb/build-id.c
|
||||
/* Base package name for `debuginfo-install'. We do not use the
|
||||
`yum' command directly as the line
|
||||
yum --enablerepo='*debug*' install NAME-debuginfo.ARCH
|
||||
@@ -976,7 +935,7 @@ missing_rpm_list_print (void)
|
||||
@@ -975,10 +934,7 @@ missing_rpm_list_print (void)
|
||||
(int (*) (const void *, const void *)) missing_rpm_list_compar);
|
||||
|
||||
printf_unfiltered (_("Missing separate debuginfos, use: %s"),
|
||||
-#ifdef DNF_DEBUGINFO_INSTALL
|
||||
- "dnf "
|
||||
-#endif
|
||||
- "debuginfo-install");
|
||||
+ "zypper install");
|
||||
for (array_iter = array; array_iter < array + missing_rpm_list_entries;
|
||||
array_iter++)
|
||||
{
|
||||
@@ -1189,8 +1148,12 @@ debug_print_missing (const char *binary,
|
||||
@@ -1191,8 +1147,12 @@ debug_print_missing (const char *binary,
|
||||
fprintf_unfiltered (gdb_stdlog,
|
||||
_("Missing separate debuginfo for %s\n"), binary);
|
||||
if (debug != NULL)
|
||||
|
@ -1109,7 +1109,7 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
|
||||
|
||||
#define BUILD_ID_VERBOSE_NONE 0
|
||||
#define BUILD_ID_VERBOSE_FILENAMES 1
|
||||
@@ -664,8 +665,360 @@ build_id_to_filename (const struct elf_b
|
||||
@@ -664,8 +665,363 @@ build_id_to_filename (const struct elf_b
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -1409,6 +1409,9 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
|
||||
+ (int (*) (const void *, const void *)) missing_rpm_list_compar);
|
||||
+
|
||||
+ printf_unfiltered (_("Missing separate debuginfos, use: %s"),
|
||||
+#ifdef DNF_DEBUGINFO_INSTALL
|
||||
+ "dnf "
|
||||
+#endif
|
||||
+ "debuginfo-install");
|
||||
+ for (array_iter = array; array_iter < array + missing_rpm_list_entries;
|
||||
+ array_iter++)
|
||||
|
3
gdb-7.9.1.tar.bz2
Normal file
3
gdb-7.9.1.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6cb109cbbfb64a407863a15bc2a775a6bab52e5a6956a4ef3616b70cc4685b83
|
||||
size 25684304
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d04003a1438c8a0716db4070bc3f2b28ee15fb4aea279d409acf7bf722174e4a
|
||||
size 25696983
|
106
gdb-s390-reorder-arch.diff
Normal file
106
gdb-s390-reorder-arch.diff
Normal file
@ -0,0 +1,106 @@
|
||||
Fix for bnc #936050.
|
||||
|
||||
From 48cfb913ac0ad24b978514270886b807d6f2495e Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Arnez <arnez@linux.vnet.ibm.com>
|
||||
Date: Wed, 4 Mar 2015 10:40:39 +0100
|
||||
Subject: [PATCH 05/25] S390: Place "s390:31-bit" after default arch in 64-bit
|
||||
arch list
|
||||
|
||||
On 64-bit platforms GDB did not include "s390:31-bit" in its list of
|
||||
architecture names. This patch fixes that.
|
||||
|
||||
To determine the list of architecture names for S390,
|
||||
gdbarch_printable_names() walks through the linked list of BFD arches
|
||||
starting with the default S390 arch, which is "s390:64-bit" on 64-bit
|
||||
platforms. But since "s390:64-bit" was at the end of that list, the
|
||||
31-bit architecture was not reached. The patch swaps the elements of
|
||||
that list on 64-bit platforms.
|
||||
|
||||
bfd/ChangeLog:
|
||||
|
||||
* cpu-s390.c (N): New macro.
|
||||
(bfd_s390_31_arch): New. Define only if default target word size
|
||||
is 64 bits. Otherwise define...
|
||||
(bfd_390_64_arch): ...this. Make static.
|
||||
(bfd_s390_arch): Define according to the default target word size.
|
||||
Let the 'next' field point to the alternate arch.
|
||||
---
|
||||
bfd/cpu-s390.c | 61 +++++++++++++++++++++++-----------------------------------
|
||||
1 file changed, 24 insertions(+), 37 deletions(-)
|
||||
|
||||
diff --git a/bfd/cpu-s390.c b/bfd/cpu-s390.c
|
||||
index 5fd3271..dbdec4a 100644
|
||||
--- a/bfd/cpu-s390.c
|
||||
+++ b/bfd/cpu-s390.c
|
||||
@@ -23,44 +23,31 @@
|
||||
#include "bfd.h"
|
||||
#include "libbfd.h"
|
||||
|
||||
-const bfd_arch_info_type bfd_s390_64_arch =
|
||||
-{
|
||||
- 64, /* bits in a word */
|
||||
- 64, /* bits in an address */
|
||||
- 8, /* bits in a byte */
|
||||
- bfd_arch_s390,
|
||||
- bfd_mach_s390_64,
|
||||
- "s390",
|
||||
- "s390:64-bit",
|
||||
- 3, /* section alignment power */
|
||||
-#if BFD_DEFAULT_TARGET_SIZE == 64
|
||||
- TRUE, /* the default */
|
||||
-#else
|
||||
- FALSE, /* the default */
|
||||
-#endif
|
||||
- bfd_default_compatible,
|
||||
- bfd_default_scan,
|
||||
- bfd_arch_default_fill,
|
||||
- NULL
|
||||
-};
|
||||
+#define N(bits, number, print, is_default, next) \
|
||||
+ { \
|
||||
+ bits, /* bits in a word */ \
|
||||
+ bits, /* bits in an address */ \
|
||||
+ 8, /* bits in a byte */ \
|
||||
+ bfd_arch_s390, \
|
||||
+ number, \
|
||||
+ "s390", \
|
||||
+ print, \
|
||||
+ 3, /* section alignment power */ \
|
||||
+ is_default, \
|
||||
+ bfd_default_compatible, \
|
||||
+ bfd_default_scan, \
|
||||
+ bfd_arch_default_fill, \
|
||||
+ next \
|
||||
+ }
|
||||
|
||||
-const bfd_arch_info_type bfd_s390_arch =
|
||||
-{
|
||||
- 32, /* bits in a word */
|
||||
- 32, /* bits in an address */
|
||||
- 8, /* bits in a byte */
|
||||
- bfd_arch_s390,
|
||||
- bfd_mach_s390_31,
|
||||
- "s390",
|
||||
- "s390:31-bit",
|
||||
- 3, /* section alignment power */
|
||||
#if BFD_DEFAULT_TARGET_SIZE == 64
|
||||
- FALSE, /* the default */
|
||||
+static const bfd_arch_info_type bfd_s390_31_arch =
|
||||
+ N (32, bfd_mach_s390_31, "s390:31-bit", FALSE, NULL);
|
||||
+const bfd_arch_info_type bfd_s390_arch =
|
||||
+ N (64, bfd_mach_s390_64, "s390:64-bit", TRUE, &bfd_s390_31_arch);
|
||||
#else
|
||||
- TRUE, /* the default */
|
||||
+static const bfd_arch_info_type bfd_s390_64_arch =
|
||||
+ N (64, bfd_mach_s390_64, "s390:64-bit", FALSE, NULL);
|
||||
+const bfd_arch_info_type bfd_s390_arch =
|
||||
+ N (32, bfd_mach_s390_31, "s390:31-bit", TRUE, &bfd_s390_64_arch);
|
||||
#endif
|
||||
- bfd_default_compatible,
|
||||
- bfd_default_scan,
|
||||
- bfd_arch_default_fill,
|
||||
- &bfd_s390_64_arch
|
||||
-};
|
||||
--
|
||||
1.9.3
|
||||
|
15
gdb.changes
15
gdb.changes
@ -1,3 +1,18 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Jul 10 13:49:28 UTC 2015 - matz@suse.de
|
||||
|
||||
- Rebase to gdb version 7.9.1:
|
||||
fixes PR python/18299, python/18285.
|
||||
- Add gdb-s390-reorder-arch.diff [bnc #936050]
|
||||
- Added patches for fate#318039, s390 z13 support:
|
||||
0001-S390-Fix-compiler-invocation-with-compile-command.patch
|
||||
0001-S390-Support-new-vector-register-sections.patch
|
||||
0001-S390-Add-target-descriptions-for-vector-register-set.patch
|
||||
0002-S390-Add-vector-register-support-to-gdb.patch
|
||||
0003-S390-Add-vector-register-support-to-gdbserver.patch
|
||||
0004-S390-Vector-register-test-case.patch
|
||||
0005-S390-Name-invisible-registers-with-the-empty-string-.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jul 2 13:26:29 UTC 2015 - rguenther@suse.com
|
||||
|
||||
|
22
gdb.spec
22
gdb.spec
@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package gdb
|
||||
#
|
||||
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2012 RedHat
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
@ -27,7 +27,7 @@ Name: gdb
|
||||
%global snap 20130731
|
||||
# See timestamp of source gnulib installed into gdb/gnulib/ .
|
||||
%global snapgnulib 20121213
|
||||
Version: 7.9
|
||||
Version: 7.9.1
|
||||
Release: 0
|
||||
|
||||
# The release always contains a leading reserved number, start it at 1.
|
||||
@ -212,6 +212,16 @@ Patch117: gdb-rhel5-compat.patch
|
||||
|
||||
# Upstream patch to fix gcc -Werror
|
||||
Patch1002: gdb-6.6-buildid-locate-rpm-suse.patch
|
||||
# Upstream patch for reordering "s390:31-bit" (bnc#936050)
|
||||
Patch1003: gdb-s390-reorder-arch.diff
|
||||
# fate#318039
|
||||
Patch1004: 0001-S390-Fix-compiler-invocation-with-compile-command.patch
|
||||
Patch1005: 0001-S390-Support-new-vector-register-sections.patch
|
||||
Patch1006: 0001-S390-Add-target-descriptions-for-vector-register-set.patch
|
||||
Patch1007: 0002-S390-Add-vector-register-support-to-gdb.patch
|
||||
Patch1008: 0003-S390-Add-vector-register-support-to-gdbserver.patch
|
||||
Patch1009: 0004-S390-Vector-register-test-case.patch
|
||||
Patch1010: 0005-S390-Name-invisible-registers-with-the-empty-string-.patch
|
||||
|
||||
BuildRequires: bison
|
||||
BuildRequires: flex
|
||||
@ -473,6 +483,14 @@ find -name "*.info*"|xargs rm -f
|
||||
#Fedora patching end
|
||||
|
||||
%patch1002 -p1
|
||||
%patch1003 -p1
|
||||
%patch1004 -p1
|
||||
%patch1005 -p1
|
||||
%patch1006 -p1
|
||||
%patch1007 -p1
|
||||
%patch1008 -p1
|
||||
%patch1009 -p1
|
||||
%patch1010 -p1
|
||||
|
||||
find -name "*.orig" | xargs rm -f
|
||||
! find -name "*.rej" # Should not happen.
|
||||
|
@ -29,7 +29,7 @@ foreach my $line (@patchliste) {
|
||||
}
|
||||
else {
|
||||
$count = $count + 1;
|
||||
push @patchdeklarationen, "Patch$count: $patchname\n";
|
||||
push @patchdeklarationen, "Patch$count: ". (($count < 10) ? " " : (($count < 100) ? " " : "")) ."$patchname\n";
|
||||
push @patchstatements, "%patch$count -p1\n";
|
||||
$seenpatches{$patchname} = $count;
|
||||
push @patchcopy, $patchname;
|
||||
|
Loading…
x
Reference in New Issue
Block a user