Accepting request 354613 from devel:gcc

- Rebase to gdb version 7.10.1 as of version in Fedora 23:
  * reverse debugging on aarch64
  * new commands or subcommands:
    - info os cpu, set/show serial parity, info dll
    - maint print symbol-cache/symbol-cache-statistics,
      maint flush-symbol-cache
    - record btrace bts, record bts
    - compile print
    - show/set mpx bound
    - tui enable/disable
    - record btrace pt, record pt
    - maint info btrace,
      maint btrace packet-history/clear-packet-history/clear
  * s390 support for vector ABI
  * "set sysroot" improvements related to remote targets
  * better support for debugging containerized programs
    (without "set sysroot")
  * HISTSIZE environment variable is replaced by GDBHISTSIZE
  * python scripting:
    - it's possible to write frame unwinders
    - several new methods in Objfile, Type and Value classes
    - gdb can auto-load scripts contained in special sections
      named '.debug_gdb_scripts'.
  * extensions for the MI interface, new remote packet types
- Removed obsolete patches:
    0001-S390-Add-target-descriptions-for-vector-register-set.patch
    0001-S390-Fix-compiler-invocation-with-compile-command.patch
    0001-S390-Support-new-vector-register-sections.patch
    0002-S390-Add-vector-register-support-to-gdb.patch
    0003-S390-Add-vector-register-support-to-gdbserver.patch

OBS-URL: https://build.opensuse.org/request/show/354613
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/gdb?expand=0&rev=108
This commit is contained in:
Dominique Leuenberger 2016-02-03 09:18:52 +00:00 committed by Git OBS Bridge
commit 4138e47cac
52 changed files with 2452 additions and 6075 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,73 +0,0 @@
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

View File

@ -1,157 +0,0 @@
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

View File

@ -1,744 +0,0 @@
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 (&current_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 (&current_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

View File

@ -1,293 +0,0 @@
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__

View File

@ -1,334 +0,0 @@
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

View File

@ -1,47 +0,0 @@
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);
}

View File

@ -97,7 +97,7 @@ Index: gdb-7.7/gdb/gstack.sh
+ fi
+fi
+
+GDB=${GDB:-/usr/bin/gdb}
+GDB=${GDB:-gdb}
+
+# Run GDB, strip out unwanted noise.
+# --readnever is no longer used since .gdb_index is now in use.

View File

@ -11,10 +11,10 @@
* gdb.texinfo (File Options): Document --readnever.
Index: gdb-7.8.50.20141228/gdb/doc/gdb.texinfo
Index: gdb-7.9.50.20150520/gdb/doc/gdb.texinfo
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/doc/gdb.texinfo 2015-01-01 17:01:08.308881292 +0100
+++ gdb-7.8.50.20141228/gdb/doc/gdb.texinfo 2015-01-01 17:01:10.302880126 +0100
--- gdb-7.9.50.20150520.orig/gdb/doc/gdb.texinfo 2015-05-31 16:34:58.436379663 +0200
+++ gdb-7.9.50.20150520/gdb/doc/gdb.texinfo 2015-05-31 16:35:03.452416381 +0200
@@ -1032,6 +1032,12 @@ Read each symbol file's entire symbol ta
the default, which is to read it incrementally as it is needed.
This makes startup slower, but makes future operations faster.
@ -28,19 +28,19 @@ Index: gdb-7.8.50.20141228/gdb/doc/gdb.texinfo
@end table
@node Mode Options
Index: gdb-7.8.50.20141228/gdb/main.c
Index: gdb-7.9.50.20150520/gdb/main.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/main.c 2015-01-01 17:01:08.312881290 +0100
+++ gdb-7.8.50.20141228/gdb/main.c 2015-01-01 17:01:10.303880125 +0100
@@ -590,6 +590,7 @@ captured_main (void *data)
{"xdb", no_argument, &xdb_commands, 1},
--- gdb-7.9.50.20150520.orig/gdb/main.c 2015-05-31 16:34:58.439379685 +0200
+++ gdb-7.9.50.20150520/gdb/main.c 2015-05-31 16:35:20.547541518 +0200
@@ -604,6 +604,7 @@ captured_main (void *data)
{"tui", no_argument, 0, OPT_TUI},
{"dbx", no_argument, &dbx_commands, 1},
{"readnow", no_argument, &readnow_symbol_files, 1},
+ {"readnever", no_argument, &readnever_symbol_files, 1},
{"r", no_argument, &readnow_symbol_files, 1},
{"quiet", no_argument, &quiet, 1},
{"q", no_argument, &quiet, 1},
@@ -1245,6 +1246,7 @@ Selection of debuggee and its files:\n\n
@@ -1253,6 +1254,7 @@ Selection of debuggee and its files:\n\n
--se=FILE Use FILE as symbol file and executable file.\n\
--symbols=SYMFILE Read symbols from SYMFILE.\n\
--readnow Fully read symbol files on first access.\n\
@ -48,10 +48,10 @@ Index: gdb-7.8.50.20141228/gdb/main.c
--write Set writing into executable and core files.\n\n\
"), stream);
fputs_unfiltered (_("\
Index: gdb-7.8.50.20141228/gdb/symfile.c
Index: gdb-7.9.50.20150520/gdb/symfile.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/symfile.c 2015-01-01 17:01:08.313881289 +0100
+++ gdb-7.8.50.20141228/gdb/symfile.c 2015-01-01 17:01:10.304880125 +0100
--- gdb-7.9.50.20150520.orig/gdb/symfile.c 2015-05-31 16:34:58.440379692 +0200
+++ gdb-7.9.50.20150520/gdb/symfile.c 2015-05-31 16:35:03.454416395 +0200
@@ -80,6 +80,7 @@ static void clear_symtab_users_cleanup (
/* Global variables owned by this file. */
@ -60,10 +60,10 @@ Index: gdb-7.8.50.20141228/gdb/symfile.c
/* Functions this file defines. */
Index: gdb-7.8.50.20141228/gdb/dwarf2read.c
Index: gdb-7.9.50.20150520/gdb/dwarf2read.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/dwarf2read.c 2015-01-01 17:01:08.319881285 +0100
+++ gdb-7.8.50.20141228/gdb/dwarf2read.c 2015-01-01 17:01:26.888870511 +0100
--- gdb-7.9.50.20150520.orig/gdb/dwarf2read.c 2015-05-31 16:34:58.446379736 +0200
+++ gdb-7.9.50.20150520/gdb/dwarf2read.c 2015-05-31 16:35:03.459416432 +0200
@@ -69,6 +69,7 @@
#include "source.h"
#include "filestuff.h"
@ -72,7 +72,7 @@ Index: gdb-7.8.50.20141228/gdb/dwarf2read.c
#include <fcntl.h>
#include <sys/types.h>
@@ -1989,7 +1990,8 @@ dwarf2_has_info (struct objfile *objfile
@@ -2050,7 +2051,8 @@ dwarf2_has_info (struct objfile *objfile
(void *) names);
dwarf2_per_objfile->objfile = objfile;
}
@ -82,10 +82,10 @@ Index: gdb-7.8.50.20141228/gdb/dwarf2read.c
&& dwarf2_per_objfile->info.s.asection != NULL
&& !dwarf2_per_objfile->abbrev.is_virtual
&& dwarf2_per_objfile->abbrev.s.asection != NULL);
Index: gdb-7.8.50.20141228/gdb/top.h
Index: gdb-7.9.50.20150520/gdb/top.h
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/top.h 2015-01-01 17:01:08.320881284 +0100
+++ gdb-7.8.50.20141228/gdb/top.h 2015-01-01 17:01:10.310880121 +0100
--- gdb-7.9.50.20150520.orig/gdb/top.h 2015-05-31 16:34:58.448379751 +0200
+++ gdb-7.9.50.20150520/gdb/top.h 2015-05-31 16:35:03.459416432 +0200
@@ -67,6 +67,7 @@ extern void set_prompt (const char *s);
/* From random places. */

View File

@ -1,40 +1,39 @@
Index: gdb-7.8.50.20141228/gdb/testsuite/configure.ac
Index: gdb-7.9.50.20150520/gdb/testsuite/configure.ac
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/testsuite/configure.ac 2015-01-01 17:00:26.123908948 +0100
+++ gdb-7.8.50.20141228/gdb/testsuite/configure.ac 2015-01-01 17:00:43.168897773 +0100
@@ -106,6 +106,6 @@ AC_OUTPUT([Makefile \
gdb.hp/gdb.aCC/Makefile gdb.hp/gdb.compat/Makefile \
gdb.hp/gdb.defects/Makefile gdb.guile/Makefile gdb.linespec/Makefile \
--- gdb-7.9.50.20150520.orig/gdb/testsuite/configure.ac 2015-05-31 16:34:02.396969450 +0200
+++ gdb-7.9.50.20150520/gdb/testsuite/configure.ac 2015-05-31 16:34:33.443196711 +0200
@@ -114,5 +114,5 @@ AC_OUTPUT([Makefile \
gdb.guile/Makefile gdb.linespec/Makefile \
gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile \
- gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile \
+ gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile \
gdb.perf/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.stabs/Makefile \
gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile \
- gdb.perf/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.stabs/Makefile \
+ gdb.perf/Makefile gdb.pie/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.stabs/Makefile \
gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile])
Index: gdb-7.8.50.20141228/gdb/testsuite/configure
Index: gdb-7.9.50.20150520/gdb/testsuite/configure
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/testsuite/configure 2015-01-01 17:00:26.124908947 +0100
+++ gdb-7.8.50.20141228/gdb/testsuite/configure 2015-01-01 17:00:59.467887088 +0100
@@ -3458,7 +3458,7 @@ if test "${build}" = "${host}" -a "${hos
fi
--- gdb-7.9.50.20150520.orig/gdb/testsuite/configure 2015-05-31 16:33:53.154901798 +0200
+++ gdb-7.9.50.20150520/gdb/testsuite/configure 2015-05-31 16:34:48.654308057 +0200
@@ -3514,7 +3514,7 @@ program_transform_name=`$as_echo "$progr
ac_config_files="$ac_config_files lib/pdtrace"
-ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.btrace/Makefile gdb.cell/Makefile gdb.compile/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.dlang/Makefile gdb.fortran/Makefile gdb.gdb/Makefile gdb.go/Makefile gdb.server/Makefile gdb.java/Makefile gdb.hp/Makefile gdb.hp/gdb.objdbg/Makefile gdb.hp/gdb.base-hp/Makefile gdb.hp/gdb.aCC/Makefile gdb.hp/gdb.compat/Makefile gdb.hp/gdb.defects/Makefile gdb.guile/Makefile gdb.linespec/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.perf/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.stabs/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile"
+ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.btrace/Makefile gdb.cell/Makefile gdb.compile/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.dlang/Makefile gdb.fortran/Makefile gdb.gdb/Makefile gdb.go/Makefile gdb.server/Makefile gdb.java/Makefile gdb.hp/Makefile gdb.hp/gdb.objdbg/Makefile gdb.hp/gdb.base-hp/Makefile gdb.hp/gdb.aCC/Makefile gdb.hp/gdb.compat/Makefile gdb.hp/gdb.defects/Makefile gdb.guile/Makefile gdb.linespec/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile gdb.perf/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.stabs/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile"
-ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.btrace/Makefile gdb.cell/Makefile gdb.compile/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.dlang/Makefile gdb.fortran/Makefile gdb.gdb/Makefile gdb.go/Makefile gdb.server/Makefile gdb.java/Makefile gdb.guile/Makefile gdb.linespec/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.perf/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.stabs/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile"
+ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.btrace/Makefile gdb.cell/Makefile gdb.compile/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.dlang/Makefile gdb.fortran/Makefile gdb.gdb/Makefile gdb.go/Makefile gdb.server/Makefile gdb.java/Makefile gdb.guile/Makefile gdb.linespec/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.perf/Makefile gdb.pie/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.stabs/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -4190,6 +4190,7 @@ do
"gdb.opencl/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.opencl/Makefile" ;;
@@ -4242,6 +4242,7 @@ do
"gdb.opt/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.opt/Makefile" ;;
"gdb.pascal/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.pascal/Makefile" ;;
+ "gdb.pie/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.pie/Makefile" ;;
"gdb.perf/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.perf/Makefile" ;;
+ "gdb.pie/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.pie/Makefile" ;;
"gdb.python/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.python/Makefile" ;;
"gdb.reverse/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.reverse/Makefile" ;;
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/attach.c
"gdb.stabs/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.stabs/Makefile" ;;
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.pie/attach.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/attach.c 2015-01-01 17:00:43.169897773 +0100
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.pie/attach.c 2015-05-31 16:34:02.398969465 +0200
@@ -0,0 +1,20 @@
+/* This program is intended to be started outside of gdb, and then
+ attached to by gdb. Thus, it simply spins in a loop. The loop
@ -56,10 +55,10 @@ Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/attach.c
+ }
+ return 0;
+}
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/attach2.c
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.pie/attach2.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/attach2.c 2015-01-01 17:00:43.170897772 +0100
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.pie/attach2.c 2015-05-31 16:34:02.398969465 +0200
@@ -0,0 +1,24 @@
+/* This program is intended to be started outside of gdb, and then
+ attached to by gdb. Thus, it simply spins in a loop. The loop
@ -85,10 +84,10 @@ Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/attach2.c
+ }
+ return (0);
+}
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/break.c
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.pie/break.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/break.c 2015-01-01 17:00:43.170897772 +0100
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.pie/break.c 2015-05-31 16:34:02.399969472 +0200
@@ -0,0 +1,146 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -236,10 +235,10 @@ Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/break.c
+ }
+ return 0;
+}
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/break1.c
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.pie/break1.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/break1.c 2015-01-01 17:00:43.170897772 +0100
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.pie/break1.c 2015-05-31 16:34:02.399969472 +0200
@@ -0,0 +1,44 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -285,10 +284,10 @@ Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/break1.c
+void marker3 (a, b) char *a, *b; {} /* set breakpoint 18 here */
+void marker4 (d) long d; {} /* set breakpoint 13 here */
+#endif
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/coremaker.c
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.pie/coremaker.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/coremaker.c 2015-01-01 17:00:43.170897772 +0100
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.pie/coremaker.c 2015-05-31 16:34:02.399969472 +0200
@@ -0,0 +1,142 @@
+/* Copyright 1992, 1993, 1994, 1995, 1996, 1999
+ Free Software Foundation, Inc.
@ -432,10 +431,10 @@ Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/coremaker.c
+ return 0;
+}
+
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/attach.exp
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.pie/attach.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/attach.exp 2015-01-01 17:00:43.171897771 +0100
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.pie/attach.exp 2015-05-31 16:34:02.400969480 +0200
@@ -0,0 +1,417 @@
+# Copyright 1997, 1999, 2002 Free Software Foundation, Inc.
+
@ -854,10 +853,10 @@ Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/attach.exp
+do_call_attach_tests
+
+return 0
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/break.exp
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.pie/break.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/break.exp 2015-01-01 17:00:43.172897771 +0100
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.pie/break.exp 2015-05-31 16:34:02.401969487 +0200
@@ -0,0 +1,962 @@
+# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2002, 2003, 2004
@ -1821,10 +1820,10 @@ Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/break.exp
+ send_gdb "set args main\n"
+ gdb_expect -re ".*$gdb_prompt $" {}
+}
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/corefile.exp
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.pie/corefile.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/corefile.exp 2015-01-01 17:00:43.172897771 +0100
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.pie/corefile.exp 2015-05-31 16:34:02.401969487 +0200
@@ -0,0 +1,233 @@
+# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+# Free Software Foundation, Inc.
@ -2059,10 +2058,10 @@ Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/corefile.exp
+gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(.*\\).*" "up in corefile.exp (reinit)"
+
+gdb_test "core" "No core file now."
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/Makefile.in
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.pie/Makefile.in
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/Makefile.in 2015-01-01 17:00:43.172897771 +0100
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.pie/Makefile.in 2015-05-31 16:34:02.401969487 +0200
@@ -0,0 +1,19 @@
+VPATH = @srcdir@
+srcdir = @srcdir@

View File

@ -1,28 +0,0 @@
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=190810
2006-09-26 Jan Kratochvil <jan.kratochvil@redhat.com>
* remote.c (remote_wait): Suggestion on crash due to nonmatching target.
(remote_async_wait): Likewise.
Index: gdb-6.8.50.20090818/gdb/remote.c
===================================================================
--- gdb-6.8.50.20090818.orig/gdb/remote.c 2009-08-18 21:00:35.000000000 +0200
+++ gdb-6.8.50.20090818/gdb/remote.c 2009-08-18 21:04:46.000000000 +0200
@@ -4408,8 +4408,13 @@ Packet: '%s'\n"),
VEC_safe_push (cached_reg_t, event->regcache, &cached_reg);
}
+ /* It may also occur on amd64 which defaults to 32-bit i386
+ target. gdbserver(1) is not aware of the `set architecture'
+ name itself as it is not using libbfd. */
if (*p != ';')
- error (_("Remote register badly formatted: %s\nhere: %s"),
+ error (_("Remote register badly formatted: %s\nhere: %s"
+ "\nTry to load the executable by `file' first,"
+ "\nyou may also check `set/show architecture'."),
buf, p);
++p;
}

View File

@ -58,10 +58,10 @@ Http://sourceware.org/ml/gdb-patches/2010-01/msg00517.html
* exec.c (exec_file_attach): Print a more useful error message if the
user did "gdb core".
Index: gdb-7.8.50.20141228/gdb/exec.c
Index: gdb-7.9.50.20150531/gdb/exec.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/exec.c 2015-01-03 23:18:38.097427908 +0100
+++ gdb-7.8.50.20141228/gdb/exec.c 2015-01-03 23:19:02.448556391 +0100
--- gdb-7.9.50.20150531.orig/gdb/exec.c 2015-05-31 03:48:29.000000000 +0200
+++ gdb-7.9.50.20150531/gdb/exec.c 2015-05-31 20:07:35.092878685 +0200
@@ -35,6 +35,7 @@
#include "progspace.h"
#include "gdb_bfd.h"
@ -70,7 +70,7 @@ Index: gdb-7.8.50.20141228/gdb/exec.c
#include <fcntl.h>
#include "readline/readline.h"
@@ -222,12 +223,27 @@ exec_file_attach (const char *filename,
@@ -298,12 +299,27 @@ exec_file_attach (const char *filename,
if (!bfd_check_format_matches (exec_bfd, bfd_object, &matching))
{
@ -101,11 +101,11 @@ Index: gdb-7.8.50.20141228/gdb/exec.c
}
if (build_section_table (exec_bfd, &sections, &sections_end))
Index: gdb-7.8.50.20141228/gdb/main.c
Index: gdb-7.9.50.20150531/gdb/main.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/main.c 2015-01-03 23:18:38.098427913 +0100
+++ gdb-7.8.50.20141228/gdb/main.c 2015-01-03 23:22:10.157546792 +0100
@@ -426,6 +426,36 @@ typedef struct cmdarg {
--- gdb-7.9.50.20150531.orig/gdb/main.c 2015-05-31 20:07:34.183872824 +0200
+++ gdb-7.9.50.20150531/gdb/main.c 2015-05-31 20:10:05.095845935 +0200
@@ -435,6 +435,37 @@ typedef struct cmdarg {
/* Define type VEC (cmdarg_s). */
DEF_VEC_O (cmdarg_s);
@ -120,11 +120,11 @@ Index: gdb-7.8.50.20141228/gdb/main.c
+
+ gdb_assert (exec_bfd == NULL);
+
+ TRY_CATCH (e, RETURN_MASK_ALL)
+ TRY
+ {
+ exec_file_attach (filename, from_tty);
+ }
+ if (e.reason < 0)
+ CATCH (e, RETURN_MASK_ALL)
+ {
+ if (e.error == IS_CORE_ERROR)
+ {
@ -137,12 +137,13 @@ Index: gdb-7.8.50.20141228/gdb/main.c
+ }
+ throw_exception (e);
+ }
+ END_CATCH
+}
+
static int
captured_main (void *data)
{
@@ -910,6 +940,8 @@ captured_main (void *data)
@@ -923,6 +954,8 @@ captured_main (void *data)
{
symarg = argv[optind];
execarg = argv[optind];
@ -151,7 +152,7 @@ Index: gdb-7.8.50.20141228/gdb/main.c
optind++;
}
@@ -1069,11 +1101,26 @@ captured_main (void *data)
@@ -1080,11 +1113,25 @@ captured_main (void *data)
&& symarg != NULL
&& strcmp (execarg, symarg) == 0)
{
@ -171,23 +172,22 @@ Index: gdb-7.8.50.20141228/gdb/main.c
open it, better only print one error message.
- catch_command_errors returns non-zero on success! */
- if (catch_command_errors_const (exec_file_attach, execarg,
- !batch_flag, RETURN_MASK_ALL))
- !batch_flag))
+ catch_command_errors returns non-zero on success!
+ Do not load EXECARG as a symbol file if it has been already processed
+ as a core file. */
+ if (catch_command_errors_const (func, execarg, !batch_flag,
+ RETURN_MASK_ALL)
+ if (catch_command_errors_const (func, execarg, !batch_flag)
+ && core_bfd == NULL)
catch_command_errors_const (symbol_file_add_main, symarg,
!batch_flag, RETURN_MASK_ALL);
!batch_flag);
}
Index: gdb-7.8.50.20141228/gdb/common/common-exceptions.h
Index: gdb-7.9.50.20150531/gdb/common/common-exceptions.h
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/common/common-exceptions.h 2015-01-03 23:18:38.097427908 +0100
+++ gdb-7.8.50.20141228/gdb/common/common-exceptions.h 2015-01-03 23:19:02.449556396 +0100
@@ -99,6 +99,9 @@ enum errors {
/* Requested feature, method, mechanism, etc. is not supported. */
NOT_SUPPORTED_ERROR,
--- gdb-7.9.50.20150531.orig/gdb/common/common-exceptions.h 2015-05-31 03:48:29.000000000 +0200
+++ gdb-7.9.50.20150531/gdb/common/common-exceptions.h 2015-05-31 20:07:35.093878692 +0200
@@ -105,6 +105,9 @@ enum errors {
"_ERROR" is appended to the name. */
MAX_COMPLETIONS_REACHED_ERROR,
+ /* Attempt to load a core file as executable. */
+ IS_CORE_ERROR,

View File

@ -15,10 +15,10 @@ Comments by Sergio Durigan Junior <sergiodj@redhat.com>:
NULL after it is free'd, otherwise the code below thinks that it is still
valid and doesn't print the necessary warning ("Try: yum install ...").
Index: gdb-7.7/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp
Index: gdb-7.9.90.20150709/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp
===================================================================
--- /dev/null
+++ gdb-7.7/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.9.90.20150709/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp 2015-07-09 22:22:26.278304653 +0200
@@ -0,0 +1,97 @@
+# Copyright (C) 2014 Free Software Foundation, Inc.
+
@ -75,7 +75,7 @@ Index: gdb-7.7/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.
+# Move the binfile to a temporary name
+remote_exec build "mv $binfile ${binfile}.old"
+
+# Reinitialize GDB and see if we get a yum warning
+# Reinitialize GDB and see if we get a yum/dnf warning
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
@ -88,8 +88,8 @@ Index: gdb-7.7/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.
+ "set debug-file-directory"
+
+ gdb_test "core-file ${objdir}/${subdir}/gcore.test" \
+ "Missing separate debuginfo for the main executable file\r\nTry: yum --enablerepo='\\*debug\\*' install $objdir/$subdir/$build_id_without_debug\r\n.*" \
+ "test first yum warning"
+ "Missing separate debuginfo for the main executable file\r\nTry: (yum|dnf) --enablerepo='\\*debug\\*' install $objdir/$subdir/$build_id_without_debug\r\n.*" \
+ "test first yum/dnf warning"
+}
+
+# Now we define and create our .build-id
@ -98,7 +98,7 @@ Index: gdb-7.7/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.
+# exist.
+remote_exec build "ln -s $binfile ${objdir}/${subdir}/${build_id_without_debug}"
+
+# Reinitialize GDB to get the second yum warning
+# Reinitialize GDB to get the second yum/dnf warning
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
@ -111,21 +111,25 @@ Index: gdb-7.7/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.
+ "set debug-file-directory"
+
+ gdb_test "core-file ${objdir}/${subdir}/gcore.test" \
+ "Missing separate debuginfo for the main executable file\r\nTry: yum --enablerepo='\\*debug\\*' install $binfile\r\n.*" \
+ "test second yum warning"
+ "Missing separate debuginfo for the main executable file\r\nTry: (yum|dnf) --enablerepo='\\*debug\\*' install $binfile\r\n.*" \
+ "test second yum/dnf warning"
+}
+
+# Leaving the link there will cause breakage in the next run.
+remote_exec build "rm -f ${objdir}/${subdir}/${build_id_without_debug}"
Index: gdb-7.7/gdb/build-id.c
Index: gdb-7.9.90.20150709/gdb/build-id.c
===================================================================
--- gdb-7.7.orig/gdb/build-id.c
+++ gdb-7.7/gdb/build-id.c
@@ -588,6 +588,7 @@ build_id_to_debug_bfd (size_t build_id_l
if (abfd == NULL)
{
xfree (filename);
+ filename = NULL;
continue;
}
--- gdb-7.9.90.20150709.orig/gdb/build-id.c 2015-07-09 22:22:26.278304653 +0200
+++ gdb-7.9.90.20150709/gdb/build-id.c 2015-07-09 22:22:51.398502329 +0200
@@ -589,7 +589,10 @@ build_id_to_debug_bfd (size_t build_id_l
do_cleanups (inner);
if (abfd == NULL)
- continue;
+ {
+ filename = NULL;
+ continue;
+ }
if (build_id_verify (abfd, build_id_len, build_id))
break;

View File

@ -1,8 +1,8 @@
Index: gdb-7.9.1/gdb/build-id.c
Index: gdb-7.10.1/gdb/build-id.c
===================================================================
--- 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
--- gdb-7.10.1.orig/gdb/build-id.c 2016-01-14 16:19:02.000000000 +0100
+++ gdb-7.10.1/gdb/build-id.c 2016-01-14 16:21:43.000000000 +0100
@@ -830,9 +830,9 @@ missing_rpm_enlist (const char *filename
if (h == NULL)
break;
@ -15,7 +15,7 @@ Index: gdb-7.9.1/gdb/build-id.c
&err);
if (!debuginfo)
{
@@ -837,60 +837,19 @@ missing_rpm_enlist (const char *filename
@@ -840,60 +840,19 @@ missing_rpm_enlist (const char *filename
err);
continue;
}
@ -78,7 +78,7 @@ Index: gdb-7.9.1/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
@@ -975,10 +934,7 @@ missing_rpm_list_print (void)
@@ -978,10 +937,7 @@ missing_rpm_list_print (void)
(int (*) (const void *, const void *)) missing_rpm_list_compar);
printf_unfiltered (_("Missing separate debuginfos, use: %s"),
@ -90,12 +90,17 @@ Index: gdb-7.9.1/gdb/build-id.c
for (array_iter = array; array_iter < array + missing_rpm_list_entries;
array_iter++)
{
@@ -1191,8 +1147,12 @@ debug_print_missing (const char *binary,
@@ -1194,13 +1150,12 @@ debug_print_missing (const char *binary,
fprintf_unfiltered (gdb_stdlog,
_("Missing separate debuginfo for %s\n"), binary);
if (debug != NULL)
- fprintf_unfiltered (gdb_stdlog, _("Try: %s %s\n"),
- "yum --enablerepo='*debug*' install", debug);
-#ifdef DNF_DEBUGINFO_INSTALL
- "dnf"
-#else
- "yum"
-#endif
- " --enablerepo='*debug*' install", debug);
+ {
+ const char *p = strrchr (debug, '/');
+ fprintf_unfiltered (gdb_stdlog, _("Try: %s%.2s%.38s\"\n"),

View File

@ -1,7 +1,7 @@
Index: gdb-7.8.50.20141228/gdb/event-top.c
Index: gdb-7.9.90.20150717/gdb/event-top.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/event-top.c 2015-01-01 17:12:24.881489087 +0100
+++ gdb-7.8.50.20141228/gdb/event-top.c 2015-01-01 17:12:28.821486803 +0100
--- gdb-7.9.90.20150717.orig/gdb/event-top.c 2015-07-17 03:59:12.000000000 +0200
+++ gdb-7.9.90.20150717/gdb/event-top.c 2015-08-01 20:07:15.822993674 +0200
@@ -37,6 +37,7 @@
#include "gdbcmd.h" /* for dont_repeat() */
#include "annotate.h"
@ -28,24 +28,24 @@ Index: gdb-7.8.50.20141228/gdb/event-top.c
old_chain = make_cleanup (free_current_contents, &actual_gdb_prompt);
/* Do not call the python hook on an explicit prompt change as
Index: gdb-7.8.50.20141228/gdb/symfile.h
Index: gdb-7.9.90.20150717/gdb/symfile.h
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/symfile.h 2015-01-01 17:12:24.881489087 +0100
+++ gdb-7.8.50.20141228/gdb/symfile.h 2015-01-01 17:12:28.822486802 +0100
@@ -577,6 +577,8 @@ void map_symbol_filenames (symbol_filena
--- gdb-7.9.90.20150717.orig/gdb/symfile.h 2015-08-01 20:07:15.787993404 +0200
+++ gdb-7.9.90.20150717/gdb/symfile.h 2015-08-01 20:07:15.822993674 +0200
@@ -587,6 +587,8 @@ void map_symbol_filenames (symbol_filena
/* build-id support. */
extern struct elf_build_id *build_id_addr_get (CORE_ADDR addr);
extern struct bfd_build_id *build_id_addr_get (CORE_ADDR addr);
extern void debug_print_missing (const char *binary, const char *debug);
+extern void debug_flush_missing (void);
+#define BUILD_ID_MAIN_EXECUTABLE_FILENAME _("the main executable file")
/* From dwarf2read.c */
Index: gdb-7.8.50.20141228/gdb/testsuite/lib/gdb.exp
Index: gdb-7.9.90.20150717/gdb/testsuite/lib/gdb.exp
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/testsuite/lib/gdb.exp 2015-01-01 17:12:24.883489085 +0100
+++ gdb-7.8.50.20141228/gdb/testsuite/lib/gdb.exp 2015-01-01 17:12:28.823486801 +0100
@@ -1522,7 +1522,7 @@ proc default_gdb_start { } {
--- gdb-7.9.90.20150717.orig/gdb/testsuite/lib/gdb.exp 2015-08-01 20:07:15.789993420 +0200
+++ gdb-7.9.90.20150717/gdb/testsuite/lib/gdb.exp 2015-08-01 20:07:15.824993689 +0200
@@ -1573,7 +1573,7 @@ proc default_gdb_start { } {
warning "Couldn't set the width to 0."
}
}
@ -54,10 +54,10 @@ Index: gdb-7.8.50.20141228/gdb/testsuite/lib/gdb.exp
send_gdb "set build-id-verbose 0\n"
gdb_expect 10 {
-re "$gdb_prompt $" {
Index: gdb-7.8.50.20141228/gdb/testsuite/lib/mi-support.exp
Index: gdb-7.9.90.20150717/gdb/testsuite/lib/mi-support.exp
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/testsuite/lib/mi-support.exp 2015-01-01 17:12:24.884489085 +0100
+++ gdb-7.8.50.20141228/gdb/testsuite/lib/mi-support.exp 2015-01-01 17:12:28.823486801 +0100
--- gdb-7.9.90.20150717.orig/gdb/testsuite/lib/mi-support.exp 2015-08-01 20:07:15.789993420 +0200
+++ gdb-7.9.90.20150717/gdb/testsuite/lib/mi-support.exp 2015-08-01 20:07:15.824993689 +0200
@@ -214,7 +214,7 @@ proc default_mi_gdb_start { args } {
warning "Couldn't set the width to 0."
}
@ -67,10 +67,10 @@ Index: gdb-7.8.50.20141228/gdb/testsuite/lib/mi-support.exp
send_gdb "190-gdb-set build-id-verbose 0\n"
gdb_expect 10 {
-re ".*190-gdb-set build-id-verbose 0\r\n190\\\^done\r\n$mi_gdb_prompt$" {
Index: gdb-7.8.50.20141228/gdb/tui/tui-interp.c
Index: gdb-7.9.90.20150717/gdb/tui/tui-interp.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/tui/tui-interp.c 2015-01-01 17:12:28.824486801 +0100
+++ gdb-7.8.50.20141228/gdb/tui/tui-interp.c 2015-01-01 17:12:43.240478444 +0100
--- gdb-7.9.90.20150717.orig/gdb/tui/tui-interp.c 2015-07-17 03:59:13.000000000 +0200
+++ gdb-7.9.90.20150717/gdb/tui/tui-interp.c 2015-08-01 20:07:15.825993697 +0200
@@ -31,6 +31,7 @@
#include "tui/tui-io.h"
#include "infrun.h"
@ -79,10 +79,10 @@ Index: gdb-7.8.50.20141228/gdb/tui/tui-interp.c
static struct ui_out *tui_ui_out (struct interp *self);
Index: gdb-7.8.50.20141228/gdb/aclocal.m4
Index: gdb-7.9.90.20150717/gdb/aclocal.m4
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/aclocal.m4 2015-01-01 17:12:24.885489084 +0100
+++ gdb-7.8.50.20141228/gdb/aclocal.m4 2015-01-01 17:12:28.824486801 +0100
--- gdb-7.9.90.20150717.orig/gdb/aclocal.m4 2015-07-17 03:59:12.000000000 +0200
+++ gdb-7.9.90.20150717/gdb/aclocal.m4 2015-08-01 20:07:15.825993697 +0200
@@ -11,6 +11,221 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@ -305,10 +305,10 @@ Index: gdb-7.8.50.20141228/gdb/aclocal.m4
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
Index: gdb-7.8.50.20141228/gdb/config.in
Index: gdb-7.9.90.20150717/gdb/config.in
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/config.in 2015-01-01 17:12:24.885489084 +0100
+++ gdb-7.8.50.20141228/gdb/config.in 2015-01-01 17:12:28.824486801 +0100
--- gdb-7.9.90.20150717.orig/gdb/config.in 2015-07-17 03:59:12.000000000 +0200
+++ gdb-7.9.90.20150717/gdb/config.in 2015-08-01 20:07:15.826993704 +0200
@@ -33,6 +33,9 @@
/* Define to BFD's default target vector. */
#undef DEFAULT_BFD_VEC
@ -319,7 +319,7 @@ Index: gdb-7.8.50.20141228/gdb/config.in
/* Define to 1 if translation of program messages to the user's native
language is requested. */
#undef ENABLE_NLS
@@ -207,6 +210,9 @@
@@ -258,6 +261,9 @@
/* Define if Python 2.7 is being used. */
#undef HAVE_LIBPYTHON2_7
@ -329,11 +329,11 @@ Index: gdb-7.8.50.20141228/gdb/config.in
/* Define to 1 if you have the <libunwind-ia64.h> header file. */
#undef HAVE_LIBUNWIND_IA64_H
Index: gdb-7.8.50.20141228/gdb/configure
Index: gdb-7.9.90.20150717/gdb/configure
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/configure 2015-01-01 17:12:24.891489081 +0100
+++ gdb-7.8.50.20141228/gdb/configure 2015-01-01 17:12:28.828486798 +0100
@@ -698,6 +698,11 @@ PKGVERSION
--- gdb-7.9.90.20150717.orig/gdb/configure 2015-07-17 03:59:12.000000000 +0200
+++ gdb-7.9.90.20150717/gdb/configure 2015-08-01 20:07:15.830993735 +0200
@@ -703,6 +703,11 @@ PKGVERSION
HAVE_NATIVE_GCORE_TARGET
TARGET_OBS
subdirs
@ -345,7 +345,7 @@ Index: gdb-7.8.50.20141228/gdb/configure
GDB_DATADIR
DEBUGDIR
MAKEINFO_EXTRA_FLAGS
@@ -801,6 +806,7 @@ with_gdb_datadir
@@ -811,6 +816,7 @@ with_gdb_datadir
with_relocated_sources
with_auto_load_dir
with_auto_load_safe_path
@ -353,7 +353,7 @@ Index: gdb-7.8.50.20141228/gdb/configure
enable_targets
enable_64_bit_bfd
enable_gdbcli
@@ -852,6 +858,11 @@ CPPFLAGS
@@ -867,6 +873,11 @@ CCC
CPP
MAKEINFO
MAKEINFOFLAGS
@ -365,7 +365,7 @@ Index: gdb-7.8.50.20141228/gdb/configure
YACC
YFLAGS
XMKMF'
@@ -1522,6 +1533,8 @@ Optional Packages:
@@ -1538,6 +1549,8 @@ Optional Packages:
[--with-auto-load-dir]
--without-auto-load-safe-path
do not restrict auto-loaded files locations
@ -374,7 +374,7 @@ Index: gdb-7.8.50.20141228/gdb/configure
--with-libunwind-ia64 use libunwind frame unwinding for ia64 targets
--with-curses use the curses library instead of the termcap
library
@@ -1571,6 +1584,13 @@ Some influential environment variables:
@@ -1592,6 +1605,13 @@ Some influential environment variables:
MAKEINFO Parent configure detects if it is of sufficient version.
MAKEINFOFLAGS
Parameters for MAKEINFO.
@ -388,7 +388,7 @@ Index: gdb-7.8.50.20141228/gdb/configure
YACC The `Yet Another C Compiler' implementation to use. Defaults to
the first program found out of: `bison -y', `byacc', `yacc'.
YFLAGS The list of arguments that will be passed by default to $YACC.
@@ -5267,6 +5287,491 @@ _ACEOF
@@ -5608,6 +5628,491 @@ _ACEOF
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_auto_load_safe_path" >&5
$as_echo "$with_auto_load_safe_path" >&6; }
@ -880,11 +880,11 @@ Index: gdb-7.8.50.20141228/gdb/configure
subdirs="$subdirs testsuite"
Index: gdb-7.8.50.20141228/gdb/configure.ac
Index: gdb-7.9.90.20150717/gdb/configure.ac
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/configure.ac 2015-01-01 17:12:24.893489079 +0100
+++ gdb-7.8.50.20141228/gdb/configure.ac 2015-01-01 17:12:28.829486798 +0100
@@ -172,6 +172,199 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escap
--- gdb-7.9.90.20150717.orig/gdb/configure.ac 2015-07-17 03:59:12.000000000 +0200
+++ gdb-7.9.90.20150717/gdb/configure.ac 2015-08-01 20:07:15.831993743 +0200
@@ -177,6 +177,199 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escap
[Directories safe to hold auto-loaded files.])
AC_MSG_RESULT([$with_auto_load_safe_path])
@ -1084,10 +1084,10 @@ Index: gdb-7.8.50.20141228/gdb/configure.ac
AC_CONFIG_SUBDIRS(testsuite)
# Check whether to support alternative target configurations
Index: gdb-7.8.50.20141228/gdb/corelow.c
Index: gdb-7.9.90.20150717/gdb/corelow.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/corelow.c 2015-01-01 17:12:24.894489079 +0100
+++ gdb-7.8.50.20141228/gdb/corelow.c 2015-01-01 17:12:28.829486798 +0100
--- gdb-7.9.90.20150717.orig/gdb/corelow.c 2015-08-01 20:07:15.775993312 +0200
+++ gdb-7.9.90.20150717/gdb/corelow.c 2015-08-01 20:07:15.831993743 +0200
@@ -310,7 +310,7 @@ build_id_locate_exec (int from_tty)
symfile_objfile->flags |= OBJF_BUILD_ID_CORE_LOADED;
}
@ -1097,19 +1097,19 @@ Index: gdb-7.8.50.20141228/gdb/corelow.c
do_cleanups (back_to);
Index: gdb-7.8.50.20141228/gdb/build-id.c
Index: gdb-7.9.90.20150717/gdb/build-id.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/build-id.c 2015-01-01 17:12:24.894489079 +0100
+++ gdb-7.8.50.20141228/gdb/build-id.c 2015-01-01 17:12:28.830486797 +0100
@@ -31,6 +31,7 @@
#include "gdbcmd.h"
#include "observer.h"
--- gdb-7.9.90.20150717.orig/gdb/build-id.c 2015-08-01 20:07:15.791993435 +0200
+++ gdb-7.9.90.20150717/gdb/build-id.c 2015-08-01 20:08:27.735546630 +0200
@@ -35,6 +35,7 @@
#include "elf/common.h"
#include "elf-bfd.h"
#include <sys/stat.h>
+#include "elf/external.h"
#define BUILD_ID_VERBOSE_NONE 0
#define BUILD_ID_VERBOSE_FILENAMES 1
@@ -664,8 +665,363 @@ build_id_to_filename (const struct elf_b
@@ -665,8 +666,363 @@ build_id_to_filename (const struct bfd_b
return result;
}
@ -1474,7 +1474,7 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
avoidance. */
struct missing_filepair
@@ -719,11 +1072,17 @@ missing_filepair_change (void)
@@ -720,11 +1076,17 @@ missing_filepair_change (void)
/* All their memory came just from missing_filepair_OBSTACK. */
missing_filepair_hash = NULL;
}
@ -1492,7 +1492,7 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
missing_filepair_change ();
}
@@ -790,14 +1149,34 @@ debug_print_missing (const char *binary,
@@ -791,14 +1153,39 @@ debug_print_missing (const char *binary,
*slot = missing_filepair;
@ -1529,7 +1529,12 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
+ _("Missing separate debuginfo for %s\n"), binary);
+ if (debug != NULL)
+ fprintf_unfiltered (gdb_stdlog, _("Try: %s %s\n"),
+ "yum --enablerepo='*debug*' install", debug);
+#ifdef DNF_DEBUGINFO_INSTALL
+ "dnf"
+#else
+ "yum"
+#endif
+ " --enablerepo='*debug*' install", debug);
+ }
}

View File

@ -1,20 +1,20 @@
Index: gdb-7.5.50.20130310/gdb/solib-svr4.c
Index: gdb-7.9.90.20150709/gdb/solib-svr4.c
===================================================================
--- gdb-7.5.50.20130310.orig/gdb/solib-svr4.c 2013-03-10 16:37:49.000000000 +0100
+++ gdb-7.5.50.20130310/gdb/solib-svr4.c 2013-03-10 16:43:45.498585091 +0100
@@ -1225,14 +1225,27 @@ svr4_read_so_list (CORE_ADDR lm, struct
--- gdb-7.9.90.20150709.orig/gdb/solib-svr4.c 2015-07-09 18:18:54.526417766 +0200
+++ gdb-7.9.90.20150709/gdb/solib-svr4.c 2015-07-09 18:19:33.074746586 +0200
@@ -1381,14 +1381,27 @@ svr4_read_so_list (CORE_ADDR lm, CORE_AD
}
{
- struct elf_build_id *build_id;
+ struct elf_build_id *build_id = NULL;
- struct bfd_build_id *build_id;
+ struct bfd_build_id *build_id = NULL;
strncpy (new->so_original_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
new->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
strncpy (newobj->so_original_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
newobj->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
/* May get overwritten below. */
strcpy (new->so_name, new->so_original_name);
strcpy (newobj->so_name, newobj->so_original_name);
- build_id = build_id_addr_get (new->lm_info->l_ld);
- build_id = build_id_addr_get (newobj->lm_info->l_ld);
+ /* In the case the main executable was found according to its build-id
+ (from a core file) prevent loading a different build of a library
+ with accidentally the same SO_NAME.
@ -28,16 +28,16 @@ Index: gdb-7.5.50.20130310/gdb/solib-svr4.c
+ to the only existing file loaded that time - the executable. */
+ if (symfile_objfile != NULL
+ && (symfile_objfile->flags & OBJF_BUILD_ID_CORE_LOADED) != 0)
+ build_id = build_id_addr_get (new->lm_info->l_ld);
+ build_id = build_id_addr_get (newobj->lm_info->l_ld);
if (build_id != NULL)
{
char *name, *build_id_filename;
@@ -1247,23 +1260,7 @@ svr4_read_so_list (CORE_ADDR lm, struct
@@ -1403,23 +1416,7 @@ svr4_read_so_list (CORE_ADDR lm, CORE_AD
xfree (name);
}
else
- {
- debug_print_missing (new->so_name, build_id_filename);
- debug_print_missing (newobj->so_name, build_id_filename);
-
- /* In the case the main executable was found according to
- its build-id (from a core file) prevent loading
@ -51,9 +51,9 @@ Index: gdb-7.5.50.20130310/gdb/solib-svr4.c
- if (symfile_objfile != NULL
- && (symfile_objfile->flags
- & OBJF_BUILD_ID_CORE_LOADED) != 0)
- new->so_name[0] = 0;
- newobj->so_name[0] = 0;
- }
+ debug_print_missing (new->so_name, build_id_filename);
+ debug_print_missing (newobj->so_name, build_id_filename);
xfree (build_id_filename);
xfree (build_id);

View File

@ -1,7 +1,7 @@
Index: gdb-7.8.50.20141228/gdb/corelow.c
Index: gdb-7.9.90.20150709/gdb/corelow.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/corelow.c 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/corelow.c 2015-01-03 23:12:08.691349454 +0100
--- gdb-7.9.90.20150709.orig/gdb/corelow.c 2015-07-09 22:05:20.988044312 +0200
+++ gdb-7.9.90.20150709/gdb/corelow.c 2015-07-09 22:05:42.057222722 +0200
@@ -45,6 +45,10 @@
#include "gdb_bfd.h"
#include "completer.h"
@ -23,7 +23,7 @@ Index: gdb-7.8.50.20141228/gdb/corelow.c
+build_id_locate_exec (int from_tty)
+{
+ CORE_ADDR at_entry;
+ struct elf_build_id *build_id;
+ struct bfd_build_id *build_id;
+ char *execfilename, *debug_filename;
+ char *build_id_filename;
+ struct cleanup *back_to;
@ -67,7 +67,7 @@ Index: gdb-7.8.50.20141228/gdb/corelow.c
/* This routine opens and sets up the core file bfd. */
static void
@@ -405,6 +456,14 @@ core_open (const char *arg, int from_tty
@@ -404,6 +455,14 @@ core_open (const char *arg, int from_tty
switch_to_thread (thread->ptid);
}
@ -82,7 +82,7 @@ Index: gdb-7.8.50.20141228/gdb/corelow.c
post_create_inferior (&core_ops, from_tty);
/* Now go through the target stack looking for threads since there
@@ -1035,4 +1094,11 @@ _initialize_corelow (void)
@@ -1058,4 +1117,11 @@ _initialize_corelow (void)
init_core_ops ();
add_target_with_completer (&core_ops, filename_completer);
@ -94,11 +94,11 @@ Index: gdb-7.8.50.20141228/gdb/corelow.c
+ NULL, NULL, NULL,
+ &setlist, &showlist);
}
Index: gdb-7.8.50.20141228/gdb/doc/gdb.texinfo
Index: gdb-7.9.90.20150709/gdb/doc/gdb.texinfo
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/doc/gdb.texinfo 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/doc/gdb.texinfo 2015-01-03 23:12:08.701349509 +0100
@@ -17930,6 +17930,27 @@ information files.
--- gdb-7.9.90.20150709.orig/gdb/doc/gdb.texinfo 2015-07-09 22:05:20.988044312 +0200
+++ gdb-7.9.90.20150709/gdb/doc/gdb.texinfo 2015-07-09 22:05:42.067222806 +0200
@@ -18304,6 +18304,27 @@ information files.
@end table
@ -126,10 +126,10 @@ Index: gdb-7.8.50.20141228/gdb/doc/gdb.texinfo
@cindex @code{.gnu_debuglink} sections
@cindex debug link sections
A debug link is a special section of the executable file named
Index: gdb-7.8.50.20141228/gdb/solib-svr4.c
Index: gdb-7.9.90.20150709/gdb/solib-svr4.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/solib-svr4.c 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/solib-svr4.c 2015-01-03 23:12:08.702349514 +0100
--- gdb-7.9.90.20150709.orig/gdb/solib-svr4.c 2015-07-09 22:05:20.988044312 +0200
+++ gdb-7.9.90.20150709/gdb/solib-svr4.c 2015-07-09 22:05:42.068222815 +0200
@@ -45,6 +45,7 @@
#include "auxv.h"
#include "gdb_bfd.h"
@ -138,22 +138,22 @@ Index: gdb-7.8.50.20141228/gdb/solib-svr4.c
static struct link_map_offsets *svr4_fetch_link_map_offsets (void);
static int svr4_have_link_map_offsets (void);
@@ -1366,9 +1367,52 @@ svr4_read_so_list (CORE_ADDR lm, CORE_AD
@@ -1379,9 +1380,52 @@ svr4_read_so_list (CORE_ADDR lm, CORE_AD
continue;
}
- strncpy (new->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
- new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
- strcpy (new->so_original_name, new->so_name);
- strncpy (newobj->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
- newobj->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
- strcpy (newobj->so_original_name, newobj->so_name);
+ {
+ struct elf_build_id *build_id;
+ struct bfd_build_id *build_id;
+
+ strncpy (new->so_original_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
+ new->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
+ strncpy (newobj->so_original_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
+ newobj->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
+ /* May get overwritten below. */
+ strcpy (new->so_name, new->so_original_name);
+ strcpy (newobj->so_name, newobj->so_original_name);
+
+ build_id = build_id_addr_get (new->lm_info->l_ld);
+ build_id = build_id_addr_get (newobj->lm_info->l_ld);
+ if (build_id != NULL)
+ {
+ char *name, *build_id_filename;
@ -163,13 +163,13 @@ Index: gdb-7.8.50.20141228/gdb/solib-svr4.c
+ name = build_id_to_filename (build_id, &build_id_filename);
+ if (name != NULL)
+ {
+ strncpy (new->so_name, name, SO_NAME_MAX_PATH_SIZE - 1);
+ new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
+ strncpy (newobj->so_name, name, SO_NAME_MAX_PATH_SIZE - 1);
+ newobj->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
+ xfree (name);
+ }
+ else
+ {
+ debug_print_missing (new->so_name, build_id_filename);
+ debug_print_missing (newobj->so_name, build_id_filename);
+
+ /* In the case the main executable was found according to
+ its build-id (from a core file) prevent loading
@ -183,7 +183,7 @@ Index: gdb-7.8.50.20141228/gdb/solib-svr4.c
+ if (symfile_objfile != NULL
+ && (symfile_objfile->flags
+ & OBJF_BUILD_ID_CORE_LOADED) != 0)
+ new->so_name[0] = 0;
+ newobj->so_name[0] = 0;
+ }
+
+ xfree (build_id_filename);
@ -194,11 +194,11 @@ Index: gdb-7.8.50.20141228/gdb/solib-svr4.c
xfree (buffer);
/* If this entry has no name, or its name matches the name
Index: gdb-7.8.50.20141228/gdb/elfread.c
Index: gdb-7.9.90.20150709/gdb/elfread.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/elfread.c 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/elfread.c 2015-01-03 23:12:08.703349519 +0100
@@ -1339,9 +1339,10 @@ elf_symfile_read (struct objfile *objfil
--- gdb-7.9.90.20150709.orig/gdb/elfread.c 2015-07-09 22:05:20.988044312 +0200
+++ gdb-7.9.90.20150709/gdb/elfread.c 2015-07-09 22:05:42.068222815 +0200
@@ -1250,9 +1250,10 @@ elf_symfile_read (struct objfile *objfil
&& objfile->separate_debug_objfile == NULL
&& objfile->separate_debug_objfile_backlink == NULL)
{
@ -211,7 +211,7 @@ Index: gdb-7.8.50.20141228/gdb/elfread.c
if (debugfile == NULL)
debugfile = find_separate_debug_file_by_debuglink (objfile);
@@ -1355,6 +1356,12 @@ elf_symfile_read (struct objfile *objfil
@@ -1266,6 +1267,12 @@ elf_symfile_read (struct objfile *objfil
symbol_file_add_separate (abfd, debugfile, symfile_flags, objfile);
do_cleanups (cleanup);
}
@ -224,26 +224,26 @@ Index: gdb-7.8.50.20141228/gdb/elfread.c
}
}
Index: gdb-7.8.50.20141228/gdb/symfile.h
Index: gdb-7.9.90.20150709/gdb/symfile.h
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/symfile.h 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/symfile.h 2015-01-03 23:12:08.703349519 +0100
@@ -574,6 +574,10 @@ void expand_symtabs_matching (expand_sym
--- gdb-7.9.90.20150709.orig/gdb/symfile.h 2015-07-09 22:05:20.988044312 +0200
+++ gdb-7.9.90.20150709/gdb/symfile.h 2015-07-09 22:05:42.068222815 +0200
@@ -584,6 +584,10 @@ void expand_symtabs_matching (expand_sym
void map_symbol_filenames (symbol_filename_ftype *fun, void *data,
int need_fullname);
+/* build-id support. */
+extern struct elf_build_id *build_id_addr_get (CORE_ADDR addr);
+extern struct bfd_build_id *build_id_addr_get (CORE_ADDR addr);
+extern void debug_print_missing (const char *binary, const char *debug);
+
/* From dwarf2read.c */
/* Names for a dwarf2 debugging section. The field NORMAL is the normal
Index: gdb-7.8.50.20141228/gdb/testsuite/lib/gdb.exp
Index: gdb-7.9.90.20150709/gdb/testsuite/lib/gdb.exp
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/testsuite/lib/gdb.exp 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/testsuite/lib/gdb.exp 2015-01-03 23:12:08.704349525 +0100
@@ -1522,6 +1522,16 @@ proc default_gdb_start { } {
--- gdb-7.9.90.20150709.orig/gdb/testsuite/lib/gdb.exp 2015-07-09 22:05:20.988044312 +0200
+++ gdb-7.9.90.20150709/gdb/testsuite/lib/gdb.exp 2015-07-09 22:05:42.070222832 +0200
@@ -1573,6 +1573,16 @@ proc default_gdb_start { } {
warning "Couldn't set the width to 0."
}
}
@ -260,10 +260,10 @@ Index: gdb-7.8.50.20141228/gdb/testsuite/lib/gdb.exp
return 0
}
Index: gdb-7.8.50.20141228/gdb/testsuite/lib/mi-support.exp
Index: gdb-7.9.90.20150709/gdb/testsuite/lib/mi-support.exp
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/testsuite/lib/mi-support.exp 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/testsuite/lib/mi-support.exp 2015-01-03 23:12:08.705349530 +0100
--- gdb-7.9.90.20150709.orig/gdb/testsuite/lib/mi-support.exp 2015-07-09 22:05:20.988044312 +0200
+++ gdb-7.9.90.20150709/gdb/testsuite/lib/mi-support.exp 2015-07-09 22:05:42.070222832 +0200
@@ -214,6 +214,16 @@ proc default_mi_gdb_start { args } {
warning "Couldn't set the width to 0."
}
@ -281,10 +281,10 @@ Index: gdb-7.8.50.20141228/gdb/testsuite/lib/mi-support.exp
# If allowing the inferior to have its own PTY then assign the inferior
# its own terminal device here.
if { $separate_inferior_pty } {
Index: gdb-7.8.50.20141228/gdb/objfiles.h
Index: gdb-7.9.90.20150709/gdb/objfiles.h
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/objfiles.h 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/objfiles.h 2015-01-03 23:12:08.705349530 +0100
--- gdb-7.9.90.20150709.orig/gdb/objfiles.h 2015-07-09 22:05:20.988044312 +0200
+++ gdb-7.9.90.20150709/gdb/objfiles.h 2015-07-09 22:05:42.071222840 +0200
@@ -459,6 +459,10 @@ struct objfile
#define OBJF_NOT_FILENAME (1 << 6)
@ -296,10 +296,10 @@ Index: gdb-7.8.50.20141228/gdb/objfiles.h
/* Declarations for functions defined in objfiles.c */
extern struct objfile *allocate_objfile (bfd *, const char *name, int);
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.base/corefile.exp
Index: gdb-7.9.90.20150709/gdb/testsuite/gdb.base/corefile.exp
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/testsuite/gdb.base/corefile.exp 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.base/corefile.exp 2015-01-03 23:12:08.705349530 +0100
--- gdb-7.9.90.20150709.orig/gdb/testsuite/gdb.base/corefile.exp 2015-07-09 22:05:20.988044312 +0200
+++ gdb-7.9.90.20150709/gdb/testsuite/gdb.base/corefile.exp 2015-07-09 22:05:42.071222840 +0200
@@ -293,3 +293,33 @@ gdb_test_multiple "core-file $corefile"
pass $test
}
@ -334,18 +334,22 @@ Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.base/corefile.exp
+ gdb_test "info files" "Local exec file:\r\n\[ \t\]*`[string_to_regexp $debugdir/$buildid]', file type .*"
+ pass $wholetest
+}
Index: gdb-7.8.50.20141228/gdb/build-id.c
Index: gdb-7.9.90.20150709/gdb/build-id.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/build-id.c 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/build-id.c 2015-01-03 23:12:40.792523085 +0100
@@ -26,11 +26,64 @@
#include "symfile.h"
--- gdb-7.9.90.20150709.orig/gdb/build-id.c 2015-07-09 22:05:20.988044312 +0200
+++ gdb-7.9.90.20150709/gdb/build-id.c 2015-07-09 22:19:35.022957009 +0200
@@ -26,11 +26,67 @@
#include "objfiles.h"
#include "filenames.h"
#include "gdbcore.h"
+#include "libbfd.h"
+#include "gdbcore.h"
+#include "gdbcmd.h"
+#include "observer.h"
+#include "elf/external.h"
+#include "elf/internal.h"
+#include "elf/common.h"
+#include "elf-bfd.h"
+#include <sys/stat.h>
+
+#define BUILD_ID_VERBOSE_NONE 0
@ -359,12 +363,10 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
+ fprintf_filtered (file, _("Verbosity level of the build-id locator is %s.\n"),
+ value);
+}
-/* See build-id.h. */
+/* Locate NT_GNU_BUILD_ID and return its matching debug filename.
+ FIXME: NOTE decoding should be unified with the BFD core notes decoding. */
+
+static struct elf_build_id *
+static struct bfd_build_id *
+build_id_buf_get (bfd *templ, gdb_byte *buf, bfd_size_type size)
+{
+ bfd_byte *p;
@ -384,41 +386,41 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
+ {
+ size_t size = descsz;
+ gdb_byte *data = (void *) descdata;
+ struct elf_build_id *retval;
+ struct bfd_build_id *retval;
+
+ retval = xmalloc (sizeof *retval - 1 + size);
+ retval->size = size;
+ memcpy (retval->data, data, size);
+
+ return retval;
+ }
+ p = descdata + BFD_ALIGN (descsz, 4);
+ }
+ return NULL;
+}
+
+/* See build-id.h. */
+
const struct elf_build_id *
/* See build-id.h. */
const struct bfd_build_id *
-build_id_bfd_get (bfd *abfd)
+build_id_bfd_shdr_get (bfd *abfd)
{
if (!bfd_check_format (abfd, bfd_object)
|| bfd_get_flavour (abfd) != bfd_target_elf_flavour
@@ -44,6 +97,348 @@ build_id_bfd_get (bfd *abfd)
return elf_tdata (abfd)->build_id;
if (!bfd_check_format (abfd, bfd_object))
return NULL;
@@ -42,6 +98,348 @@ build_id_bfd_get (bfd *abfd)
return NULL;
}
+/* Core files may have missing (corrupt) SHDR but PDHR is correct there.
+ bfd_elf_bfd_from_remote_memory () has too much overhead by
+ allocating/reading all the available ELF PT_LOADs. */
+
+static struct elf_build_id *
+static struct bfd_build_id *
+build_id_phdr_get (bfd *templ, bfd_vma loadbase, unsigned e_phnum,
+ Elf_Internal_Phdr *i_phdr)
+{
+ int i;
+ struct elf_build_id *retval = NULL;
+ struct bfd_build_id *retval = NULL;
+
+ for (i = 0; i < e_phnum; i++)
+ if (i_phdr[i].p_type == PT_NOTE && i_phdr[i].p_filesz > 0)
@ -705,11 +707,11 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
+ }
+}
+
+struct elf_build_id *
+struct bfd_build_id *
+build_id_addr_get (CORE_ADDR addr)
+{
+ struct build_id_addr_sect *candidate;
+ struct elf_build_id *retval = NULL;
+ struct bfd_build_id *retval = NULL;
+ Elf_Internal_Phdr *i_phdr = NULL;
+ bfd_vma loadbase = 0;
+ unsigned e_phnum = 0;
@ -754,8 +756,8 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
/* See build-id.h. */
int
@@ -52,7 +447,7 @@ build_id_verify (bfd *abfd, size_t check
const struct elf_build_id *found;
@@ -50,7 +448,7 @@ build_id_verify (bfd *abfd, size_t check
const struct bfd_build_id *found;
int retval = 0;
- found = build_id_bfd_get (abfd);
@ -763,7 +765,7 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
if (found == NULL)
warning (_("File \"%s\" has no build-id, file skipped"),
@@ -67,20 +462,56 @@ build_id_verify (bfd *abfd, size_t check
@@ -65,20 +463,56 @@ build_id_verify (bfd *abfd, size_t check
return retval;
}
@ -824,12 +826,13 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
/* Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will
cause "/.build-id/..." lookups. */
@@ -93,8 +524,11 @@ build_id_to_debug_bfd (size_t build_id_l
@@ -91,9 +525,12 @@ build_id_to_debug_bfd (size_t build_id_l
size_t debugdir_len = strlen (debugdir);
const gdb_byte *data = build_id;
size_t size = build_id_len;
- char *s;
char *filename = NULL;
struct cleanup *inner;
+ unsigned seqno;
+ struct stat statbuf_trash;
+ /* Initialize it just to avoid a GCC false warning. */
@ -837,7 +840,7 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
memcpy (link, debugdir, debugdir_len);
s = &link[debugdir_len];
@@ -108,44 +542,282 @@ build_id_to_debug_bfd (size_t build_id_l
@@ -107,47 +544,281 @@ build_id_to_debug_bfd (size_t build_id_l
*s++ = '/';
while (size-- > 0)
s += sprintf (s, "%02x", (unsigned) *data++);
@ -884,20 +887,22 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
+ continue;
+
+ /* We expect to be silent on the non-existing files. */
+ abfd = gdb_bfd_open_maybe_remote (filename);
+ if (abfd == NULL)
+ {
+ xfree (filename);
+ continue;
+ }
+ inner = make_cleanup (xfree, filename);
+ abfd = gdb_bfd_open (filename, gnutarget, -1);
+ do_cleanups (inner);
- if (filename == NULL)
- continue;
+ if (abfd == NULL)
+ continue;
- /* We expect to be silent on the non-existing files. */
- inner = make_cleanup (xfree, filename);
- abfd = gdb_bfd_open (filename, gnutarget, -1);
- do_cleanups (inner);
+ if (build_id_verify (abfd, build_id_len, build_id))
+ break;
- /* We expect to be silent on the non-existing files. */
- abfd = gdb_bfd_open_maybe_remote (filename);
- if (abfd == NULL)
- continue;
+ gdb_bfd_unref (abfd);
@ -905,7 +910,6 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
- if (build_id_verify (abfd, build_id_len, build_id))
- break;
+ xfree (filename);
+ filename = NULL;
+ }
@ -963,7 +967,7 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
}
+char *
+build_id_to_filename (const struct elf_build_id *build_id, char **link_return)
+build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
+{
+ bfd *abfd;
+ char *result;
@ -1120,7 +1124,7 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
+find_separate_debug_file_by_buildid (struct objfile *objfile,
+ char **build_id_filename_return)
{
const struct elf_build_id *build_id;
const struct bfd_build_id *build_id;
- build_id = build_id_bfd_get (objfile->obfd);
+ if (build_id_filename_return)
@ -1137,7 +1141,7 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
/* Prevent looping on a stripped .debug file. */
if (abfd != NULL
&& filename_cmp (bfd_get_filename (abfd),
@@ -165,3 +837,21 @@ find_separate_debug_file_by_buildid (str
@@ -167,3 +838,21 @@ find_separate_debug_file_by_buildid (str
}
return NULL;
}
@ -1159,10 +1163,10 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
+
+ observer_attach_executable_changed (debug_print_executable_changed);
+}
Index: gdb-7.8.50.20141228/gdb/build-id.h
Index: gdb-7.9.90.20150709/gdb/build-id.h
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/build-id.h 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/build-id.h 2015-01-03 23:12:08.706349536 +0100
--- gdb-7.9.90.20150709.orig/gdb/build-id.h 2015-07-09 22:05:20.988044312 +0200
+++ gdb-7.9.90.20150709/gdb/build-id.h 2015-07-09 22:05:42.072222849 +0200
@@ -20,9 +20,10 @@
#ifndef BUILD_ID_H
#define BUILD_ID_H
@ -1171,8 +1175,8 @@ Index: gdb-7.8.50.20141228/gdb/build-id.h
+/* Separate debuginfo files have corrupted PHDR but SHDR is correct there.
+ Locate NT_GNU_BUILD_ID from ABFD and return its content. */
-extern const struct elf_build_id *build_id_bfd_get (bfd *abfd);
+extern const struct elf_build_id *build_id_bfd_shdr_get (bfd *abfd);
-extern const struct bfd_build_id *build_id_bfd_get (bfd *abfd);
+extern const struct bfd_build_id *build_id_bfd_shdr_get (bfd *abfd);
/* Return true if ABFD has NT_GNU_BUILD_ID matching the CHECK value.
Otherwise, issue a warning and return false. */
@ -1184,7 +1188,7 @@ Index: gdb-7.8.50.20141228/gdb/build-id.h
+ const bfd_byte *build_id, char **link_return,
+ int add_debug_suffix);
+
+extern char *build_id_to_filename (const struct elf_build_id *build_id,
+extern char *build_id_to_filename (const struct bfd_build_id *build_id,
+ char **link_return);
/* Find the separate debug file for OBJFILE, by using the build-id
@ -1197,11 +1201,11 @@ Index: gdb-7.8.50.20141228/gdb/build-id.h
+ char **build_id_filename_return);
#endif /* BUILD_ID_H */
Index: gdb-7.8.50.20141228/gdb/dwarf2read.c
Index: gdb-7.9.90.20150709/gdb/dwarf2read.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/dwarf2read.c 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/dwarf2read.c 2015-01-03 23:12:08.711349563 +0100
@@ -2443,7 +2443,7 @@ dwarf2_get_dwz_file (void)
--- gdb-7.9.90.20150709.orig/gdb/dwarf2read.c 2015-07-09 22:05:20.988044312 +0200
+++ gdb-7.9.90.20150709/gdb/dwarf2read.c 2015-07-09 22:05:42.077222891 +0200
@@ -2507,7 +2507,7 @@ dwarf2_get_dwz_file (void)
}
if (dwz_bfd == NULL)
@ -1210,20 +1214,20 @@ Index: gdb-7.8.50.20141228/gdb/dwarf2read.c
if (dwz_bfd == NULL)
error (_("could not find '.gnu_debugaltlink' file for %s"),
Index: gdb-7.8.50.20141228/gdb/python/py-objfile.c
Index: gdb-7.9.90.20150709/gdb/python/py-objfile.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/python/py-objfile.c 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/python/py-objfile.c 2015-01-03 23:12:08.712349568 +0100
@@ -118,7 +118,7 @@ objfpy_get_build_id (PyObject *self, voi
--- gdb-7.9.90.20150709.orig/gdb/python/py-objfile.c 2015-07-09 22:05:20.988044312 +0200
+++ gdb-7.9.90.20150709/gdb/python/py-objfile.c 2015-07-09 22:05:42.077222891 +0200
@@ -139,7 +139,7 @@ objfpy_get_build_id (PyObject *self, voi
TRY_CATCH (except, RETURN_MASK_ALL)
TRY
{
- build_id = build_id_bfd_get (objfile->obfd);
+ build_id = build_id_bfd_shdr_get (objfile->obfd);
}
GDB_PY_HANDLE_EXCEPTION (except);
@@ -467,7 +467,7 @@ objfpy_lookup_objfile_by_build_id (const
CATCH (except, RETURN_MASK_ALL)
{
@@ -548,7 +548,7 @@ objfpy_lookup_objfile_by_build_id (const
/* Don't return separate debug files. */
if (objfile->separate_debug_objfile_backlink != NULL)
continue;
@ -1232,3 +1236,16 @@ Index: gdb-7.8.50.20141228/gdb/python/py-objfile.c
if (obfd_build_id == NULL)
continue;
if (objfpy_build_id_matches (obfd_build_id, build_id))
Index: gdb-7.9.90.20150709/gdb/coffread.c
===================================================================
--- gdb-7.9.90.20150709.orig/gdb/coffread.c 2015-07-09 22:05:20.988044312 +0200
+++ gdb-7.9.90.20150709/gdb/coffread.c 2015-07-09 22:05:42.078222899 +0200
@@ -739,7 +739,7 @@ coff_symfile_read (struct objfile *objfi
{
char *debugfile;
- debugfile = find_separate_debug_file_by_buildid (objfile);
+ debugfile = find_separate_debug_file_by_buildid (objfile, NULL);
if (debugfile == NULL)
debugfile = find_separate_debug_file_by_debuglink (objfile);

View File

@ -3,10 +3,10 @@
Port to GDB-6.8pre.
Remove the `[' character from the GDB-6.8 default message.
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.base/fork-detach.c
Index: gdb-7.9.50.20150531/gdb/testsuite/gdb.base/fork-detach.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.base/fork-detach.c 2015-01-06 19:31:40.703988534 +0100
+++ gdb-7.9.50.20150531/gdb/testsuite/gdb.base/fork-detach.c 2015-05-31 18:23:49.008450716 +0200
@@ -0,0 +1,57 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -65,10 +65,10 @@ Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.base/fork-detach.c
+ }
+ return 0;
+}
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.base/fork-detach.exp
Index: gdb-7.9.50.20150531/gdb/testsuite/gdb.base/fork-detach.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.base/fork-detach.exp 2015-01-06 19:31:40.704988538 +0100
+++ gdb-7.9.50.20150531/gdb/testsuite/gdb.base/fork-detach.exp 2015-05-31 18:23:49.008450716 +0200
@@ -0,0 +1,36 @@
+# Copyright 2007 Free Software Foundation, Inc.
+
@ -106,16 +106,16 @@ Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.base/fork-detach.exp
+gdb_test "" \
+ "Detaching after fork from child process.*\\\[Inferior .* exited normally\\\]" \
+ "Info message caught"
Index: gdb-7.8.50.20141228/gdb/infrun.c
Index: gdb-7.9.50.20150531/gdb/infrun.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/infrun.c 2015-01-06 19:31:40.262986644 +0100
+++ gdb-7.8.50.20141228/gdb/infrun.c 2015-01-06 19:43:54.865219096 +0100
@@ -456,7 +456,7 @@ holding the child stopped. Try \"set de
--- gdb-7.9.50.20150531.orig/gdb/infrun.c 2015-05-31 18:23:41.703405617 +0200
+++ gdb-7.9.50.20150531/gdb/infrun.c 2015-05-31 18:23:49.011450735 +0200
@@ -443,7 +443,7 @@ holding the child stopped. Try \"set de
remove_breakpoints_pid (ptid_get_pid (inferior_ptid));
}
- if (info_verbose || debug_infrun)
+ if (1 /* Fedora Bug 235197 */ || info_verbose || debug_infrun)
{
target_terminal_ours_for_output ();
fprintf_filtered (gdb_stdlog,
/* Ensure that we have a process ptid. */
ptid_t process_ptid = pid_to_ptid (ptid_get_pid (child_ptid));

View File

@ -1,217 +0,0 @@
2007-06-25 Jan Kratochvil <jan.kratochvil@redhat.com>
* inferior.h (enum resume_step): New definition.
(resume): Change STEP parameter type to ENUM RESUME_STEP.
* infrun.c (resume): Likewise. Extend debug printing of the STEP
parameter. Lock the scheduler only for intentional stepping.
(proceed): Replace the variable ONESTEP with tristate RESUME_STEP.
Set the third RESUME_STEP state according to BPSTAT_SHOULD_STEP.
(currently_stepping): Change the return type to ENUM RESUME_STEP.
Return RESUME_STEP_NEEDED if it is just due to BPSTAT_SHOULD_STEP.
* linux-nat.c (select_singlestep_lwp_callback): Do not focus on
the software watchpoint events.
* linux-nat.h (struct lwp_info): Redeclare STEP as ENUM RESUME_STEP.
2007-10-19 Jan Kratochvil <jan.kratochvil@redhat.com>
* infrun.c (proceed): RESUME_STEP initialized for non-stepping.
RESUME_STEP set according to STEP only at the end of the function.
2008-02-24 Jan Kratochvil <jan.kratochvil@redhat.com>
Port to GDB-6.8pre.
Index: gdb-7.8.90.20150125/gdb/infrun.c
===================================================================
--- gdb-7.8.90.20150125.orig/gdb/infrun.c 2015-01-25 08:36:16.651716159 +0100
+++ gdb-7.8.90.20150125/gdb/infrun.c 2015-01-25 08:36:26.491758571 +0100
@@ -86,7 +86,7 @@ static void follow_inferior_reset_breakp
static void set_schedlock_func (char *args, int from_tty,
struct cmd_list_element *c);
-static int currently_stepping (struct thread_info *tp);
+static enum resume_step currently_stepping (struct thread_info *tp);
static void xdb_handle_command (char *args, int from_tty);
@@ -1998,7 +1998,7 @@ user_visible_resume_ptid (int step)
resume_ptid = inferior_ptid;
}
else if ((scheduler_mode == schedlock_on)
- || (scheduler_mode == schedlock_step && step))
+ || (scheduler_mode == schedlock_step && step == RESUME_STEP_USER))
{
/* User-settable 'scheduler' mode requires solo thread resume. */
resume_ptid = inferior_ptid;
@@ -2022,7 +2022,7 @@ user_visible_resume_ptid (int step)
STEP nonzero if we should step (zero to continue instead).
SIG is the signal to give the inferior (zero for none). */
void
-resume (int step, enum gdb_signal sig)
+resume (enum resume_step step, enum gdb_signal sig)
{
struct cleanup *old_cleanups = make_cleanup (resume_cleanups, 0);
struct regcache *regcache = get_current_regcache ();
@@ -2064,9 +2064,13 @@ resume (int step, enum gdb_signal sig)
if (debug_infrun)
fprintf_unfiltered (gdb_stdlog,
- "infrun: resume (step=%d, signal=%s), "
+ "infrun: resume (step=%s, signal=%s), "
"trap_expected=%d, current thread [%s] at %s\n",
- step, gdb_signal_to_symbol_string (sig),
+ (step == RESUME_STEP_CONTINUE
+ ? "RESUME_STEP_CONTINUE"
+ : (step == RESUME_STEP_USER ? "RESUME_STEP_USER"
+ : "RESUME_STEP_NEEDED")),
+ gdb_signal_to_symbol_string (sig),
tp->control.trap_expected,
target_pid_to_str (inferior_ptid),
paddress (gdbarch, pc));
@@ -2543,6 +2547,7 @@ proceed (CORE_ADDR addr, enum gdb_signal
struct thread_info *tp;
CORE_ADDR pc;
struct address_space *aspace;
+ enum resume_step resume_step = RESUME_STEP_CONTINUE;
/* If we're stopped at a fork/vfork, follow the branch set by the
"set follow-fork-mode" command; otherwise, we'll just proceed
@@ -2586,13 +2591,19 @@ proceed (CORE_ADDR addr, enum gdb_signal
Note, we don't do this in reverse, because we won't
actually be executing the breakpoint insn anyway.
We'll be (un-)executing the previous instruction. */
+ {
tp->stepping_over_breakpoint = 1;
+ resume_step = RESUME_STEP_USER;
+ }
else if (gdbarch_single_step_through_delay_p (gdbarch)
&& gdbarch_single_step_through_delay (gdbarch,
get_current_frame ()))
/* We stepped onto an instruction that needs to be stepped
again before re-inserting the breakpoint, do so. */
+ {
tp->stepping_over_breakpoint = 1;
+ resume_step = RESUME_STEP_USER;
+ }
}
else
{
@@ -2647,6 +2658,7 @@ proceed (CORE_ADDR addr, enum gdb_signal
tp->prev_pc = regcache_read_pc (get_current_regcache ());
switch_to_thread (step_over->ptid);
tp = step_over;
+ resume_step = RESUME_STEP_USER;
}
}
@@ -2699,9 +2711,13 @@ proceed (CORE_ADDR addr, enum gdb_signal
correctly when the inferior is stopped. */
tp->prev_pc = regcache_read_pc (get_current_regcache ());
+ if (tp->control.trap_expected || step)
+ resume_step = RESUME_STEP_USER;
+ if (resume_step == RESUME_STEP_CONTINUE && bpstat_should_step ())
+ resume_step = RESUME_STEP_NEEDED;
+
/* Resume inferior. */
- resume (tp->control.trap_expected || step || bpstat_should_step (),
- tp->suspend.stop_signal);
+ resume (resume_step, tp->suspend.stop_signal);
/* Wait for it to stop (if not standalone)
and in any case decode why it stopped, and act accordingly. */
@@ -5684,14 +5700,16 @@ switch_back_to_stepped_thread (struct ex
/* Is thread TP in the middle of single-stepping? */
-static int
+static enum resume_step
currently_stepping (struct thread_info *tp)
{
- return ((tp->control.step_range_end
+ if ((tp->control.step_range_end
&& tp->control.step_resume_breakpoint == NULL)
- || tp->control.trap_expected
- || tp->stepped_breakpoint
- || bpstat_should_step ());
+ || tp->control.trap_expected)
+ return RESUME_STEP_USER;
+ if (bpstat_should_step ())
+ return RESUME_STEP_NEEDED;
+ return RESUME_STEP_CONTINUE;
}
/* Inferior has stepped into a subroutine call with source code that
Index: gdb-7.8.90.20150125/gdb/linux-nat.c
===================================================================
--- gdb-7.8.90.20150125.orig/gdb/linux-nat.c 2015-01-25 08:36:16.653716168 +0100
+++ gdb-7.8.90.20150125/gdb/linux-nat.c 2015-01-25 08:36:26.492758576 +0100
@@ -2648,7 +2648,11 @@ static int
select_singlestep_lwp_callback (struct lwp_info *lp, void *data)
{
if (lp->last_resume_kind == resume_step
- && lp->status != 0)
+ && lp->status != 0
+ /* We do not focus on software watchpoints as we would not catch
+ STEPPING_PAST_SINGLESTEP_BREAKPOINT breakpoints in some other thread
+ as they would remain pending due to `Push back breakpoint for %s'. */
+ && lp->step == RESUME_STEP_USER)
return 1;
else
return 0;
Index: gdb-7.8.90.20150125/gdb/linux-nat.h
===================================================================
--- gdb-7.8.90.20150125.orig/gdb/linux-nat.h 2015-01-25 08:36:16.653716168 +0100
+++ gdb-7.8.90.20150125/gdb/linux-nat.h 2015-01-25 08:36:44.948838126 +0100
@@ -18,6 +18,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "target.h"
+#include "infrun.h"
#include <signal.h>
@@ -88,8 +89,8 @@ struct lwp_info
running and not stepping, this is 0. */
CORE_ADDR stop_pc;
- /* Non-zero if we were stepping this LWP. */
- int step;
+ /* The kind of stepping of this LWP. */
+ enum resume_step step;
/* The reason the LWP last stopped, if we need to track it
(breakpoint, watchpoint, etc.) */
Index: gdb-7.8.90.20150125/gdb/infrun.h
===================================================================
--- gdb-7.8.90.20150125.orig/gdb/infrun.h 2015-01-25 08:36:16.654716172 +0100
+++ gdb-7.8.90.20150125/gdb/infrun.h 2015-01-25 08:36:26.493758580 +0100
@@ -92,7 +92,14 @@ extern void proceed (CORE_ADDR, enum gdb
/* The `resume' routine should only be called in special circumstances.
Normally, use `proceed', which handles a lot of bookkeeping. */
-extern void resume (int, enum gdb_signal);
+enum resume_step
+ {
+ /* currently_stepping () should return non-zero for non-continue. */
+ RESUME_STEP_CONTINUE = 0,
+ RESUME_STEP_USER, /* Stepping is intentional by the user. */
+ RESUME_STEP_NEEDED /* Stepping only for software watchpoints. */
+ };
+extern void resume (enum resume_step, enum gdb_signal);
/* Return a ptid representing the set of threads that we will proceed,
in the perspective of the user/frontend. */
Index: gdb-7.8.90.20150125/gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.exp
===================================================================
--- gdb-7.8.90.20150125.orig/gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.exp 2015-01-25 08:36:16.654716172 +0100
+++ gdb-7.8.90.20150125/gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.exp 2015-01-25 08:36:26.493758580 +0100
@@ -97,7 +97,7 @@ gdb_test "set debug infrun 1"
gdb_test \
"step" \
- ".*need to step-over.*resume \\(step=1.*signal arrived while stepping over breakpoint.*switching back to stepped thread.*stepped to a different line.*callme.*" \
+ ".*need to step-over.*resume \\(step=RESUME_STEP_USER.*signal arrived while stepping over breakpoint.*switching back to stepped thread.*stepped to a different line.*callme.*" \
"step"
set cnt_after [get_value "args\[$my_number\]" "get count after step"]

View File

@ -1,8 +1,8 @@
Index: gdb-7.8.90.20150125/gdb/linux-nat.c
Index: gdb-7.9.50.20150531/gdb/linux-nat.c
===================================================================
--- gdb-7.8.90.20150125.orig/gdb/linux-nat.c 2015-01-25 08:42:49.381408899 +0100
+++ gdb-7.8.90.20150125/gdb/linux-nat.c 2015-01-25 08:43:16.378525322 +0100
@@ -174,6 +174,9 @@ blocked. */
--- gdb-7.9.50.20150531.orig/gdb/linux-nat.c 2015-05-31 18:23:56.147494790 +0200
+++ gdb-7.9.50.20150531/gdb/linux-nat.c 2015-05-31 18:24:01.935530759 +0200
@@ -168,6 +168,9 @@ blocked. */
static struct target_ops *linux_ops;
static struct target_ops linux_ops_saved;
@ -12,7 +12,7 @@ Index: gdb-7.8.90.20150125/gdb/linux-nat.c
/* The method to call, if any, when a new thread is attached. */
static void (*linux_nat_new_thread) (struct lwp_info *);
@@ -924,6 +927,7 @@ linux_nat_post_attach_wait (ptid_t ptid,
@@ -981,6 +984,7 @@ linux_nat_post_attach_wait (ptid_t ptid,
if (debug_linux_nat)
fprintf_unfiltered (gdb_stdlog,
"LNPAW: Attaching to a stopped process\n");
@ -20,7 +20,7 @@ Index: gdb-7.8.90.20150125/gdb/linux-nat.c
/* The process is definitely stopped. It is in a job control
stop, unless the kernel predates the TASK_STOPPED /
@@ -1424,6 +1428,9 @@ get_pending_status (struct lwp_info *lp,
@@ -1468,6 +1472,9 @@ get_pending_status (struct lwp_info *lp,
gdb_signal_to_string (signo));
}
@ -30,7 +30,7 @@ Index: gdb-7.8.90.20150125/gdb/linux-nat.c
return 0;
}
@@ -1537,6 +1544,8 @@ linux_nat_detach (struct target_ops *ops
@@ -1581,6 +1588,8 @@ linux_nat_detach (struct target_ops *ops
}
else
linux_ops->to_detach (ops, args, from_tty);
@ -39,7 +39,7 @@ Index: gdb-7.8.90.20150125/gdb/linux-nat.c
}
/* Resume execution of the inferior process. If STEP is nonzero,
@@ -1741,6 +1750,14 @@ linux_nat_resume (struct target_ops *ops
@@ -1839,6 +1848,14 @@ linux_nat_resume (struct target_ops *ops
return;
}
@ -54,7 +54,7 @@ Index: gdb-7.8.90.20150125/gdb/linux-nat.c
if (resume_many)
iterate_over_lwps (ptid, linux_nat_resume_callback, lp);
@@ -3723,6 +3740,8 @@ linux_nat_mourn_inferior (struct target_
@@ -3935,6 +3952,8 @@ linux_nat_mourn_inferior (struct target_
/* Let the arch-specific native code know this process is gone. */
linux_nat_forget_process (pid);
@ -63,10 +63,10 @@ Index: gdb-7.8.90.20150125/gdb/linux-nat.c
}
/* Convert a native/host siginfo object, into/from the siginfo in the
Index: gdb-7.8.90.20150125/gdb/testsuite/gdb.threads/attach-stopped.exp
Index: gdb-7.9.50.20150531/gdb/testsuite/gdb.threads/attach-stopped.exp
===================================================================
--- gdb-7.8.90.20150125.orig/gdb/testsuite/gdb.threads/attach-stopped.exp 2015-01-25 08:42:49.382408903 +0100
+++ gdb-7.8.90.20150125/gdb/testsuite/gdb.threads/attach-stopped.exp 2015-01-25 08:43:16.379525327 +0100
--- gdb-7.9.50.20150531.orig/gdb/testsuite/gdb.threads/attach-stopped.exp 2015-05-31 18:23:56.148494796 +0200
+++ gdb-7.9.50.20150531/gdb/testsuite/gdb.threads/attach-stopped.exp 2015-05-31 18:24:01.935530759 +0200
@@ -61,7 +61,65 @@ proc corefunc { threadtype } {
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
@ -134,12 +134,12 @@ Index: gdb-7.8.90.20150125/gdb/testsuite/gdb.threads/attach-stopped.exp
set test "$threadtype: attach2 to stopped, after setting file"
gdb_test_multiple "attach $testpid" "$test" {
Index: gdb-7.8.90.20150125/gdb/infrun.c
Index: gdb-7.9.50.20150531/gdb/infrun.c
===================================================================
--- gdb-7.8.90.20150125.orig/gdb/infrun.c 2015-01-25 08:42:49.385408916 +0100
+++ gdb-7.8.90.20150125/gdb/infrun.c 2015-01-25 08:43:16.381525335 +0100
@@ -600,6 +600,11 @@ holding the child stopped. Try \"set de
child_pid);
--- gdb-7.9.50.20150531.orig/gdb/infrun.c 2015-05-31 18:23:56.150494809 +0200
+++ gdb-7.9.50.20150531/gdb/infrun.c 2015-05-31 18:24:01.938530778 +0200
@@ -591,6 +591,11 @@ holding the child stopped. Try \"set de
target_pid_to_str (process_ptid));
}
+ /* We should check PID_WAS_STOPPED and detach it stopped accordingly.

View File

@ -1,105 +0,0 @@
--- /dev/null 2009-04-19 14:49:00.974648389 +0200
+++ gdb-6.8/gdb/testsuite/gdb.arch/i386-biarch-core.exp 2009-04-19 16:30:12.000000000 +0200
@@ -0,0 +1,61 @@
+# This testcase is part of GDB, the GNU debugger.
+
+# Copyright 2009 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 2 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, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Test ability to load an elf64-i386 core file. The provided core file was
+# elf64-x8664 one but it got binary patched to i386:
+# Elf32_Ehdr.e_machine @0x12..0x13
+# Elf64_Ehdr.e_machine @0x12..0x13
+# #define EM_386 3 /* Intel 80386 */
+# #define EM_X86_64 62 /* AMD x86-64 architecture */
+# patch @0x12: 0x3E -> 0x03
+
+if { ![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"] } then {
+ verbose "Skipping i386-biarch-core test."
+ return
+}
+
+set testfile "i386-biarch-core"
+set corebz2uufile ${srcdir}/${subdir}/${testfile}.core.bz2.uu
+set corefile ${objdir}/${subdir}/${testfile}.core
+# Entry point of the original executable.
+set address 0x400078
+
+if {[catch "system \"uudecode -o - ${corebz2uufile} | bzip2 -dc >${corefile}\""] != 0} {
+ untested "failed uudecode or bzip2"
+ return -1
+}
+file stat ${corefile} corestat
+if {$corestat(size) != 102400} {
+ untested "uudecode or bzip2 produce invalid result"
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+# Wrongly built GDB complains by:
+# "..." is not a core dump: File format not recognized
+# As the provided test core has 64bit PRSTATUS i386 built GDB cannot parse it.
+# This is just a problem of the test care, real-world elf64-i386 file will have
+# 32bit PRSTATUS. One cannot prepare elf64-i386 core file from elf32-i386 by
+# objcopy as it corrupts the core file beyond all recognition.
+# "\r\nCore was generated by `\[^\r\n\]*'\\.\r\nProgram terminated with signal 11, Segmentation fault\\.\r\n.*"
+gdb_test "core-file ${corefile}"
+
+gdb_test "x/i $address" "\r\n\[ \t\]*$address:\[ \t\]*hlt\[ \t\]*" ".text is readable"
--- /dev/null 2009-04-19 14:49:00.974648389 +0200
+++ gdb-6.8/gdb/testsuite/gdb.arch/i386-biarch-core.S 2009-04-19 14:52:28.000000000 +0200
@@ -0,0 +1,22 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2009 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 2 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, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+ .globl _start
+_start:
+ hlt
--- /dev/null 2009-04-19 14:49:00.974648389 +0200
+++ gdb-6.8/gdb/testsuite/gdb.arch/i386-biarch-core.core.bz2.uu 2009-04-19 15:02:12.000000000 +0200
@@ -0,0 +1,13 @@
+begin 600 i386-biarch-core.core.bz2
+M0EIH.3%!629361`P1\P`!)?_____\9'@"8Q)6P380'9@'&#`0D@``"``%(``
+M@`#`"!<(L`%F"(:$GH13::F-)M&D&U,AD:`--#)M0&FT0XR9--,)D9`P(Q-&
+M",(-&F``02)%38HT]0T`&AH```'H@``T^>9T*(,("&)SE`>`9@+GP=[,N)KB
+M'I8BL(L]N5TCY\%V]/?DB.BN*UZ'U@]TN7-]UJ5\_%0QTT<*086#%MHT7XVJ
+M9D"+C!"2*L:8D1XPD!`--M@*XT1H5RFYN&)(!0P0#:`I:;2;$5M&\*9"0@%:
+MK@X[T()M)9N7`D$VA!^63)%,;@8LT`(7\K&[7G;U:"B6'!GG+46ALOZF.2F-
+M!@>C*%86X$-]C2`KE;HG)UL(913VR2G]0BD:J=Z_`G@S,`W%.8RMS-#5P:J0
+MAJ2\8&X?@DE;UF68QHM<,D`('::J65/S:PAG*R-09["8DBI)'V]Y.[(/AM*L
+M"X_O^V;%FY.S6Q]FM=D37>5F,%4-F1ZF#,CFJVU;H*^IT<(%<V`.32$`JU["
+/G`68?\7<D4X4)`0,$?,`
+`
+end

View File

@ -5,11 +5,11 @@ Some of the threads may not be properly PTRACE_DETACHed which hurts if they
should have been detached with SIGSTOP (as they are accidentally left running
on the debugger termination).
Index: gdb-7.7.90.20140613/gdb/defs.h
Index: gdb-7.9.50.20150520/gdb/defs.h
===================================================================
--- gdb-7.7.90.20140613.orig/gdb/defs.h 2014-06-13 23:10:18.876623018 +0200
+++ gdb-7.7.90.20140613/gdb/defs.h 2014-06-13 23:10:52.450660505 +0200
@@ -174,6 +174,7 @@ extern void set_quit_flag (void);
--- gdb-7.9.50.20150520.orig/gdb/defs.h 2015-05-31 18:06:24.579002757 +0200
+++ gdb-7.9.50.20150520/gdb/defs.h 2015-05-31 18:06:29.253031613 +0200
@@ -145,6 +145,7 @@ extern void set_quit_flag (void);
/* Flag that function quit should call quit_force. */
extern volatile int sync_quit_force_run;
@ -17,13 +17,13 @@ Index: gdb-7.7.90.20140613/gdb/defs.h
extern int immediate_quit;
extern void quit (void);
Index: gdb-7.7.90.20140613/gdb/top.c
Index: gdb-7.9.50.20150520/gdb/top.c
===================================================================
--- gdb-7.7.90.20140613.orig/gdb/top.c 2014-06-13 23:10:15.910619715 +0200
+++ gdb-7.7.90.20140613/gdb/top.c 2014-06-13 23:10:18.877623020 +0200
@@ -1378,7 +1378,9 @@ quit_force (char *args, int from_tty)
if (ex.reason < 0) \
exception_print (gdb_stderr, ex)
--- gdb-7.9.50.20150520.orig/gdb/top.c 2015-05-31 18:06:24.580002763 +0200
+++ gdb-7.9.50.20150520/gdb/top.c 2015-05-31 18:06:29.254031619 +0200
@@ -1463,7 +1463,9 @@ quit_force (char *args, int from_tty)
qt.args = args;
qt.from_tty = from_tty;
- /* We want to handle any quit errors and exit regardless. */
+ /* We want to handle any quit errors and exit regardless but we should never
@ -31,12 +31,12 @@ Index: gdb-7.7.90.20140613/gdb/top.c
+ quit_flag_cleanup = 1;
/* Get out of tfind mode, and kill or detach all inferiors. */
DO_TRY
Index: gdb-7.7.90.20140613/gdb/utils.c
TRY
Index: gdb-7.9.50.20150520/gdb/utils.c
===================================================================
--- gdb-7.7.90.20140613.orig/gdb/utils.c 2014-06-13 23:10:18.878623021 +0200
+++ gdb-7.7.90.20140613/gdb/utils.c 2014-06-13 23:10:38.307644652 +0200
@@ -125,6 +125,11 @@ int job_control;
--- gdb-7.9.50.20150520.orig/gdb/utils.c 2015-05-31 18:06:24.582002776 +0200
+++ gdb-7.9.50.20150520/gdb/utils.c 2015-05-31 18:06:29.255031625 +0200
@@ -122,6 +122,11 @@ int job_control;
int immediate_quit;
@ -48,11 +48,11 @@ Index: gdb-7.7.90.20140613/gdb/utils.c
/* Nonzero means that strings with character values >0x7F should be printed
as octal escapes. Zero means just print the value (e.g. it's an
international character, and the terminal or window can cope.) */
Index: gdb-7.7.90.20140613/gdb/extension.c
Index: gdb-7.9.50.20150520/gdb/extension.c
===================================================================
--- gdb-7.7.90.20140613.orig/gdb/extension.c 2014-06-13 03:59:36.000000000 +0200
+++ gdb-7.7.90.20140613/gdb/extension.c 2014-06-13 23:11:32.434704853 +0200
@@ -817,6 +817,9 @@ check_quit_flag (void)
--- gdb-7.9.50.20150520.orig/gdb/extension.c 2015-05-31 18:06:24.582002776 +0200
+++ gdb-7.9.50.20150520/gdb/extension.c 2015-05-31 18:06:29.256031632 +0200
@@ -833,6 +833,9 @@ check_quit_flag (void)
int i, result = 0;
const struct extension_language_defn *extlang;

3
gdb-7.10.1.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8c04434ab0bb23aa886076c89684cc6ce5edc5f106c467492e7dfe8175c88346
size 26852345

View File

@ -1,11 +1,11 @@
Index: gdb-7.6.90.20140127/gdb/gdb_bfd.c
Index: gdb-7.9.90.20150709/gdb/gdb_bfd.c
===================================================================
--- gdb-7.6.90.20140127.orig/gdb/gdb_bfd.c 2014-02-06 17:39:46.370096290 +0100
+++ gdb-7.6.90.20140127/gdb/gdb_bfd.c 2014-02-06 17:40:14.996127247 +0100
@@ -29,12 +29,14 @@
#ifdef HAVE_ZLIB_H
#include <zlib.h>
#endif
--- gdb-7.9.90.20150709.orig/gdb/gdb_bfd.c 2015-07-09 18:23:59.344017882 +0200
+++ gdb-7.9.90.20150709/gdb/gdb_bfd.c 2015-07-09 18:24:06.986083071 +0200
@@ -24,12 +24,14 @@
#include "hashtab.h"
#include "filestuff.h"
#include "vec.h"
+#ifndef __sparc__
#ifdef HAVE_MMAP
#include <sys/mman.h>
@ -14,10 +14,10 @@ Index: gdb-7.6.90.20140127/gdb/gdb_bfd.c
#endif
#endif
+#endif
typedef bfd *bfdp;
DEF_VEC_P (bfdp);
@@ -210,6 +212,7 @@ free_one_bfd_section (bfd *abfd, asectio
#include "target.h"
#include "gdb/fileio.h"
#include "inferior.h"
@@ -397,6 +399,7 @@ free_one_bfd_section (bfd *abfd, asectio
if (sect != NULL && sect->data != NULL)
{
@ -25,7 +25,7 @@ Index: gdb-7.6.90.20140127/gdb/gdb_bfd.c
#ifdef HAVE_MMAP
if (sect->map_addr != NULL)
{
@@ -220,6 +223,7 @@ free_one_bfd_section (bfd *abfd, asectio
@@ -407,6 +410,7 @@ free_one_bfd_section (bfd *abfd, asectio
}
else
#endif
@ -33,7 +33,7 @@ Index: gdb-7.6.90.20140127/gdb/gdb_bfd.c
xfree (sect->data);
}
}
@@ -371,6 +375,7 @@ gdb_bfd_map_section (asection *sectp, bf
@@ -558,6 +562,7 @@ gdb_bfd_map_section (asection *sectp, bf
if (descriptor->data != NULL)
goto done;
@ -41,7 +41,7 @@ Index: gdb-7.6.90.20140127/gdb/gdb_bfd.c
#ifdef HAVE_MMAP
if (!bfd_is_section_compressed (abfd, sectp))
{
@@ -405,6 +410,7 @@ gdb_bfd_map_section (asection *sectp, bf
@@ -592,6 +597,7 @@ gdb_bfd_map_section (asection *sectp, bf
}
}
#endif /* HAVE_MMAP */

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6cb109cbbfb64a407863a15bc2a775a6bab52e5a6956a4ef3616b70cc4685b83
size 25684304

View File

@ -1,8 +1,8 @@
Index: gdb-7.7.50.20140609/gdb/gdbtypes.h
Index: gdb-7.9.50.20150520/gdb/gdbtypes.h
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/gdbtypes.h 2014-06-13 20:23:55.210626427 +0200
+++ gdb-7.7.50.20140609/gdb/gdbtypes.h 2014-06-13 20:24:26.156658622 +0200
@@ -440,6 +440,7 @@ enum field_loc_kind
--- gdb-7.9.50.20150520.orig/gdb/gdbtypes.h 2015-05-31 16:55:29.723475485 +0200
+++ gdb-7.9.50.20150520/gdb/gdbtypes.h 2015-05-31 16:55:49.716601669 +0200
@@ -462,6 +462,7 @@ enum field_loc_kind
{
FIELD_LOC_KIND_BITPOS, /**< bitpos */
FIELD_LOC_KIND_ENUMVAL, /**< enumval */
@ -10,15 +10,15 @@ Index: gdb-7.7.50.20140609/gdb/gdbtypes.h
FIELD_LOC_KIND_PHYSADDR, /**< physaddr */
FIELD_LOC_KIND_PHYSNAME, /**< physname */
FIELD_LOC_KIND_DWARF_BLOCK /**< dwarf_block */
@@ -617,6 +618,7 @@ struct main_type
field. Otherwise, physname is the mangled label of the
static field. */
@@ -513,6 +514,7 @@ union field_location
field. Otherwise, physname is the mangled label of the
static field. */
+ /* This address is unrelocated by the objfile's ANOFFSET. */
CORE_ADDR physaddr;
const char *physname;
+ /* This address is unrelocated by the objfile's ANOFFSET. */
CORE_ADDR physaddr;
const char *physname;
@@ -1262,6 +1264,7 @@ extern void allocate_gnat_aux_type (stru
@@ -1386,6 +1388,7 @@ extern void set_type_vptr_basetype (stru
#define FIELD_ENUMVAL_LVAL(thisfld) ((thisfld).loc.enumval)
#define FIELD_ENUMVAL(thisfld) (FIELD_ENUMVAL_LVAL (thisfld) + 0)
#define FIELD_STATIC_PHYSNAME(thisfld) ((thisfld).loc.physname)
@ -26,7 +26,7 @@ Index: gdb-7.7.50.20140609/gdb/gdbtypes.h
#define FIELD_STATIC_PHYSADDR(thisfld) ((thisfld).loc.physaddr)
#define FIELD_DWARF_BLOCK(thisfld) ((thisfld).loc.dwarf_block)
#define SET_FIELD_BITPOS(thisfld, bitpos) \
@@ -1273,6 +1276,7 @@ extern void allocate_gnat_aux_type (stru
@@ -1397,6 +1400,7 @@ extern void set_type_vptr_basetype (stru
#define SET_FIELD_PHYSNAME(thisfld, name) \
(FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSNAME, \
FIELD_STATIC_PHYSNAME (thisfld) = (name))
@ -34,7 +34,7 @@ Index: gdb-7.7.50.20140609/gdb/gdbtypes.h
#define SET_FIELD_PHYSADDR(thisfld, addr) \
(FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSADDR, \
FIELD_STATIC_PHYSADDR (thisfld) = (addr))
@@ -1289,6 +1293,7 @@ extern void allocate_gnat_aux_type (stru
@@ -1413,6 +1417,7 @@ extern void set_type_vptr_basetype (stru
#define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS (TYPE_FIELD (thistype, n))
#define TYPE_FIELD_ENUMVAL(thistype, n) FIELD_ENUMVAL (TYPE_FIELD (thistype, n))
#define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_STATIC_PHYSNAME (TYPE_FIELD (thistype, n))
@ -42,10 +42,10 @@ Index: gdb-7.7.50.20140609/gdb/gdbtypes.h
#define TYPE_FIELD_STATIC_PHYSADDR(thistype, n) FIELD_STATIC_PHYSADDR (TYPE_FIELD (thistype, n))
#define TYPE_FIELD_DWARF_BLOCK(thistype, n) FIELD_DWARF_BLOCK (TYPE_FIELD (thistype, n))
#define TYPE_FIELD_ARTIFICIAL(thistype, n) FIELD_ARTIFICIAL(TYPE_FIELD(thistype,n))
Index: gdb-7.7.50.20140609/gdb/jv-lang.c
Index: gdb-7.9.50.20150520/gdb/jv-lang.c
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/jv-lang.c 2014-06-13 20:23:55.211626428 +0200
+++ gdb-7.7.50.20140609/gdb/jv-lang.c 2014-06-13 20:23:56.278627534 +0200
--- gdb-7.9.50.20150520.orig/gdb/jv-lang.c 2015-05-31 16:55:29.724475491 +0200
+++ gdb-7.9.50.20150520/gdb/jv-lang.c 2015-05-31 16:55:30.820482408 +0200
@@ -427,7 +427,8 @@ java_link_class_type (struct gdbarch *gd
fields = NULL;
@ -66,11 +66,11 @@ Index: gdb-7.7.50.20140609/gdb/jv-lang.c
else
SET_FIELD_BITPOS (TYPE_FIELD (type, i), 8 * boffset);
if (accflags & 0x8000) /* FIELD_UNRESOLVED_FLAG */
Index: gdb-7.7.50.20140609/gdb/value.c
Index: gdb-7.9.50.20150520/gdb/value.c
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/value.c 2014-06-13 20:23:55.212626429 +0200
+++ gdb-7.7.50.20140609/gdb/value.c 2014-06-13 20:23:56.279627535 +0200
@@ -2783,7 +2783,8 @@ value_static_field (struct type *type, i
--- gdb-7.9.50.20150520.orig/gdb/value.c 2015-05-31 16:55:29.725475497 +0200
+++ gdb-7.9.50.20150520/gdb/value.c 2015-05-31 16:55:30.821482415 +0200
@@ -2951,7 +2951,8 @@ value_static_field (struct type *type, i
{
case FIELD_LOC_KIND_PHYSADDR:
retval = value_at_lazy (TYPE_FIELD_TYPE (type, fieldno),

View File

@ -2,7 +2,7 @@ http://sourceware.org/gdb/wiki/ProjectArcher
http://sourceware.org/gdb/wiki/ArcherBranchManagement
GIT snapshot:
commit d1a09bf2f8e7e3f752a1bbeba135bc080bf0c865
commit f0ee78c5ccefe388a64273353ecd5c99dae62558
tromey/python
@ -16,10 +16,10 @@ index 0000000..173b8ea
+This branch originally held the Python code for gdb. It still exists
+because a small amount of code here has not yet been merged upstream.
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index be69b6f..a4483e4 100644
index 95104ef..a9b198a 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -1515,6 +1515,12 @@ stamp-h: $(srcdir)/config.in config.status
@@ -1534,6 +1534,12 @@ stamp-h: $(srcdir)/config.in config.status
CONFIG_LINKS= \
$(SHELL) config.status
@ -33,11 +33,11 @@ index be69b6f..a4483e4 100644
$(SHELL) config.status --recheck
diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in
index 00c70bb..f93ffdd 100644
index 30cfd17..e977b30 100644
--- a/gdb/data-directory/Makefile.in
+++ b/gdb/data-directory/Makefile.in
@@ -64,7 +64,10 @@ PYTHON_FILE_LIST = \
gdb/printing.py \
@@ -65,7 +65,10 @@ PYTHON_FILE_LIST = \
gdb/unwinder.py \
gdb/prompt.py \
gdb/xmethod.py \
+ gdb/types.py \
@ -46,8 +46,8 @@ index 00c70bb..f93ffdd 100644
+ gdb/command/pahole.py \
gdb/command/xmethods.py \
gdb/command/frame_filters.py \
gdb/command/type_printers.py \
@@ -74,6 +77,8 @@ PYTHON_FILE_LIST = \
gdb/command/unwinders.py \
@@ -76,6 +79,8 @@ PYTHON_FILE_LIST = \
gdb/function/__init__.py \
gdb/function/caller_is.py \
gdb/function/strfns.py \
@ -57,7 +57,7 @@ index 00c70bb..f93ffdd 100644
gdb/printer/bound_registers.py
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index e086c33..5dfeb1d 100644
index 1665372..c4caffc 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -1225,6 +1225,16 @@ for remote debugging.
@ -78,7 +78,7 @@ index e086c33..5dfeb1d 100644
@item -tui
@cindex @code{--tui}
diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
index 234ce5c..e940125 100644
index 57ec22e..13beb05 100644
--- a/gdb/doc/python.texi
+++ b/gdb/doc/python.texi
@@ -88,8 +88,6 @@ containing @code{end}. For example:
@ -111,7 +111,7 @@ index 05a38b2..9801fdf 100644
set variable $gdb_init_done = 1
diff --git a/gdb/main.c b/gdb/main.c
index accd927..ed211f6 100644
index aecd60a..d0f7834 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -33,6 +33,7 @@
@ -122,7 +122,7 @@ index accd927..ed211f6 100644
#include "source.h"
#include "cli/cli-cmds.h"
#include "objfiles.h"
@@ -444,6 +445,8 @@ captured_main (void *data)
@@ -453,6 +454,8 @@ captured_main (void *data)
char *cdarg = NULL;
char *ttyarg = NULL;
@ -131,7 +131,7 @@ index accd927..ed211f6 100644
/* These are static so that we can take their address in an
initializer. */
static int print_help;
@@ -649,10 +652,14 @@ captured_main (void *data)
@@ -663,10 +666,14 @@ captured_main (void *data)
{"args", no_argument, &set_args, 1},
{"l", required_argument, 0, 'l'},
{"return-child-result", no_argument, &return_child_result, 1},
@ -147,7 +147,7 @@ index accd927..ed211f6 100644
{
int option_index;
@@ -670,6 +677,9 @@ captured_main (void *data)
@@ -684,6 +691,9 @@ captured_main (void *data)
case 0:
/* Long option that just sets a flag. */
break;
@ -157,7 +157,7 @@ index accd927..ed211f6 100644
case OPT_SE:
symarg = optarg;
execarg = optarg;
@@ -851,7 +861,31 @@ captured_main (void *data)
@@ -864,7 +874,31 @@ captured_main (void *data)
/* Now that gdb_init has created the initial inferior, we're in
position to set args for that inferior. */
@ -190,7 +190,7 @@ index accd927..ed211f6 100644
{
/* The remaining options are the command-line options for the
inferior. The first one is the sym/exec file, and the rest
@@ -1129,7 +1163,8 @@ captured_main (void *data)
@@ -1137,7 +1171,8 @@ captured_main (void *data)
/* Read in the old history after all the command files have been
read. */
@ -200,7 +200,7 @@ index accd927..ed211f6 100644
if (batch_flag)
{
@@ -1140,13 +1175,25 @@ captured_main (void *data)
@@ -1148,13 +1183,25 @@ captured_main (void *data)
/* Show time and/or space usage. */
do_cleanups (pre_stat_chain);
@ -232,7 +232,7 @@ index accd927..ed211f6 100644
}
/* No exit -- exit is through quit_command. */
}
@@ -1180,6 +1227,12 @@ print_gdb_help (struct ui_file *stream)
@@ -1188,6 +1235,12 @@ print_gdb_help (struct ui_file *stream)
fputs_unfiltered (_("\
This is the GNU debugger. Usage:\n\n\
gdb [options] [executable-file [core-file or process-id]]\n\
@ -245,10 +245,10 @@ index accd927..ed211f6 100644
gdb [options] --args executable-file [inferior-arguments ...]\n\n\
"), stream);
fputs_unfiltered (_("\
@@ -1225,6 +1278,13 @@ Output and user interface control:\n\n\
@@ -1232,6 +1285,13 @@ Output and user interface control:\n\n\
#endif
fputs_unfiltered (_("\
--dbx DBX compatibility mode.\n\
--xdb XDB compatibility mode.\n\
+"), stream);
+#if HAVE_PYTHON
+ fputs_unfiltered (_("\
@ -304,7 +304,7 @@ index 0000000..6fa48ff
+IgnoreErrorsCommand ()
diff --git a/gdb/python/lib/gdb/command/pahole.py b/gdb/python/lib/gdb/command/pahole.py
new file mode 100644
index 0000000..dee04f5
index 0000000..e08eaf5
--- /dev/null
+++ b/gdb/python/lib/gdb/command/pahole.py
@@ -0,0 +1,81 @@
@ -365,19 +365,19 @@ index 0000000..dee04f5
+ fieldsize = 8 * ftype.sizeof
+
+ # TARGET_CHAR_BIT
+ print (' /* %3d %3d */' % (int (bitpos / 8), int (fieldsize / 8)))
+ print (' /* %3d %3d */' % (int (bitpos / 8), int (fieldsize / 8)), end = "")
+ bitpos = bitpos + fieldsize
+
+ if ftype.code == gdb.TYPE_CODE_STRUCT:
+ self.pahole (ftype, level + 1, field.name)
+ else:
+ print (' ' * (2 + 2 * level))
+ print (' ' * (2 + 2 * level), end = "")
+ print ('%s %s' % (str (ftype), field.name))
+
+ if level == 0:
+ self.maybe_print_hole(bitpos, 8 * type.sizeof)
+
+ print (' ' * (14 + 2 * level))
+ print (' ' * (14 + 2 * level), end = "")
+ print ('} %s' % name)
+
+ def invoke (self, arg, from_tty):
@ -385,7 +385,7 @@ index 0000000..dee04f5
+ type = type.strip_typedefs ()
+ if type.code != gdb.TYPE_CODE_STRUCT:
+ raise (TypeError, '%s is not a struct type' % arg)
+ print (' ' * 14)
+ print (' ' * 14, end = "")
+ self.pahole (type, 0, '')
+
+Pahole()
@ -443,7 +443,7 @@ index 0000000..8742680
+
+InScope ()
diff --git a/gdb/python/python.c b/gdb/python/python.c
index b1d8283..54a2d9b 100644
index 4f88b0e..870a1ba 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -93,6 +93,8 @@ const struct extension_language_defn extension_language_python =
@ -455,7 +455,7 @@ index b1d8283..54a2d9b 100644
#include "target.h"
#include "gdbthread.h"
#include "interps.h"
@@ -1220,6 +1222,83 @@ gdbpy_print_stack (void)
@@ -1262,6 +1264,83 @@ gdbpy_print_stack (void)
/* Return the current Progspace.
There always is one. */
@ -539,7 +539,7 @@ index b1d8283..54a2d9b 100644
static PyObject *
gdbpy_get_current_progspace (PyObject *unused1, PyObject *unused2)
@@ -1913,6 +1992,8 @@ static PyMethodDef GdbMethods[] =
@@ -1982,6 +2061,8 @@ PyMethodDef python_GdbMethods[] =
Evaluate command, a string, as a gdb CLI command. Optionally returns\n\
a Python String containing the output of the command if to_string is\n\
set to True." },
@ -549,7 +549,7 @@ index b1d8283..54a2d9b 100644
"Return a gdb parameter's value" },
diff --git a/gdb/python/python.h b/gdb/python/python.h
index 9e99992..c776e59 100644
index e6bfcca..688daa3 100644
--- a/gdb/python/python.h
+++ b/gdb/python/python.h
@@ -25,4 +25,6 @@
@ -560,7 +560,7 @@ index 9e99992..c776e59 100644
+
#endif /* GDB_PYTHON_H */
diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp
index 0b11e12..e35e829 100644
index 9f25a48..88b0842 100644
--- a/gdb/testsuite/gdb.gdb/selftest.exp
+++ b/gdb/testsuite/gdb.gdb/selftest.exp
@@ -92,6 +92,10 @@ proc do_steps_and_nexts {} {
@ -575,7 +575,7 @@ index 0b11e12..e35e829 100644
set description "next over make_command_stats_cleanup and everything it calls"
set command "next"
diff --git a/gdb/testsuite/gdb.python/py-frame.exp b/gdb/testsuite/gdb.python/py-frame.exp
index e47f340..a7e0a52 100644
index 33fdbe5..264d00f 100644
--- a/gdb/testsuite/gdb.python/py-frame.exp
+++ b/gdb/testsuite/gdb.python/py-frame.exp
@@ -95,6 +95,8 @@ gdb_test "python print ('result = %s' % f0.read_var ('a'))" " = 1" "test Frame.r
@ -588,7 +588,7 @@ index e47f340..a7e0a52 100644
gdb_test "python print ('result = %s' % (gdb.selected_frame ().read_register ('sp') == gdb.parse_and_eval ('\$sp')))" \
" = True" \
diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp
index f081ff0..58cce09 100644
index baa17b7..45ad67e 100644
--- a/gdb/testsuite/gdb.python/py-value.exp
+++ b/gdb/testsuite/gdb.python/py-value.exp
@@ -388,6 +388,15 @@ proc test_value_after_death {} {

View File

@ -37,22 +37,22 @@ gdb/gdbserver/
(linux_create_inferior, linux_tracefork_child): Call it instead of
direct ptrace.
Index: gdb-7.8.90.20150125/gdb/nat/linux-ptrace.c
Index: gdb-7.9.90.20150709/gdb/nat/linux-ptrace.c
===================================================================
--- gdb-7.8.90.20150125.orig/gdb/nat/linux-ptrace.c 2015-01-25 08:36:55.710884511 +0100
+++ gdb-7.8.90.20150125/gdb/nat/linux-ptrace.c 2015-01-25 08:38:43.157347627 +0100
@@ -25,6 +25,10 @@
#include <stdint.h>
--- gdb-7.9.90.20150709.orig/gdb/nat/linux-ptrace.c 2015-07-09 18:24:13.705140384 +0200
+++ gdb-7.9.90.20150709/gdb/nat/linux-ptrace.c 2015-07-09 18:24:24.911235973 +0200
@@ -23,6 +23,10 @@
#include "buffer.h"
#include "gdb_wait.h"
+#ifdef HAVE_SELINUX_SELINUX_H
+# include <selinux/selinux.h>
+#endif /* HAVE_SELINUX_SELINUX_H */
+
/* Stores the currently supported ptrace options. A value of
-1 means we did not check for features yet. A value of 0 means
there are no supported features. */
@@ -53,6 +57,8 @@ linux_ptrace_attach_fail_reason (pid_t p
/* Stores the ptrace options supported by the running kernel.
A value of -1 means we did not check for features yet. A value
of 0 means there are no supported features. */
@@ -47,6 +51,8 @@ linux_ptrace_attach_fail_reason (pid_t p
buffer_xml_printf (buffer, _("process %d is a zombie "
"- the process has already terminated"),
(int) pid);
@ -61,7 +61,7 @@ Index: gdb-7.8.90.20150125/gdb/nat/linux-ptrace.c
}
/* See linux-ptrace.h. */
@@ -595,6 +601,22 @@ linux_ptrace_init_warnings (void)
@@ -581,6 +587,22 @@ linux_ptrace_init_warnings (void)
linux_ptrace_test_ret_to_nx ();
}
@ -81,26 +81,26 @@ Index: gdb-7.8.90.20150125/gdb/nat/linux-ptrace.c
+#endif /* HAVE_LIBSELINUX */
+}
+
/* Set additional ptrace flags to use. Some such flags may be checked
by the implementation above. This function must be called before
any other function in this file; otherwise the flags may not take
Index: gdb-7.8.90.20150125/gdb/nat/linux-ptrace.h
/* Extract extended ptrace event from wait status. */
int
Index: gdb-7.9.90.20150709/gdb/nat/linux-ptrace.h
===================================================================
--- gdb-7.8.90.20150125.orig/gdb/nat/linux-ptrace.h 2015-01-25 08:37:02.800915071 +0100
+++ gdb-7.8.90.20150125/gdb/nat/linux-ptrace.h 2015-01-25 08:38:16.565233009 +0100
@@ -98,6 +98,7 @@ extern void linux_ptrace_attach_fail_rea
--- gdb-7.9.90.20150709.orig/gdb/nat/linux-ptrace.h 2015-07-09 18:24:13.706140392 +0200
+++ gdb-7.9.90.20150709/gdb/nat/linux-ptrace.h 2015-07-09 18:24:24.912235981 +0200
@@ -157,6 +157,7 @@ extern void linux_ptrace_attach_fail_rea
extern char *linux_ptrace_attach_fail_reason_string (ptid_t ptid, int err);
extern void linux_ptrace_init_warnings (void);
+extern void linux_ptrace_create_warnings (struct buffer *buffer);
extern void linux_check_ptrace_features (void);
extern void linux_enable_event_reporting (pid_t pid, int attached);
extern void linux_disable_event_reporting (pid_t pid);
extern int linux_supports_tracefork (void);
Index: gdb-7.8.90.20150125/gdb/configure.ac
Index: gdb-7.9.90.20150709/gdb/configure.ac
===================================================================
--- gdb-7.8.90.20150125.orig/gdb/configure.ac 2015-01-25 08:36:55.712884520 +0100
+++ gdb-7.8.90.20150125/gdb/configure.ac 2015-01-25 08:37:02.801915075 +0100
@@ -2117,6 +2117,10 @@ case $host_os in
--- gdb-7.9.90.20150709.orig/gdb/configure.ac 2015-07-09 18:24:13.707140401 +0200
+++ gdb-7.9.90.20150709/gdb/configure.ac 2015-07-09 18:24:24.913235990 +0200
@@ -2150,6 +2150,10 @@ case $host_os in
esac
AC_DEFINE_UNQUOTED(GDBINIT,"$gdbinit",[The .gdbinit filename.])
@ -111,11 +111,11 @@ Index: gdb-7.8.90.20150125/gdb/configure.ac
dnl Handle optional features that can be enabled.
# Support for --with-sysroot is a copy of GDB_AC_WITH_DIR,
Index: gdb-7.8.90.20150125/gdb/gdbserver/configure.ac
Index: gdb-7.9.90.20150709/gdb/gdbserver/configure.ac
===================================================================
--- gdb-7.8.90.20150125.orig/gdb/gdbserver/configure.ac 2015-01-25 08:36:55.712884520 +0100
+++ gdb-7.8.90.20150125/gdb/gdbserver/configure.ac 2015-01-25 08:37:02.801915075 +0100
@@ -461,6 +461,10 @@ if $want_ipa ; then
--- gdb-7.9.90.20150709.orig/gdb/gdbserver/configure.ac 2015-07-09 18:24:13.707140401 +0200
+++ gdb-7.9.90.20150709/gdb/gdbserver/configure.ac 2015-07-09 18:24:24.913235990 +0200
@@ -499,6 +499,10 @@ if $want_ipa ; then
fi
fi
@ -126,11 +126,11 @@ Index: gdb-7.8.90.20150125/gdb/gdbserver/configure.ac
AC_SUBST(GDBSERVER_DEPFILES)
AC_SUBST(GDBSERVER_LIBS)
AC_SUBST(srv_xmlbuiltin)
Index: gdb-7.8.90.20150125/gdb/gdbserver/linux-low.c
Index: gdb-7.9.90.20150709/gdb/gdbserver/linux-low.c
===================================================================
--- gdb-7.8.90.20150125.orig/gdb/gdbserver/linux-low.c 2015-01-25 08:36:55.714884529 +0100
+++ gdb-7.8.90.20150125/gdb/gdbserver/linux-low.c 2015-01-25 08:37:02.803915084 +0100
@@ -591,6 +591,29 @@ add_lwp (ptid_t ptid)
--- gdb-7.9.90.20150709.orig/gdb/gdbserver/linux-low.c 2015-07-09 18:24:13.709140418 +0200
+++ gdb-7.9.90.20150709/gdb/gdbserver/linux-low.c 2015-07-09 18:24:24.914235998 +0200
@@ -755,6 +755,29 @@ add_lwp (ptid_t ptid)
return lwp;
}
@ -160,7 +160,7 @@ Index: gdb-7.8.90.20150125/gdb/gdbserver/linux-low.c
/* Start an inferior process and returns its pid.
ALLARGS is a vector of program-name and args. */
@@ -632,7 +655,7 @@ linux_create_inferior (char *program, ch
@@ -778,7 +801,7 @@ linux_create_inferior (char *program, ch
if (pid == 0)
{
close_most_fds ();
@ -169,11 +169,11 @@ Index: gdb-7.8.90.20150125/gdb/gdbserver/linux-low.c
#ifndef __ANDROID__ /* Bionic doesn't use SIGRTMIN the way glibc does. */
signal (__SIGRTMIN + 1, SIG_DFL);
Index: gdb-7.8.90.20150125/gdb/inf-ptrace.c
Index: gdb-7.9.90.20150709/gdb/inf-ptrace.c
===================================================================
--- gdb-7.8.90.20150125.orig/gdb/inf-ptrace.c 2015-01-25 08:36:55.715884533 +0100
+++ gdb-7.8.90.20150125/gdb/inf-ptrace.c 2015-01-25 08:37:02.803915084 +0100
@@ -67,7 +67,15 @@ static void
--- gdb-7.9.90.20150709.orig/gdb/inf-ptrace.c 2015-07-09 18:24:13.710140426 +0200
+++ gdb-7.9.90.20150709/gdb/inf-ptrace.c 2015-07-09 18:24:24.915236007 +0200
@@ -79,7 +79,15 @@ static void
inf_ptrace_me (void)
{
/* "Trace me, Dr. Memory!" */
@ -189,36 +189,28 @@ Index: gdb-7.8.90.20150125/gdb/inf-ptrace.c
}
/* Start a new inferior Unix child process. EXEC_FILE is the file to
Index: gdb-7.8.90.20150125/gdb/linux-nat.c
Index: gdb-7.9.90.20150709/gdb/linux-nat.c
===================================================================
--- gdb-7.8.90.20150125.orig/gdb/linux-nat.c 2015-01-25 08:36:55.717884541 +0100
+++ gdb-7.8.90.20150125/gdb/linux-nat.c 2015-01-25 08:37:52.054127362 +0100
@@ -1109,6 +1109,7 @@ linux_nat_create_inferior (struct target
#ifdef HAVE_PERSONALITY
int personality_orig = 0, personality_set = 0;
#endif /* HAVE_PERSONALITY */
--- gdb-7.9.90.20150709.orig/gdb/linux-nat.c 2015-07-09 18:24:13.712140443 +0200
+++ gdb-7.9.90.20150709/gdb/linux-nat.c 2015-07-09 18:24:24.916236015 +0200
@@ -1184,6 +1184,7 @@ linux_nat_create_inferior (struct target
{
struct cleanup *restore_personality
= maybe_disable_address_space_randomization (disable_randomization);
+ volatile struct gdb_exception ex;
/* The fork_child mechanism is synchronous and calls target_wait, so
we have to mask the async mode. */
@@ -1133,7 +1134,10 @@ linux_nat_create_inferior (struct target
@@ -1191,7 +1192,28 @@ linux_nat_create_inferior (struct target
/* Make sure we report all signals during startup. */
linux_nat_pass_signals (ops, 0, NULL);
- linux_ops->to_create_inferior (ops, exec_file, allargs, env, from_tty);
+ TRY_CATCH (ex, RETURN_MASK_ERROR)
+ TRY
+ {
+ linux_ops->to_create_inferior (ops, exec_file, allargs, env, from_tty);
+ }
#ifdef HAVE_PERSONALITY
if (personality_set)
@@ -1145,6 +1149,24 @@ linux_nat_create_inferior (struct target
safe_strerror (errno));
}
#endif /* HAVE_PERSONALITY */
+
+ if (ex.reason < 0)
+ CATCH (ex, RETURN_MASK_ERROR)
+ {
+ struct buffer buffer;
+ char *message, *buffer_s;
@ -235,14 +227,15 @@ Index: gdb-7.8.90.20150125/gdb/linux-nat.c
+
+ throw_error (ex.error, "%s%s", buffer_s, message);
+ }
}
+ END_CATCH
/* Callback for linux_proc_attach_tgid_threads. Attach to PTID if not
Index: gdb-7.8.90.20150125/gdb/config.in
do_cleanups (restore_personality);
}
Index: gdb-7.9.90.20150709/gdb/config.in
===================================================================
--- gdb-7.8.90.20150125.orig/gdb/config.in 2015-01-25 08:36:55.718884546 +0100
+++ gdb-7.8.90.20150125/gdb/config.in 2015-01-25 08:37:02.805915092 +0100
@@ -213,6 +213,9 @@
--- gdb-7.9.90.20150709.orig/gdb/config.in 2015-07-09 18:24:13.713140452 +0200
+++ gdb-7.9.90.20150709/gdb/config.in 2015-07-09 18:24:24.916236015 +0200
@@ -264,6 +264,9 @@
/* Define if librpm library is being used. */
#undef HAVE_LIBRPM
@ -252,7 +245,7 @@ Index: gdb-7.8.90.20150125/gdb/config.in
/* Define to 1 if you have the <libunwind-ia64.h> header file. */
#undef HAVE_LIBUNWIND_IA64_H
@@ -342,6 +345,9 @@
@@ -396,6 +399,9 @@
/* Define to 1 if you have the `scm_new_smob' function. */
#undef HAVE_SCM_NEW_SMOB
@ -262,11 +255,11 @@ Index: gdb-7.8.90.20150125/gdb/config.in
/* Define to 1 if you have the `setlocale' function. */
#undef HAVE_SETLOCALE
Index: gdb-7.8.90.20150125/gdb/configure
Index: gdb-7.9.90.20150709/gdb/configure
===================================================================
--- gdb-7.8.90.20150125.orig/gdb/configure 2015-01-25 08:36:55.722884563 +0100
+++ gdb-7.8.90.20150125/gdb/configure 2015-01-25 08:37:02.809915110 +0100
@@ -13270,6 +13270,64 @@ cat >>confdefs.h <<_ACEOF
--- gdb-7.9.90.20150709.orig/gdb/configure 2015-07-09 18:24:13.718140495 +0200
+++ gdb-7.9.90.20150709/gdb/configure 2015-07-09 18:24:24.920236049 +0200
@@ -14228,6 +14228,64 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
@ -331,11 +324,11 @@ Index: gdb-7.8.90.20150125/gdb/configure
# Support for --with-sysroot is a copy of GDB_AC_WITH_DIR,
# except that the argument to --with-sysroot is optional.
Index: gdb-7.8.90.20150125/gdb/gdbserver/config.in
Index: gdb-7.9.90.20150709/gdb/gdbserver/config.in
===================================================================
--- gdb-7.8.90.20150125.orig/gdb/gdbserver/config.in 2015-01-25 08:36:55.724884572 +0100
+++ gdb-7.8.90.20150125/gdb/gdbserver/config.in 2015-01-25 08:37:02.809915110 +0100
@@ -75,6 +75,9 @@
--- gdb-7.9.90.20150709.orig/gdb/gdbserver/config.in 2015-07-09 18:24:13.719140503 +0200
+++ gdb-7.9.90.20150709/gdb/gdbserver/config.in 2015-07-09 18:24:24.920236049 +0200
@@ -113,6 +113,9 @@
/* Define to 1 if you have the `mcheck' library (-lmcheck). */
#undef HAVE_LIBMCHECK
@ -345,9 +338,9 @@ Index: gdb-7.8.90.20150125/gdb/gdbserver/config.in
/* Define if the target supports branch tracing. */
#undef HAVE_LINUX_BTRACE
@@ -142,6 +145,9 @@
/* Define to 1 if you have the `pwrite' function. */
#undef HAVE_PWRITE
@@ -189,6 +192,9 @@
/* Define to 1 if you have the `setns' function. */
#undef HAVE_SETNS
+/* Define to 1 if you have the <selinux/selinux.h> header file. */
+#undef HAVE_SELINUX_SELINUX_H
@ -355,11 +348,11 @@ Index: gdb-7.8.90.20150125/gdb/gdbserver/config.in
/* Define to 1 if you have the <sgtty.h> header file. */
#undef HAVE_SGTTY_H
Index: gdb-7.8.90.20150125/gdb/gdbserver/configure
Index: gdb-7.9.90.20150709/gdb/gdbserver/configure
===================================================================
--- gdb-7.8.90.20150125.orig/gdb/gdbserver/configure 2015-01-25 08:36:55.726884580 +0100
+++ gdb-7.8.90.20150125/gdb/gdbserver/configure 2015-01-25 08:37:02.811915118 +0100
@@ -6199,6 +6199,64 @@ if $want_ipa ; then
--- gdb-7.9.90.20150709.orig/gdb/gdbserver/configure 2015-07-09 18:24:13.721140520 +0200
+++ gdb-7.9.90.20150709/gdb/gdbserver/configure 2015-07-09 18:24:24.922236066 +0200
@@ -7022,6 +7022,64 @@ if $want_ipa ; then
fi
fi

View File

@ -3,19 +3,19 @@ printed, but a default backtrace will occur in this case.
--
Index: gdb-7.8.90.20150214/gdb/python/py-framefilter.c
Index: gdb-7.9.50.20150520/gdb/python/py-framefilter.c
===================================================================
--- gdb-7.8.90.20150214.orig/gdb/python/py-framefilter.c 2015-02-14 17:35:12.277653200 +0100
+++ gdb-7.8.90.20150214/gdb/python/py-framefilter.c 2015-02-14 17:36:15.737953789 +0100
@@ -1506,6 +1506,7 @@ gdbpy_apply_frame_filter (const struct e
volatile struct gdb_exception except;
--- gdb-7.9.50.20150520.orig/gdb/python/py-framefilter.c 2015-05-31 17:36:34.681952530 +0200
+++ gdb-7.9.50.20150520/gdb/python/py-framefilter.c 2015-05-31 17:55:01.884788031 +0200
@@ -1523,6 +1523,7 @@ gdbpy_apply_frame_filter (const struct e
PyObject *iterable;
PyObject *item;
htab_t levels_printed;
+ int count_printed = 0;
if (!gdb_python_initialized)
return EXT_LANG_BT_NO_FILTERS;
@@ -1525,24 +1526,7 @@ gdbpy_apply_frame_filter (const struct e
@@ -1543,24 +1544,7 @@ gdbpy_apply_frame_filter (const struct e
iterable = bootstrap_python_frame_filters (frame, frame_low, frame_high);
if (iterable == NULL)
@ -41,7 +41,7 @@ Index: gdb-7.8.90.20150214/gdb/python/py-framefilter.c
/* If iterable is None, then there are no frame filters registered.
If this is the case, defer to default GDB printing routines in MI
@@ -1573,15 +1557,40 @@ gdbpy_apply_frame_filter (const struct e
@@ -1591,15 +1575,40 @@ gdbpy_apply_frame_filter (const struct e
error and continue with other frames. */
if (success == EXT_LANG_BT_ERROR)
gdbpy_print_stack ();

View File

@ -1,20 +1,20 @@
Index: gdb-7.8.50.20141228/gdb/config/i386/linux64.mh
Index: gdb-7.9.90.20150709/gdb/config/i386/linux64.mh
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/config/i386/linux64.mh 2015-01-01 17:12:53.965472227 +0100
+++ gdb-7.8.50.20141228/gdb/config/i386/linux64.mh 2015-01-01 17:12:55.367471414 +0100
@@ -6,7 +6,7 @@ NATDEPFILES= inf-ptrace.o fork-child.o \
proc-service.o linux-thread-db.o linux-fork.o \
--- gdb-7.9.90.20150709.orig/gdb/config/i386/linux64.mh 2015-07-09 18:23:32.173786118 +0200
+++ gdb-7.9.90.20150709/gdb/config/i386/linux64.mh 2015-07-09 18:23:51.823953736 +0200
@@ -7,7 +7,7 @@ NATDEPFILES= inf-ptrace.o fork-child.o \
linux-procfs.o linux-ptrace.o linux-btrace.o \
linux-waitpid.o
linux-waitpid.o linux-personality.o x86-linux.o \
x86-linux-dregs.o linux-namespaces.o
-NAT_FILE= config/nm-linux.h
+NAT_FILE= nm-linux64.h
NAT_CDEPS = $(srcdir)/proc-service.list
# The dynamically loaded libthread_db needs access to symbols in the
Index: gdb-7.8.50.20141228/gdb/config/i386/linux.mh
Index: gdb-7.9.90.20150709/gdb/config/i386/linux.mh
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/config/i386/linux.mh 2015-01-01 17:12:55.367471414 +0100
+++ gdb-7.8.50.20141228/gdb/config/i386/linux.mh 2015-01-01 17:13:07.568464342 +0100
--- gdb-7.9.90.20150709.orig/gdb/config/i386/linux.mh 2015-07-09 18:23:30.527772078 +0200
+++ gdb-7.9.90.20150709/gdb/config/i386/linux.mh 2015-07-09 18:23:32.174786127 +0200
@@ -1,6 +1,6 @@
# Host: Intel 386 running GNU/Linux.
@ -23,10 +23,10 @@ Index: gdb-7.8.50.20141228/gdb/config/i386/linux.mh
NATDEPFILES= inf-ptrace.o fork-child.o \
x86-nat.o x86-dregs.o i386-linux-nat.o x86-linux-nat.o \
proc-service.o linux-thread-db.o \
Index: gdb-7.8.50.20141228/gdb/config/i386/nm-linux.h
Index: gdb-7.9.90.20150709/gdb/config/i386/nm-linux.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.50.20141228/gdb/config/i386/nm-linux.h 2015-01-01 17:12:55.368471414 +0100
+++ gdb-7.9.90.20150709/gdb/config/i386/nm-linux.h 2015-07-09 18:23:32.174786127 +0200
@@ -0,0 +1,28 @@
+/* Native support for GNU/Linux i386.
+
@ -56,10 +56,10 @@ Index: gdb-7.8.50.20141228/gdb/config/i386/nm-linux.h
+#define target_can_use_hardware_watchpoint(type, cnt, ot) 1
+
+#endif /* NM_LINUX64_H */
Index: gdb-7.8.50.20141228/gdb/config/i386/nm-linux64.h
Index: gdb-7.9.90.20150709/gdb/config/i386/nm-linux64.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.50.20141228/gdb/config/i386/nm-linux64.h 2015-01-01 17:12:55.368471414 +0100
+++ gdb-7.9.90.20150709/gdb/config/i386/nm-linux64.h 2015-07-09 18:23:32.174786127 +0200
@@ -0,0 +1,28 @@
+/* Native support for GNU/Linux amd64.
+
@ -89,26 +89,26 @@ Index: gdb-7.8.50.20141228/gdb/config/i386/nm-linux64.h
+#define target_can_use_hardware_watchpoint(type, cnt, ot) 1
+
+#endif /* NM_LINUX64_H */
Index: gdb-7.8.50.20141228/gdb/target.h
Index: gdb-7.9.90.20150709/gdb/target.h
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/target.h 2015-01-01 17:12:53.967472226 +0100
+++ gdb-7.8.50.20141228/gdb/target.h 2015-01-01 17:12:55.368471414 +0100
@@ -1754,9 +1754,11 @@ extern char *target_thread_name (struct
bp_hardware_breakpoint. CNT is the number of such watchpoints used so far
(including this one?). OTHERTYPE is who knows what... */
--- gdb-7.9.90.20150709.orig/gdb/target.h 2015-07-09 18:23:30.528772086 +0200
+++ gdb-7.9.90.20150709/gdb/target.h 2015-07-09 18:23:32.175786135 +0200
@@ -1849,9 +1849,11 @@ extern char *target_thread_name (struct
CNT is the number of such watchpoints used so far, including this
one. OTHERTYPE is who knows what... */
+#ifndef target_can_use_hardware_watchpoint
#define target_can_use_hardware_watchpoint(TYPE,CNT,OTHERTYPE) \
(*current_target.to_can_use_hw_breakpoint) (&current_target, \
TYPE, CNT, OTHERTYPE);
TYPE, CNT, OTHERTYPE)
+#endif
/* Returns the number of debug registers needed to watch the given
memory region, or zero if not supported. */
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp
Index: gdb-7.9.90.20150709/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp 2015-01-01 17:12:55.369471413 +0100
+++ gdb-7.9.90.20150709/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp 2015-07-09 18:23:32.175786135 +0200
@@ -0,0 +1,40 @@
+# Copyright 2009, 2010 Free Software Foundation, Inc.
+

View File

@ -1,9 +1,9 @@
https://bugzilla.redhat.com/show_bug.cgi?id=1020004
Index: gdb-7.8.50.20141228/gdb/data-directory/Makefile.in
Index: gdb-7.9.50.20150520/gdb/data-directory/Makefile.in
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/data-directory/Makefile.in 2015-01-05 22:51:10.707756810 +0100
+++ gdb-7.8.50.20141228/gdb/data-directory/Makefile.in 2015-01-05 22:51:48.608923139 +0100
--- gdb-7.9.50.20150520.orig/gdb/data-directory/Makefile.in 2015-05-31 18:05:43.046746351 +0200
+++ gdb-7.9.50.20150520/gdb/data-directory/Makefile.in 2015-05-31 18:05:58.483841655 +0200
@@ -60,6 +60,8 @@ PYTHON_FILE_LIST = \
gdb/frames.py \
gdb/FrameIterator.py \
@ -12,8 +12,8 @@ Index: gdb-7.8.50.20141228/gdb/data-directory/Makefile.in
+ gdb/backtrace.py \
gdb/types.py \
gdb/printing.py \
gdb/prompt.py \
@@ -74,6 +76,7 @@ PYTHON_FILE_LIST = \
gdb/unwinder.py \
@@ -76,6 +78,7 @@ PYTHON_FILE_LIST = \
gdb/command/pretty_printers.py \
gdb/command/prompt.py \
gdb/command/explore.py \
@ -21,10 +21,10 @@ Index: gdb-7.8.50.20141228/gdb/data-directory/Makefile.in
gdb/function/__init__.py \
gdb/function/caller_is.py \
gdb/function/strfns.py \
Index: gdb-7.8.50.20141228/gdb/python/lib/gdb/FrameWrapper.py
Index: gdb-7.9.50.20150520/gdb/python/lib/gdb/FrameWrapper.py
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.50.20141228/gdb/python/lib/gdb/FrameWrapper.py 2015-01-05 22:51:24.706818245 +0100
+++ gdb-7.9.50.20150520/gdb/python/lib/gdb/FrameWrapper.py 2015-05-31 18:05:58.484841661 +0200
@@ -0,0 +1,122 @@
+# Wrapper API for frames.
+
@ -148,10 +148,10 @@ Index: gdb-7.8.50.20141228/gdb/python/lib/gdb/FrameWrapper.py
+
+ def __getattr__ (self, name):
+ return getattr (self.frame, name)
Index: gdb-7.8.50.20141228/gdb/python/lib/gdb/backtrace.py
Index: gdb-7.9.50.20150520/gdb/python/lib/gdb/backtrace.py
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.50.20141228/gdb/python/lib/gdb/backtrace.py 2015-01-05 22:51:24.706818245 +0100
+++ gdb-7.9.50.20150520/gdb/python/lib/gdb/backtrace.py 2015-05-31 18:05:58.484841661 +0200
@@ -0,0 +1,42 @@
+# Filtering backtrace.
+
@ -195,10 +195,10 @@ Index: gdb-7.8.50.20141228/gdb/python/lib/gdb/backtrace.py
+ return iter
+ return old_frame_filter (iter)
+
Index: gdb-7.8.50.20141228/gdb/python/lib/gdb/command/backtrace.py
Index: gdb-7.9.50.20150520/gdb/python/lib/gdb/command/backtrace.py
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.50.20141228/gdb/python/lib/gdb/command/backtrace.py 2015-01-05 22:51:24.707818249 +0100
+++ gdb-7.9.50.20150520/gdb/python/lib/gdb/command/backtrace.py 2015-05-31 18:05:58.484841661 +0200
@@ -0,0 +1,106 @@
+# New backtrace command.
+

View File

@ -1,85 +0,0 @@
http://sourceware.org/ml/gdb-patches/2013-06/msg00788.html
Subject: [PATCH] "enable count" user input error handling (PR gdb/15678)
Typing "enable count" by itself crashes GDB. Also, if you omit the
breakpoint number/range, the error message is not very clear:
(gdb) enable count 2
warning: bad breakpoint number at or near ''
(gdb) enable count
Segmentation fault (core dumped)
With this patch, the error messages are slightly more helpful:
(gdb) enable count 2
Argument required (one or more breakpoint numbers).
(gdb) enable count
Argument required (hit count).
They are not as helpful to the user as I would like, but it's better
than crashing. Suggestions are welcome.
Simon
gdb/ChangeLog:
2013-06-26 Simon Marchi <simon.marchi@ericsson.com>
* breakpoint.c (map_breakpoint_numbers): Check for empty args
string.
(enable_count_command): Check args for NULL value.
gdb/testsuite/ChangeLog:
2013-06-26 Simon Marchi <simon.marchi@ericsson.com>
* gdb.base/ena-dis-br.exp: Test "enable count" for bad user input.
---
gdb/breakpoint.c | 9 +++++++--
gdb/testsuite/gdb.base/ena-dis-br.exp | 8 ++++++++
2 files changed, 15 insertions(+), 2 deletions(-)
Index: gdb-7.8.50.20141228/gdb/breakpoint.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/breakpoint.c 2015-01-05 22:21:47.631801558 +0100
+++ gdb-7.8.50.20141228/gdb/breakpoint.c 2015-01-05 22:26:13.165005049 +0100
@@ -14849,7 +14849,7 @@ map_breakpoint_numbers (char *args, void
int match;
struct get_number_or_range_state state;
- if (args == 0)
+ if (args == 0 || *args == '\0')
error_no_arg (_("one or more breakpoint numbers"));
init_number_or_range (&state, args);
@@ -15186,7 +15186,12 @@ do_map_enable_count_breakpoint (struct b
static void
enable_count_command (char *args, int from_tty)
{
- int count = get_number (&args);
+ int count;
+
+ if (args == NULL)
+ error_no_arg (_("hit count"));
+
+ count = get_number (&args);
map_breakpoint_numbers (args, do_map_enable_count_breakpoint, &count);
}
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.base/ena-dis-br.exp
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/testsuite/gdb.base/ena-dis-br.exp 2015-01-05 22:26:13.165005049 +0100
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.base/ena-dis-br.exp 2015-01-05 22:26:51.357178150 +0100
@@ -151,6 +151,14 @@ set bp [break_at $bp_location7 "line $bp
set bp2 [break_at marker1 " line $bp_location15"]
+gdb_test "enable count" \
+ "Argument required \\(hit count\\)\\." \
+ "enable count missing arguments"
+
+gdb_test "enable count 2" \
+ "Argument required \\(one or more breakpoint numbers\\)\\." \
+ "enable count missing last argument"
+
gdb_test_no_output "enable count 2 $bp" "disable break with count"
gdb_test "continue" \

View File

@ -11,11 +11,13 @@ gdb/
Work around PR libc/13097.
* solib.c (update_solib_list): Ignore "linux-vdso.so.1".
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -783,8 +783,11 @@ update_solib_list (int from_tty, struct target_ops *target)
Index: gdb-7.9.50.20150520/gdb/solib.c
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/solib.c 2015-05-31 17:04:16.870802493 +0200
+++ gdb-7.9.50.20150520/gdb/solib.c 2015-05-31 17:04:38.824941054 +0200
@@ -893,8 +893,11 @@ update_solib_list (int from_tty, struct
TRY_CATCH (e, RETURN_MASK_ERROR)
TRY
{
- /* Fill in the rest of the `struct so_list' node. */
- if (!solib_map_sections (i))
@ -27,4 +29,3 @@ gdb/
{
not_found++;
if (not_found_filename == NULL)

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1877172a7efbf7540290471e64816c9549b24a65e825f0e1a725ac950b4e5029
size 11744

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c620865e7c00c9c2e644fa693a11170bbf2fec83c078c597e61606c38d2e2562
size 19254

View File

@ -1,589 +0,0 @@
diff -dup -ruNp gdb-7.8.90.20150202-orig/gdb/testsuite/dg-extract-results.py gdb-7.8.90.20150202/gdb/testsuite/dg-extract-results.py
--- gdb-7.8.90.20150202-orig/gdb/testsuite/dg-extract-results.py 2015-02-02 02:58:29.000000000 +0100
+++ gdb-7.8.90.20150202/gdb/testsuite/dg-extract-results.py 1970-01-01 01:00:00.000000000 +0100
@@ -1,585 +0,0 @@
-#!/usr/bin/python
-#
-# Copyright (C) 2014-2015 Free Software Foundation, Inc.
-#
-# This script 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, or (at your option)
-# any later version.
-
-import sys
-import getopt
-import re
-import io
-from datetime import datetime
-from operator import attrgetter
-
-# True if unrecognised lines should cause a fatal error. Might want to turn
-# this on by default later.
-strict = False
-
-# True if the order of .log segments should match the .sum file, false if
-# they should keep the original order.
-sort_logs = True
-
-# A version of open() that is safe against whatever binary output
-# might be added to the log.
-def safe_open (filename):
- if sys.version_info >= (3, 0):
- return open (filename, 'r', errors = 'surrogateescape')
- return open (filename, 'r')
-
-# Force stdout to handle escape sequences from a safe_open file.
-if sys.version_info >= (3, 0):
- sys.stdout = io.TextIOWrapper (sys.stdout.buffer,
- errors = 'surrogateescape')
-
-class Named:
- def __init__ (self, name):
- self.name = name
-
-class ToolRun (Named):
- def __init__ (self, name):
- Named.__init__ (self, name)
- # The variations run for this tool, mapped by --target_board name.
- self.variations = dict()
-
- # Return the VariationRun for variation NAME.
- def get_variation (self, name):
- if name not in self.variations:
- self.variations[name] = VariationRun (name)
- return self.variations[name]
-
-class VariationRun (Named):
- def __init__ (self, name):
- Named.__init__ (self, name)
- # A segment of text before the harness runs start, describing which
- # baseboard files were loaded for the target.
- self.header = None
- # The harnesses run for this variation, mapped by filename.
- self.harnesses = dict()
- # A list giving the number of times each type of result has
- # been seen.
- self.counts = []
-
- # Return the HarnessRun for harness NAME.
- def get_harness (self, name):
- if name not in self.harnesses:
- self.harnesses[name] = HarnessRun (name)
- return self.harnesses[name]
-
-class HarnessRun (Named):
- def __init__ (self, name):
- Named.__init__ (self, name)
- # Segments of text that make up the harness run, mapped by a test-based
- # key that can be used to order them.
- self.segments = dict()
- # Segments of text that make up the harness run but which have
- # no recognized test results. These are typically harnesses that
- # are completely skipped for the target.
- self.empty = []
- # A list of results. Each entry is a pair in which the first element
- # is a unique sorting key and in which the second is the full
- # PASS/FAIL line.
- self.results = []
-
- # Add a segment of text to the harness run. If the segment includes
- # test results, KEY is an example of one of them, and can be used to
- # combine the individual segments in order. If the segment has no
- # test results (e.g. because the harness doesn't do anything for the
- # current configuration) then KEY is None instead. In that case
- # just collect the segments in the order that we see them.
- def add_segment (self, key, segment):
- if key:
- assert key not in self.segments
- self.segments[key] = segment
- else:
- self.empty.append (segment)
-
-class Segment:
- def __init__ (self, filename, start):
- self.filename = filename
- self.start = start
- self.lines = 0
-
-class Prog:
- def __init__ (self):
- # The variations specified on the command line.
- self.variations = []
- # The variations seen in the input files.
- self.known_variations = set()
- # The tools specified on the command line.
- self.tools = []
- # Whether to create .sum rather than .log output.
- self.do_sum = True
- # Regexps used while parsing.
- self.test_run_re = re.compile (r'^Test Run By (\S+) on (.*)$')
- self.tool_re = re.compile (r'^\t\t=== (.*) tests ===$')
- self.result_re = re.compile (r'^(PASS|XPASS|FAIL|XFAIL|UNRESOLVED'
- r'|WARNING|ERROR|UNSUPPORTED|UNTESTED'
- r'|KFAIL):\s*(.+)')
- self.completed_re = re.compile (r'.* completed at (.*)')
- # Pieces of text to write at the head of the output.
- # start_line is a pair in which the first element is a datetime
- # and in which the second is the associated 'Test Run By' line.
- self.start_line = None
- self.native_line = ''
- self.target_line = ''
- self.host_line = ''
- self.acats_premable = ''
- # Pieces of text to write at the end of the output.
- # end_line is like start_line but for the 'runtest completed' line.
- self.acats_failures = []
- self.version_output = ''
- self.end_line = None
- # Known summary types.
- self.count_names = [
- '# of expected passes\t\t',
- '# of unexpected failures\t',
- '# of unexpected successes\t',
- '# of expected failures\t\t',
- '# of unknown successes\t\t',
- '# of known failures\t\t',
- '# of untested testcases\t\t',
- '# of unresolved testcases\t',
- '# of unsupported tests\t\t'
- ]
- self.runs = dict()
-
- def usage (self):
- name = sys.argv[0]
- sys.stderr.write ('Usage: ' + name
- + ''' [-t tool] [-l variant-list] [-L] log-or-sum-file ...
-
- tool The tool (e.g. g++, libffi) for which to create a
- new test summary file. If not specified then output
- is created for all tools.
- variant-list One or more test variant names. If the list is
- not specified then one is constructed from all
- variants in the files for <tool>.
- sum-file A test summary file with the format of those
- created by runtest from DejaGnu.
- If -L is used, merge *.log files instead of *.sum. In this
- mode the exact order of lines may not be preserved, just different
- Running *.exp chunks should be in correct order.
-''')
- sys.exit (1)
-
- def fatal (self, what, string):
- if not what:
- what = sys.argv[0]
- sys.stderr.write (what + ': ' + string + '\n')
- sys.exit (1)
-
- # Parse the command-line arguments.
- def parse_cmdline (self):
- try:
- (options, self.files) = getopt.getopt (sys.argv[1:], 'l:t:L')
- if len (self.files) == 0:
- self.usage()
- for (option, value) in options:
- if option == '-l':
- self.variations.append (value)
- elif option == '-t':
- self.tools.append (value)
- else:
- self.do_sum = False
- except getopt.GetoptError as e:
- self.fatal (None, e.msg)
-
- # Try to parse time string TIME, returning an arbitrary time on failure.
- # Getting this right is just a nice-to-have so failures should be silent.
- def parse_time (self, time):
- try:
- return datetime.strptime (time, '%c')
- except ValueError:
- return datetime.now()
-
- # Parse an integer and abort on failure.
- def parse_int (self, filename, value):
- try:
- return int (value)
- except ValueError:
- self.fatal (filename, 'expected an integer, got: ' + value)
-
- # Return a list that represents no test results.
- def zero_counts (self):
- return [0 for x in self.count_names]
-
- # Return the ToolRun for tool NAME.
- def get_tool (self, name):
- if name not in self.runs:
- self.runs[name] = ToolRun (name)
- return self.runs[name]
-
- # Add the result counts in list FROMC to TOC.
- def accumulate_counts (self, toc, fromc):
- for i in range (len (self.count_names)):
- toc[i] += fromc[i]
-
- # Parse the list of variations after 'Schedule of variations:'.
- # Return the number seen.
- def parse_variations (self, filename, file):
- num_variations = 0
- while True:
- line = file.readline()
- if line == '':
- self.fatal (filename, 'could not parse variation list')
- if line == '\n':
- break
- self.known_variations.add (line.strip())
- num_variations += 1
- return num_variations
-
- # Parse from the first line after 'Running target ...' to the end
- # of the run's summary.
- def parse_run (self, filename, file, tool, variation, num_variations):
- header = None
- harness = None
- segment = None
- final_using = 0
-
- # If this is the first run for this variation, add any text before
- # the first harness to the header.
- if not variation.header:
- segment = Segment (filename, file.tell())
- variation.header = segment
-
- # Parse up until the first line of the summary.
- if num_variations == 1:
- end = '\t\t=== ' + tool.name + ' Summary ===\n'
- else:
- end = ('\t\t=== ' + tool.name + ' Summary for '
- + variation.name + ' ===\n')
- while True:
- line = file.readline()
- if line == '':
- self.fatal (filename, 'no recognised summary line')
- if line == end:
- break
-
- # Look for the start of a new harness.
- if line.startswith ('Running ') and line.endswith (' ...\n'):
- # Close off the current harness segment, if any.
- if harness:
- segment.lines -= final_using
- harness.add_segment (first_key, segment)
- name = line[len ('Running '):-len(' ...\n')]
- harness = variation.get_harness (name)
- segment = Segment (filename, file.tell())
- first_key = None
- final_using = 0
- continue
-
- # Record test results. Associate the first test result with
- # the harness segment, so that if a run for a particular harness
- # has been split up, we can reassemble the individual segments
- # in a sensible order.
- #
- # dejagnu sometimes issues warnings about the testing environment
- # before running any tests. Treat them as part of the header
- # rather than as a test result.
- match = self.result_re.match (line)
- if match and (harness or not line.startswith ('WARNING:')):
- if not harness:
- self.fatal (filename, 'saw test result before harness name')
- name = match.group (2)
- # Ugly hack to get the right order for gfortran.
- if name.startswith ('gfortran.dg/g77/'):
- name = 'h' + name
- key = (name, len (harness.results))
- harness.results.append ((key, line))
- if not first_key and sort_logs:
- first_key = key
-
- # 'Using ...' lines are only interesting in a header. Splitting
- # the test up into parallel runs leads to more 'Using ...' lines
- # than there would be in a single log.
- if line.startswith ('Using '):
- final_using += 1
- else:
- final_using = 0
-
- # Add other text to the current segment, if any.
- if segment:
- segment.lines += 1
-
- # Close off the final harness segment, if any.
- if harness:
- segment.lines -= final_using
- harness.add_segment (first_key, segment)
-
- # Parse the rest of the summary (the '# of ' lines).
- if len (variation.counts) == 0:
- variation.counts = self.zero_counts()
- while True:
- before = file.tell()
- line = file.readline()
- if line == '':
- break
- if line == '\n':
- continue
- if not line.startswith ('# '):
- file.seek (before)
- break
- found = False
- for i in range (len (self.count_names)):
- if line.startswith (self.count_names[i]):
- count = line[len (self.count_names[i]):-1].strip()
- variation.counts[i] += self.parse_int (filename, count)
- found = True
- break
- if not found:
- self.fatal (filename, 'unknown test result: ' + line[:-1])
-
- # Parse an acats run, which uses a different format from dejagnu.
- # We have just skipped over '=== acats configuration ==='.
- def parse_acats_run (self, filename, file):
- # Parse the preamble, which describes the configuration and logs
- # the creation of support files.
- record = (self.acats_premable == '')
- if record:
- self.acats_premable = '\t\t=== acats configuration ===\n'
- while True:
- line = file.readline()
- if line == '':
- self.fatal (filename, 'could not parse acats preamble')
- if line == '\t\t=== acats tests ===\n':
- break
- if record:
- self.acats_premable += line
-
- # Parse the test results themselves, using a dummy variation name.
- tool = self.get_tool ('acats')
- variation = tool.get_variation ('none')
- self.parse_run (filename, file, tool, variation, 1)
-
- # Parse the failure list.
- while True:
- before = file.tell()
- line = file.readline()
- if line.startswith ('*** FAILURES: '):
- self.acats_failures.append (line[len ('*** FAILURES: '):-1])
- continue
- file.seek (before)
- break
-
- # Parse the final summary at the end of a log in order to capture
- # the version output that follows it.
- def parse_final_summary (self, filename, file):
- record = (self.version_output == '')
- while True:
- line = file.readline()
- if line == '':
- break
- if line.startswith ('# of '):
- continue
- if record:
- self.version_output += line
- if line == '\n':
- break
-
- # Parse a .log or .sum file.
- def parse_file (self, filename, file):
- tool = None
- target = None
- num_variations = 1
- while True:
- line = file.readline()
- if line == '':
- return
-
- # Parse the list of variations, which comes before the test
- # runs themselves.
- if line.startswith ('Schedule of variations:'):
- num_variations = self.parse_variations (filename, file)
- continue
-
- # Parse a testsuite run for one tool/variation combination.
- if line.startswith ('Running target '):
- name = line[len ('Running target '):-1]
- if not tool:
- self.fatal (filename, 'could not parse tool name')
- if name not in self.known_variations:
- self.fatal (filename, 'unknown target: ' + name)
- self.parse_run (filename, file, tool,
- tool.get_variation (name),
- num_variations)
- # If there is only one variation then there is no separate
- # summary for it. Record any following version output.
- if num_variations == 1:
- self.parse_final_summary (filename, file)
- continue
-
- # Parse the start line. In the case where several files are being
- # parsed, pick the one with the earliest time.
- match = self.test_run_re.match (line)
- if match:
- time = self.parse_time (match.group (2))
- if not self.start_line or self.start_line[0] > time:
- self.start_line = (time, line)
- continue
-
- # Parse the form used for native testing.
- if line.startswith ('Native configuration is '):
- self.native_line = line
- continue
-
- # Parse the target triplet.
- if line.startswith ('Target is '):
- self.target_line = line
- continue
-
- # Parse the host triplet.
- if line.startswith ('Host is '):
- self.host_line = line
- continue
-
- # Parse the acats premable.
- if line == '\t\t=== acats configuration ===\n':
- self.parse_acats_run (filename, file)
- continue
-
- # Parse the tool name.
- match = self.tool_re.match (line)
- if match:
- tool = self.get_tool (match.group (1))
- continue
-
- # Skip over the final summary (which we instead create from
- # individual runs) and parse the version output.
- if tool and line == '\t\t=== ' + tool.name + ' Summary ===\n':
- if file.readline() != '\n':
- self.fatal (filename, 'expected blank line after summary')
- self.parse_final_summary (filename, file)
- continue
-
- # Parse the completion line. In the case where several files
- # are being parsed, pick the one with the latest time.
- match = self.completed_re.match (line)
- if match:
- time = self.parse_time (match.group (1))
- if not self.end_line or self.end_line[0] < time:
- self.end_line = (time, line)
- continue
-
- # Sanity check to make sure that important text doesn't get
- # dropped accidentally.
- if strict and line.strip() != '':
- self.fatal (filename, 'unrecognised line: ' + line[:-1])
-
- # Output a segment of text.
- def output_segment (self, segment):
- with safe_open (segment.filename) as file:
- file.seek (segment.start)
- for i in range (segment.lines):
- sys.stdout.write (file.readline())
-
- # Output a summary giving the number of times each type of result has
- # been seen.
- def output_summary (self, tool, counts):
- for i in range (len (self.count_names)):
- name = self.count_names[i]
- # dejagnu only prints result types that were seen at least once,
- # but acats always prints a number of unexpected failures.
- if (counts[i] > 0
- or (tool.name == 'acats'
- and name.startswith ('# of unexpected failures'))):
- sys.stdout.write ('%s%d\n' % (name, counts[i]))
-
- # Output unified .log or .sum information for a particular variation,
- # with a summary at the end.
- def output_variation (self, tool, variation):
- self.output_segment (variation.header)
- for harness in sorted (variation.harnesses.values(),
- key = attrgetter ('name')):
- sys.stdout.write ('Running ' + harness.name + ' ...\n')
- if self.do_sum:
- harness.results.sort()
- for (key, line) in harness.results:
- sys.stdout.write (line)
- else:
- # Rearrange the log segments into test order (but without
- # rearranging text within those segments).
- for key in sorted (harness.segments.keys()):
- self.output_segment (harness.segments[key])
- for segment in harness.empty:
- self.output_segment (segment)
- if len (self.variations) > 1:
- sys.stdout.write ('\t\t=== ' + tool.name + ' Summary for '
- + variation.name + ' ===\n\n')
- self.output_summary (tool, variation.counts)
-
- # Output unified .log or .sum information for a particular tool,
- # with a summary at the end.
- def output_tool (self, tool):
- counts = self.zero_counts()
- if tool.name == 'acats':
- # acats doesn't use variations, so just output everything.
- # It also has a different approach to whitespace.
- sys.stdout.write ('\t\t=== ' + tool.name + ' tests ===\n')
- for variation in tool.variations.values():
- self.output_variation (tool, variation)
- self.accumulate_counts (counts, variation.counts)
- sys.stdout.write ('\t\t=== ' + tool.name + ' Summary ===\n')
- else:
- # Output the results in the usual dejagnu runtest format.
- sys.stdout.write ('\n\t\t=== ' + tool.name + ' tests ===\n\n'
- 'Schedule of variations:\n')
- for name in self.variations:
- if name in tool.variations:
- sys.stdout.write (' ' + name + '\n')
- sys.stdout.write ('\n')
- for name in self.variations:
- if name in tool.variations:
- variation = tool.variations[name]
- sys.stdout.write ('Running target '
- + variation.name + '\n')
- self.output_variation (tool, variation)
- self.accumulate_counts (counts, variation.counts)
- sys.stdout.write ('\n\t\t=== ' + tool.name + ' Summary ===\n\n')
- self.output_summary (tool, counts)
-
- def main (self):
- self.parse_cmdline()
- try:
- # Parse the input files.
- for filename in self.files:
- with safe_open (filename) as file:
- self.parse_file (filename, file)
-
- # Decide what to output.
- if len (self.variations) == 0:
- self.variations = sorted (self.known_variations)
- else:
- for name in self.variations:
- if name not in self.known_variations:
- self.fatal (None, 'no results for ' + name)
- if len (self.tools) == 0:
- self.tools = sorted (self.runs.keys())
-
- # Output the header.
- if self.start_line:
- sys.stdout.write (self.start_line[1])
- sys.stdout.write (self.native_line)
- sys.stdout.write (self.target_line)
- sys.stdout.write (self.host_line)
- sys.stdout.write (self.acats_premable)
-
- # Output the main body.
- for name in self.tools:
- if name not in self.runs:
- self.fatal (None, 'no results for ' + name)
- self.output_tool (self.runs[name])
-
- # Output the footer.
- if len (self.acats_failures) > 0:
- sys.stdout.write ('*** FAILURES: '
- + ' '.join (self.acats_failures) + '\n')
- sys.stdout.write (self.version_output)
- if self.end_line:
- sys.stdout.write (self.end_line[1])
- except IOError as e:
- self.fatal (e.filename, e.strerror)
-
-Prog().main()

36
gdb-pahole-python2.patch Normal file
View File

@ -0,0 +1,36 @@
diff --git a/gdb/python/lib/gdb/command/pahole.py b/gdb/python/lib/gdb/command/pahole.py
index e08eaf5..56c1737 100644
--- a/gdb/python/lib/gdb/command/pahole.py
+++ b/gdb/python/lib/gdb/command/pahole.py
@@ -55,19 +55,19 @@ It prints the type and displays comments showing where holes are."""
fieldsize = 8 * ftype.sizeof
# TARGET_CHAR_BIT
- print (' /* %3d %3d */' % (int (bitpos / 8), int (fieldsize / 8)), end = "")
+ print (' /* %3d %3d */' % (int (bitpos / 8), int (fieldsize / 8))),
bitpos = bitpos + fieldsize
if ftype.code == gdb.TYPE_CODE_STRUCT:
self.pahole (ftype, level + 1, field.name)
else:
- print (' ' * (2 + 2 * level), end = "")
+ print (' ' * (2 + 2 * level)),
print ('%s %s' % (str (ftype), field.name))
if level == 0:
self.maybe_print_hole(bitpos, 8 * type.sizeof)
- print (' ' * (14 + 2 * level), end = "")
+ print (' ' * (14 + 2 * level)),
print ('} %s' % name)
def invoke (self, arg, from_tty):
@@ -75,7 +75,7 @@ It prints the type and displays comments showing where holes are."""
type = type.strip_typedefs ()
if type.code != gdb.TYPE_CODE_STRUCT:
raise (TypeError, '%s is not a struct type' % arg)
- print (' ' * 14, end = "")
+ print (' ' * 14),
self.pahole (type, 0, '')
Pahole()

View File

@ -0,0 +1,193 @@
From f469e8ce11672e26feb5ba6f9a134275fcfd5b4f Mon Sep 17 00:00:00 2001
From: Sergio Durigan Junior <sergiodj@redhat.com>
Date: Fri, 21 Aug 2015 18:13:46 -0400
Subject: [PATCH 1/4] Improve error reporting when handling SystemTap SDT
probes
This patch improves the error reporting when handling SystemTap SDT
probes. "Handling", in this case, mostly means "parsing".
On gdb/probe.h, only trivial changes on functions' comments in order
to explicitly mention that some of them can throw exceptions. This is
just to make the API a bit more clear.
On gdb/stap-probe.c, I have s/internal_error/error/ on two functions
that are responsible for parsing specific bits of the probes'
arguments: stap_get_opcode and stap_get_expected_argument_type. It is
not correct to call internal_error on such situations because it is
not really GDB's fault if the probes have malformed arguments. I also
improved the error reported on stap_get_expected_argument_type by also
including the probe name on it.
Aside from that, and perhaps most importantly, I added a check on
stap_get_arg to make sure that we don't try to extract an argument
from a probe that has no arguments. This check issues an
internal_error, because it really means that GDB is doing something it
shouldn't.
Although it can be considered almost trivial, and despite the fact
that I am the maintainer for this part of the code, I am posting this
patch for review. I will wait a few days, and if nobody has anything
to say, I will go ahead and push it.
gdb/ChangeLog:
2015-09-01 Sergio Durigan Junior <sergiodj@redhat.com>
* probe.h (struct probe_ops) <get_probe_argument_count,
evaluate_probe_argument, enable_probe, disable_probe>: Mention in
the comment that the function can throw an exception.
(get_probe_argument_count): Likewise.
(evaluate_probe_argument): Likewise.
* stap-probe.c (stap_get_opcode): Call error instead of
internal_error.
(stap_get_expected_argument_type): Likewise. Add argument
'probe'. Improve error message by mentioning the probe's name.
(stap_parse_probe_arguments): Adjust call to
stap_get_expected_argument_type.
(stap_get_arg): Add comment. Assert that 'probe->args_parsed' is
not zero. Call internal_error if GDB requests an argument but the
probe has no arguments.
---
gdb/ChangeLog | 17 +++++++++++++++++
gdb/probe.h | 20 ++++++++++++++------
gdb/stap-probe.c | 29 ++++++++++++++++++++++-------
3 files changed, 53 insertions(+), 13 deletions(-)
Index: gdb-7.10/gdb/probe.h
===================================================================
--- gdb-7.10.orig/gdb/probe.h
+++ gdb-7.10/gdb/probe.h
@@ -70,7 +70,8 @@ struct probe_ops
CORE_ADDR (*get_probe_address) (struct probe *probe,
struct objfile *objfile);
- /* Return the number of arguments of PROBE. */
+ /* Return the number of arguments of PROBE. This function can
+ throw an exception. */
unsigned (*get_probe_argument_count) (struct probe *probe,
struct frame_info *frame);
@@ -82,7 +83,8 @@ struct probe_ops
int (*can_evaluate_probe_arguments) (struct probe *probe);
/* Evaluate the Nth argument from the PROBE, returning a value
- corresponding to it. The argument number is represented N. */
+ corresponding to it. The argument number is represented N.
+ This function can throw an exception. */
struct value *(*evaluate_probe_argument) (struct probe *probe,
unsigned n,
@@ -141,13 +143,15 @@ struct probe_ops
/* Enable a probe. The semantics of "enabling" a probe depend on
the specific backend and the field can be NULL in case enabling
- probes is not supported. */
+ probes is not supported. This function can throw an
+ exception. */
void (*enable_probe) (struct probe *probe);
/* Disable a probe. The semantics of "disabling" a probe depend
on the specific backend and the field can be NULL in case
- disabling probes is not supported. */
+ disabling probes is not supported. This function can throw an
+ exception. */
void (*disable_probe) (struct probe *probe);
};
@@ -264,7 +268,9 @@ extern struct cmd_list_element **info_pr
extern CORE_ADDR get_probe_address (struct probe *probe,
struct objfile *objfile);
-/* Return the argument count of the specified probe. */
+/* Return the argument count of the specified probe.
+
+ This function can throw an exception. */
extern unsigned get_probe_argument_count (struct probe *probe,
struct frame_info *frame);
@@ -276,7 +282,9 @@ extern unsigned get_probe_argument_count
extern int can_evaluate_probe_arguments (struct probe *probe);
/* Evaluate argument N of the specified probe. N must be between 0
- inclusive and get_probe_argument_count exclusive. */
+ inclusive and get_probe_argument_count exclusive.
+
+ This function can throw an exception. */
extern struct value *evaluate_probe_argument (struct probe *probe,
unsigned n,
Index: gdb-7.10/gdb/stap-probe.c
===================================================================
--- gdb-7.10.orig/gdb/stap-probe.c
+++ gdb-7.10/gdb/stap-probe.c
@@ -313,9 +313,8 @@ stap_get_opcode (const char **s)
break;
default:
- internal_error (__FILE__, __LINE__,
- _("Invalid opcode in expression `%s' for SystemTap"
- "probe"), *s);
+ error (_("Invalid opcode in expression `%s' for SystemTap"
+ "probe"), *s);
}
return op;
@@ -326,7 +325,8 @@ stap_get_opcode (const char **s)
static struct type *
stap_get_expected_argument_type (struct gdbarch *gdbarch,
- enum stap_arg_bitness b)
+ enum stap_arg_bitness b,
+ const struct stap_probe *probe)
{
switch (b)
{
@@ -361,8 +361,8 @@ stap_get_expected_argument_type (struct
return builtin_type (gdbarch)->builtin_uint64;
default:
- internal_error (__FILE__, __LINE__,
- _("Undefined bitness for probe."));
+ error (_("Undefined bitness for probe '%s'."),
+ probe->p.name);
break;
}
}
@@ -1172,7 +1172,8 @@ stap_parse_probe_arguments (struct stap_
else
arg.bitness = STAP_ARG_BITNESS_UNDEFINED;
- arg.atype = stap_get_expected_argument_type (gdbarch, arg.bitness);
+ arg.atype = stap_get_expected_argument_type (gdbarch, arg.bitness,
+ probe);
expr = stap_parse_argument (&cur, arg.atype, gdbarch);
@@ -1278,12 +1279,26 @@ stap_is_operator (const char *op)
return ret;
}
+/* Return argument N of probe PROBE.
+
+ If the probe's arguments have not been parsed yet, parse them. If
+ there are no arguments, throw an exception (error). Otherwise,
+ return the requested argument. */
+
static struct stap_probe_arg *
stap_get_arg (struct stap_probe *probe, unsigned n, struct gdbarch *gdbarch)
{
if (!probe->args_parsed)
stap_parse_probe_arguments (probe, gdbarch);
+ gdb_assert (probe->args_parsed);
+ if (probe->args_u.vec == NULL)
+ internal_error (__FILE__, __LINE__,
+ _("Probe '%s' apparently does not have arguments, but \n"
+ "GDB is requesting its argument number %u anyway. "
+ "This should not happen. Please report this bug."),
+ probe->p.name, n);
+
return VEC_index (stap_probe_arg_s, probe->args_u.vec, n);
}

View File

@ -0,0 +1,194 @@
From 3bd7e5b7ee5ea0b3bbb4030ca841f66faad74f0f Mon Sep 17 00:00:00 2001
From: Sergio Durigan Junior <sergiodj@redhat.com>
Date: Fri, 21 Aug 2015 18:28:07 -0400
Subject: [PATCH 2/4] Catching errors on probes-based dynamic linker interface
This patch is intended to make the interaction between the
probes-based dynamic linker interface and the SystemTap SDT probe code
on GDB more robust. It does that by wrapping the calls to the probe
API with TRY...CATCH'es, so that any exception thrown will be caught
and handled properly.
The idea for this patch came from
<https://bugzilla.redhat.com/show_bug.cgi?id=1196181>, which is a bug
initially filed against Fedora GDB (but now under Fedora GLIBC). This
bug happens on armhfp (although it could happen on other targets as
well), and is triggered because GCC generates a strange argument for
one of the probes used by GDB in the dynamic linker interface. As can
be seen in the bug, this argument is "-4@.L1052".
I don't want to discuss the reasons for this argument to be there
(this discussion belongs to the bug, or to another thread), but GDB
could definitely do a better error handling here. Currently, one sees
the following message when there is an error in the probes-based
dynamic linker interface:
(gdb) run
Starting program: /bin/inferior
warning: Probes-based dynamic linker interface failed.
Reverting to original interface.
Cannot parse expression `.L976 4@r4'.
(gdb)
Which means that one needs to explicitly issue a "continue" command to
make GDB continue running the inferior, even though this error is not
fatal and GDB will fallback to the old interface automatically.
This is where this patch helps: it makes GDB still print the necessary
warnings or error messages, but it *also* does not stop the inferior
unnecessarily.
I have tested this patch on the systems where this error happens, but
I could not come up with a way to create a testcase for it.
Nevertheless, it should be straightforward to see that this patch does
improve the current situation.
gdb/ChangeLog:
2015-09-01 Sergio Durigan Junior <sergiodj@redhat.com>
* solib-svr4.c (solib_event_probe_action): Call
get_probe_argument_count using TRY...CATCH.
(svr4_handle_solib_event): Likewise, for evaluate_probe_argument.
---
gdb/ChangeLog | 6 ++++++
gdb/solib-svr4.c | 43 ++++++++++++++++++++++++++++++++++++++++---
2 files changed, 46 insertions(+), 3 deletions(-)
Index: gdb-7.10/gdb/solib-svr4.c
===================================================================
--- gdb-7.10.orig/gdb/solib-svr4.c
+++ gdb-7.10/gdb/solib-svr4.c
@@ -1796,7 +1796,23 @@ solib_event_probe_action (struct probe_a
arg0: Lmid_t lmid (mandatory)
arg1: struct r_debug *debug_base (mandatory)
arg2: struct link_map *new (optional, for incremental updates) */
- probe_argc = get_probe_argument_count (pa->probe, frame);
+ TRY
+ {
+ probe_argc = get_probe_argument_count (pa->probe, frame);
+ }
+ CATCH (ex, RETURN_MASK_ERROR)
+ {
+ exception_print (gdb_stderr, ex);
+ probe_argc = 0;
+ }
+ END_CATCH
+
+ /* If get_probe_argument_count throws an exception, probe_argc will
+ be set to zero. However, if pa->probe does not have arguments,
+ then get_probe_argument_count will succeed but probe_argc will
+ also be zero. Both cases happen because of different things, but
+ they are treated equally here: action will be set to
+ PROBES_INTERFACE_FAILED. */
if (probe_argc == 2)
action = FULL_RELOAD;
else if (probe_argc < 2)
@@ -1950,7 +1966,17 @@ svr4_handle_solib_event (void)
usm_chain = make_cleanup (resume_section_map_updates_cleanup,
current_program_space);
- val = evaluate_probe_argument (pa->probe, 1, frame);
+ TRY
+ {
+ val = evaluate_probe_argument (pa->probe, 1, frame);
+ }
+ CATCH (ex, RETURN_MASK_ERROR)
+ {
+ exception_print (gdb_stderr, ex);
+ val = NULL;
+ }
+ END_CATCH
+
if (val == NULL)
{
do_cleanups (old_chain);
@@ -1981,7 +2007,18 @@ svr4_handle_solib_event (void)
if (action == UPDATE_OR_RELOAD)
{
- val = evaluate_probe_argument (pa->probe, 2, frame);
+ TRY
+ {
+ val = evaluate_probe_argument (pa->probe, 2, frame);
+ }
+ CATCH (ex, RETURN_MASK_ERROR)
+ {
+ exception_print (gdb_stderr, ex);
+ do_cleanups (old_chain);
+ return;
+ }
+ END_CATCH
+
if (val != NULL)
lm = value_as_address (val);
From ad1c917a79e8c5aa67657f148415c1bee01b240f Mon Sep 17 00:00:00 2001
From: Sergio Durigan Junior <sergiodj@redhat.com>
Date: Wed, 2 Sep 2015 00:34:22 -0400
Subject: [PATCH 3/4] Initialize variable and silence GCC warning from last
commit
BuildBot e-mailed me to let me know that my last commit broke GDB on
RHEL-7.1 s390x. On solib-svr4.c:svr4_handle_solib_event, 'val' now
needs to be initialized as NULL because it is inside a TRY..CATCH
block. This patch does that. Pushed as obvious.
gdb/ChangeLog:
2015-09-01 Sergio Durigan Junior <sergiodj@redhat.com>
* solib-svr4.c (svr4_handle_solib_event): Initialize 'val' as NULL
---
gdb/ChangeLog | 4 ++++
gdb/solib-svr4.c | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
Index: gdb-7.10/gdb/solib-svr4.c
===================================================================
--- gdb-7.10.orig/gdb/solib-svr4.c
+++ gdb-7.10/gdb/solib-svr4.c
@@ -1918,7 +1918,7 @@ svr4_handle_solib_event (void)
struct probe_and_action *pa;
enum probe_action action;
struct cleanup *old_chain, *usm_chain;
- struct value *val;
+ struct value *val = NULL;
CORE_ADDR pc, debug_base, lm = 0;
int is_initial_ns;
struct frame_info *frame = get_current_frame ();
From 73c6b4756a7cee53c274ed05fddcd079b8b7e57c Mon Sep 17 00:00:00 2001
From: Sergio Durigan Junior <sergiodj@redhat.com>
Date: Wed, 2 Sep 2015 00:46:43 -0400
Subject: [PATCH 4/4] Initialize yet another variable to silence GCC warning
from last-but-one commit
Yet another BuildBot e-mail, yet another breakage on RHEL-7.1 s390x
(which uses an older GCC). This time,
solib-svr4.c:solib_event_probe_action has the probe_argc variable,
which is now inside a TRY..CATCH and therefore needs to be
initialized. Pushed as obvious.
gdb/ChangeLog:
2015-09-01 Sergio Durigan Junior <sergiodj@redhat.com>
* solib-svr4.c (solib_event_probe_action): Initialize 'probe_argc'
as zero.
---
gdb/ChangeLog | 5 +++++
gdb/solib-svr4.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
2015-09-01 Sergio Durigan Junior <sergiodj@redhat.com>
Index: gdb-7.10/gdb/solib-svr4.c
===================================================================
--- gdb-7.10.orig/gdb/solib-svr4.c
+++ gdb-7.10/gdb/solib-svr4.c
@@ -1782,7 +1782,7 @@ static enum probe_action
solib_event_probe_action (struct probe_and_action *pa)
{
enum probe_action action;
- unsigned probe_argc;
+ unsigned probe_argc = 0;
struct frame_info *frame = get_current_frame ();
action = pa->action;

View File

@ -1,7 +1,8 @@
diff -dup -ruNp gdb-7.8-orig/gdb/doc/python.texi gdb-7.8/gdb/doc/python.texi
--- gdb-7.8-orig/gdb/doc/python.texi 2014-08-13 22:04:14.162441271 +0200
+++ gdb-7.8/gdb/doc/python.texi 2014-08-13 22:07:20.894643853 +0200
@@ -228,6 +228,14 @@ returned as a string. The default is @c
Index: gdb-7.9.50.20150520/gdb/doc/python.texi
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/doc/python.texi 2015-05-31 17:57:12.431593983 +0200
+++ gdb-7.9.50.20150520/gdb/doc/python.texi 2015-05-31 17:57:14.654607708 +0200
@@ -229,6 +229,14 @@ returned as a string. The default is @c
return value is @code{None}. If @var{to_string} is @code{True}, the
@value{GDBN} virtual terminal will be temporarily set to unlimited width
and height, and its pagination will be disabled; @pxref{Screen Size}.
@ -16,10 +17,11 @@ diff -dup -ruNp gdb-7.8-orig/gdb/doc/python.texi gdb-7.8/gdb/doc/python.texi
@end defun
@findex gdb.breakpoints
diff -dup -ruNp gdb-7.8-orig/gdb/python/python-internal.h gdb-7.8/gdb/python/python-internal.h
--- gdb-7.8-orig/gdb/python/python-internal.h 2014-08-13 22:04:14.835441977 +0200
+++ gdb-7.8/gdb/python/python-internal.h 2014-08-13 22:07:20.895643867 +0200
@@ -143,6 +143,8 @@ typedef int Py_ssize_t;
Index: gdb-7.9.50.20150520/gdb/python/python-internal.h
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/python/python-internal.h 2015-05-31 17:57:12.432593989 +0200
+++ gdb-7.9.50.20150520/gdb/python/python-internal.h 2015-05-31 17:57:14.654607708 +0200
@@ -142,6 +142,8 @@ typedef int Py_ssize_t;
#define PyGILState_Release(ARG) ((void)(ARG))
#define PyEval_InitThreads()
#define PyThreadState_Swap(ARG) ((void)(ARG))
@ -28,18 +30,18 @@ diff -dup -ruNp gdb-7.8-orig/gdb/python/python-internal.h gdb-7.8/gdb/python/pyt
#define PyEval_ReleaseLock()
#endif
diff -dup -ruNp gdb-7.8-orig/gdb/python/python.c gdb-7.8/gdb/python/python.c
--- gdb-7.8-orig/gdb/python/python.c 2014-08-13 22:04:14.164441273 +0200
+++ gdb-7.8/gdb/python/python.c 2014-08-13 22:07:20.895643867 +0200
@@ -620,14 +620,19 @@ execute_gdb_command (PyObject *self, PyO
Index: gdb-7.9.50.20150520/gdb/python/python.c
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/python/python.c 2015-05-31 17:57:14.656607720 +0200
+++ gdb-7.9.50.20150520/gdb/python/python.c 2015-05-31 18:02:08.891424227 +0200
@@ -627,13 +627,18 @@ execute_gdb_command (PyObject *self, PyO
{
const char *arg;
PyObject *from_tty_obj = NULL, *to_string_obj = NULL;
- int from_tty, to_string;
- static char *keywords[] = {"command", "from_tty", "to_string", NULL };
+ PyObject *release_gil_obj = NULL;
+ int from_tty, to_string, release_gil;
volatile struct gdb_exception except;
- static char *keywords[] = {"command", "from_tty", "to_string", NULL };
+ static char *keywords[] = {"command", "from_tty", "to_string",
+ "release_gil", NULL };
char *result = NULL;
@ -55,7 +57,7 @@ diff -dup -ruNp gdb-7.8-orig/gdb/python/python.c gdb-7.8/gdb/python/python.c
return NULL;
from_tty = 0;
@@ -648,12 +652,28 @@ execute_gdb_command (PyObject *self, PyO
@@ -654,12 +659,28 @@ execute_gdb_command (PyObject *self, PyO
to_string = cmp;
}
@ -68,7 +70,7 @@ diff -dup -ruNp gdb-7.8-orig/gdb/python/python.c gdb-7.8/gdb/python/python.c
+ release_gil = cmp;
+ }
+
TRY_CATCH (except, RETURN_MASK_ALL)
TRY
{
/* Copy the argument text in case the command modifies it. */
char *copy = xstrdup (arg);
@ -84,7 +86,7 @@ diff -dup -ruNp gdb-7.8-orig/gdb/python/python.c gdb-7.8/gdb/python/python.c
make_cleanup_restore_integer (&interpreter_async);
interpreter_async = 0;
@@ -666,9 +686,21 @@ execute_gdb_command (PyObject *self, PyO
@@ -672,11 +693,23 @@ execute_gdb_command (PyObject *self, PyO
execute_command (copy, from_tty);
}
@ -94,22 +96,25 @@ diff -dup -ruNp gdb-7.8-orig/gdb/python/python.c gdb-7.8/gdb/python/python.c
+
do_cleanups (cleanup);
}
- GDB_PY_HANDLE_EXCEPTION (except);
+ if (except.reason < 0)
+ {
+ /* Reacquire the GIL if it was released earlier. */
+ if (release_gil)
+ PyEval_RestoreThread (state);
CATCH (except, RETURN_MASK_ALL)
{
- GDB_PY_HANDLE_EXCEPTION (except);
+ if (except.reason < 0)
+ {
+ /* Reacquire the GIL if it was released earlier. */
+ if (release_gil)
+ PyEval_RestoreThread (state);
+
+ gdbpy_convert_exception (except);
+ return NULL;
+ }
+ gdbpy_convert_exception (except);
+ return NULL;
+ }
}
END_CATCH
/* Do any commands attached to breakpoint we stopped at. */
bpstat_do_actions ();
diff -dup -ruNp gdb-7.8-orig/gdb/testsuite/gdb.python/py-gil-mthread.c gdb-7.8/gdb/testsuite/gdb.python/py-gil-mthread.c
--- gdb-7.8-orig/gdb/testsuite/gdb.python/py-gil-mthread.c 1970-01-01 01:00:00.000000000 +0100
+++ gdb-7.8/gdb/testsuite/gdb.python/py-gil-mthread.c 2014-08-13 22:33:05.052648912 +0200
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.python/py-gil-mthread.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.python/py-gil-mthread.c 2015-05-31 17:57:14.656607720 +0200
@@ -0,0 +1,12 @@
+#include <stdio.h>
+
@ -123,9 +128,10 @@ diff -dup -ruNp gdb-7.8-orig/gdb/testsuite/gdb.python/py-gil-mthread.c gdb-7.8/g
+ printf ("Sleeping %d\n", i);
+ }
+}
diff -dup -ruNp gdb-7.8-orig/gdb/testsuite/gdb.python/py-gil-mthread.exp gdb-7.8/gdb/testsuite/gdb.python/py-gil-mthread.exp
--- gdb-7.8-orig/gdb/testsuite/gdb.python/py-gil-mthread.exp 1970-01-01 01:00:00.000000000 +0100
+++ gdb-7.8/gdb/testsuite/gdb.python/py-gil-mthread.exp 2014-08-13 22:33:00.660641300 +0200
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.python/py-gil-mthread.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.python/py-gil-mthread.exp 2015-05-31 17:57:14.657607726 +0200
@@ -0,0 +1,69 @@
+# Copyright (C) 2014 Free Software Foundation, Inc.
+
@ -196,9 +202,10 @@ diff -dup -ruNp gdb-7.8-orig/gdb/testsuite/gdb.python/py-gil-mthread.exp gdb-7.8
+ }
+ }
+}
diff -dup -ruNp gdb-7.8-orig/gdb/testsuite/gdb.python/py-gil-mthread.py gdb-7.8/gdb/testsuite/gdb.python/py-gil-mthread.py
--- gdb-7.8-orig/gdb/testsuite/gdb.python/py-gil-mthread.py 1970-01-01 01:00:00.000000000 +0100
+++ gdb-7.8/gdb/testsuite/gdb.python/py-gil-mthread.py 2014-08-13 22:33:08.996654320 +0200
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.python/py-gil-mthread.py
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.python/py-gil-mthread.py 2015-05-31 17:57:14.657607726 +0200
@@ -0,0 +1,22 @@
+import thread
+import time

View File

@ -1,175 +0,0 @@
http://sourceware.org/ml/gdb-patches/2015-02/msg00091.html
Subject: [patch] Fix Python 3 build error on 32-bit hosts
--ZPt4rx8FFjLCG7dd
Content-Type: text/plain; charset=iso-2022-jp
Content-Disposition: inline
Hi,
on Fedora Rawhide (==22) i686 using --with-python=/usr/bin/python3 one gets:
gcc -g -I. -I. -I./common -I./config -DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H -I./../include/opcode -I./../opcodes/.. -I./../readline/.. -I../bfd -I./../bfd -I./../include -I../libdecnumber -I./../libdecnumber -I./gnulib/import -Ibuild-gnulib/import -DTUI=1 -pthread -I/usr/include/guile/2.0 -I/usr/include/python3.4m -I/usr/include/python3.4m -Wall -Wdeclaration-after-statement -Wpointer-arith -Wpointer-sign -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wmissing-prototypes -Wdeclaration-after-statement -Wempty-body -Wmissing-parameter-type -Wold-style-declaration -Wold-style-definition -Wformat-nonliteral -Werror -c -o py-value.o -MT py-value.o -MMD -MP -MF .deps/py-value.Tpo -fno-strict-aliasing -DNDEBUG -fwrapv ./python/py-value.c
./python/py-value.c:1696:3: error: initialization from incompatible pointer type [-Werror]
valpy_hash, /*tp_hash*/
^
./python/py-value.c:1696:3: error: (near initialization for $B!F(Bvalue_object_type.tp_hash$B!G(B) [-Werror]
cc1: all warnings being treated as errors
Makefile:2628: recipe for target 'py-value.o' failed
This is because in Python 2 tp_hash was:
typedef long (*hashfunc)(PyObject *);
while in Python 3 tp_hash is:
typedef Py_hash_t (*hashfunc)(PyObject *);
Py_hash_t is int for 32-bit hosts and long for 64-bit hosts. While on 32-bit
hosts sizeof(long)==sizeof(int) still the hashfunc type is formally
incompatible. As this patch should have no compiled code change it is not
really necessary for gdb-7.9, it would fix there just this non-fatal
compilation warning:
./python/py-value.c:1696:3: warning: initialization from incompatible pointer type
valpy_hash, /*tp_hash*/
^
./python/py-value.c:1696:3: warning: (near initialization for $B!F(Bvalue_object_type.tp_hash$B!G(B)
A question is whether the autoconf test isn't an overkill. One could use
instead just:
#if PYTHON_ABI_VERSION >= 3
Also one could use that #if either just at the valpy_hash() definition or one
could provide Py_hash_t in gdb/defs.h or one could provide some GDB_Py_hash_t
in gdb/defs.h.
Tested compilation with:
python-devel-2.7.9-4.fc22.x86_64
python-devel-2.7.9-4.fc22.i686
python3-devel-3.4.2-4.fc22.x86_64
python3-devel-3.4.2-4.fc22.i686
Jan
--ZPt4rx8FFjLCG7dd
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline; filename=1
gdb/
2015-02-04 Jan Kratochvil <jan.kratochvil@redhat.com>
* configure.ac <"${have_libpython}" != no>: Define Py_hash_t.
* python/py-value.c (valpy_fetch_lazy): Use it. Remove cast to the
return type.
* config.in: Regenerate.
* configure: Regenerate.
diff --git a/gdb/config.in b/gdb/config.in
index 806cbac..44acfac 100644
--- a/gdb/config.in
+++ b/gdb/config.in
@@ -617,6 +617,9 @@
/* Define if the python directory should be relocated when GDB is moved. */
#undef PYTHON_PATH_RELOCATABLE
+/* Provide Python 3 Py_hash_t for Python 2. */
+#undef Py_hash_t
+
/* Relocated directory for source files. */
#undef RELOC_SRCDIR
diff --git a/gdb/configure b/gdb/configure
index 9632f9a..65f5b2c 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -8749,6 +8749,45 @@ rm -f conftest.err conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${python_has_threads}" >&5
$as_echo "${python_has_threads}" >&6; }
CPPFLAGS="${saved_CPPFLAGS}"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Py_hash_t" >&5
+$as_echo_n "checking for Py_hash_t... " >&6; }
+if test "${gdb_cv_Py_hash_t+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ old_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $PYTHON_CFLAGS"
+ old_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $PYTHON_CPPFLAGS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <Python.h>
+int
+main ()
+{
+Py_hash_t var;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gdb_cv_Py_hash_t=yes
+else
+ gdb_cv_Py_hash_t=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CPPFLAGS="$old_CPPFLAGS"
+ CFLAGS="$old_CFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_Py_hash_t" >&5
+$as_echo "$gdb_cv_Py_hash_t" >&6; }
+ if test "x$gdb_cv_Py_hash_t" = "xno"; then
+
+$as_echo "#define Py_hash_t long" >>confdefs.h
+
+ fi
else
# Even if Python support is not compiled in, we need to have this file
# included so that the "python" command, et.al., still exists.
diff --git a/gdb/configure.ac b/gdb/configure.ac
index dfc6947..f335b7b 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1016,6 +1016,25 @@ if test "${have_libpython}" != no; then
]]), [python_has_threads=no], [python_has_threads=yes])
AC_MSG_RESULT(${python_has_threads})
CPPFLAGS="${saved_CPPFLAGS}"
+
+ AC_CACHE_CHECK([for Py_hash_t], gdb_cv_Py_hash_t,
+ old_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $PYTHON_CFLAGS"
+ old_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $PYTHON_CPPFLAGS"
+ AC_TRY_COMPILE(
+ [#include <Python.h>],
+ [Py_hash_t var;],
+ gdb_cv_Py_hash_t=yes,
+ gdb_cv_Py_hash_t=no
+ )
+ CPPFLAGS="$old_CPPFLAGS"
+ CFLAGS="$old_CFLAGS"
+ )
+ if test "x$gdb_cv_Py_hash_t" = "xno"; then
+ AC_DEFINE(Py_hash_t, long,
+ [Provide Python 3 Py_hash_t for Python 2.])
+ fi
else
# Even if Python support is not compiled in, we need to have this file
# included so that the "python" command, et.al., still exists.
diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c
index 4c4d36e..5a13777 100644
--- a/gdb/python/py-value.c
+++ b/gdb/python/py-value.c
@@ -895,10 +895,10 @@ valpy_fetch_lazy (PyObject *self, PyObject *args)
/* Calculate and return the address of the PyObject as the value of
the builtin __hash__ call. */
-static long
+static Py_hash_t
valpy_hash (PyObject *self)
{
- return (long) (intptr_t) self;
+ return (intptr_t) self;
}
enum valpy_opcode

View File

@ -1,56 +0,0 @@
http://sourceware.org/ml/gdb-patches/2015-02/msg00361.html
Subject: PR python/17927 (Python 3 testsuite compatability)
This patch updates the Python testsuite to maintain Python 3
compatibility. I'll check it in under the obvious tomorrow (if
nobody objects otherwise.)
Cheers
Phil
2015-02-16 Phil Muldoon <pmuldoon@redhat.com>
PR python/17927
* gdb.python/py-objfile.exp: Use print ()
* gdb.python/py-type.exp: Ditto.
* gdb.python/py-framefilter.py: Update to use map in
Python 3.
--
diff --git a/gdb/testsuite/gdb.python/py-framefilter.py b/gdb/testsuite/gdb.python/py-framefilter.py
index 0de026c..8c65edc 100644
--- a/gdb/testsuite/gdb.python/py-framefilter.py
+++ b/gdb/testsuite/gdb.python/py-framefilter.py
@@ -145,7 +145,10 @@ class ErrorFilter():
gdb.frame_filters [self.name] = self
def filter(self, frame_iter):
- return itertools.imap(ErrorInName, frame_iter)
+ if hasattr(itertools, "imap"):
+ return itertools.imap(ErrorInName, frame_iter)
+ else:
+ return map(ErrorInName, frame_iter)
FrameFilter()
FrameElider()
diff --git a/gdb/testsuite/gdb.python/py-type.exp b/gdb/testsuite/gdb.python/py-type.exp
index c4c8d9f..6c4e5f8 100644
--- a/gdb/testsuite/gdb.python/py-type.exp
+++ b/gdb/testsuite/gdb.python/py-type.exp
@@ -247,10 +247,10 @@ restart_gdb "${binfile}"
# Skip all tests if Python scripting is not enabled.
if { [skip_python_tests] } { continue }
-gdb_test "python print gdb.lookup_type('char').array(1, 0)" \
+gdb_test "python print (gdb.lookup_type('char').array(1, 0))" \
"char \\\[0\\\]"
-gdb_test "python print gdb.lookup_type('char').array(1, -1)" \
+gdb_test "python print (gdb.lookup_type('char').array(1, -1))" \
"Array length must not be negative.*"
with_test_prefix "lang_c" {

View File

@ -0,0 +1,257 @@
http://sourceware.org/ml/gdb-patches/2015-09/msg00183.html
Subject: [ppc64le patch v3] Use skip_entrypoint for skip_trampoline_code
--mYCpIKhGyMATD0i+
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
An update to PASS the testcase on non-ppc64le archs.
--mYCpIKhGyMATD0i+
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline; filename=4
gdb/ChangeLog
2015-09-07 Jan Kratochvil <jan.kratochvil@redhat.com>
* linespec.c (minsym_found): Call gdbarch_skip_entrypoint.
* ppc64-tdep.c (ppc64_skip_trampoline_code): Rename to ...
(ppc64_skip_trampoline_code_1): ... here.
(ppc64_skip_trampoline_code): New wrapper function.
* symtab.c (find_function_start_sal): Call gdbarch_skip_entrypoint.
gdb/testsuite/ChangeLog
2015-09-07 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.opt/solib-intra-step-lib.c: New file.
* gdb.opt/solib-intra-step-main.c: New file.
* gdb.opt/solib-intra-step.exp: New file.
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 8f102fa..4c29c12 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -3570,6 +3570,8 @@ minsym_found (struct linespec_state *self, struct objfile *objfile,
sal.pc = MSYMBOL_VALUE_ADDRESS (objfile, msymbol);
sal.pc = gdbarch_convert_from_func_ptr_addr (gdbarch, sal.pc,
&current_target);
+ if (gdbarch_skip_entrypoint_p (gdbarch))
+ sal.pc = gdbarch_skip_entrypoint (gdbarch, sal.pc);
}
else
skip_prologue_sal (&sal);
diff --git a/gdb/ppc64-tdep.c b/gdb/ppc64-tdep.c
index bb23b6a..4a0b93a 100644
--- a/gdb/ppc64-tdep.c
+++ b/gdb/ppc64-tdep.c
@@ -454,8 +454,8 @@ ppc64_standard_linkage4_target (struct frame_info *frame,
When the execution direction is EXEC_REVERSE, scan backward to
check whether we are in the middle of a PLT stub. */
-CORE_ADDR
-ppc64_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
+static CORE_ADDR
+ppc64_skip_trampoline_code_1 (struct frame_info *frame, CORE_ADDR pc)
{
#define MAX(a,b) ((a) > (b) ? (a) : (b))
unsigned int insns[MAX (MAX (MAX (ARRAY_SIZE (ppc64_standard_linkage1),
@@ -530,6 +530,20 @@ ppc64_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
return 0;
}
+/* Wrapper of ppc64_skip_trampoline_code_1 checking also
+ ppc_elfv2_skip_entrypoint. */
+
+CORE_ADDR
+ppc64_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
+{
+ struct gdbarch *gdbarch = get_frame_arch (frame);
+
+ pc = ppc64_skip_trampoline_code_1 (frame, pc);
+ if (pc != 0 && gdbarch_skip_entrypoint_p (gdbarch))
+ pc = gdbarch_skip_entrypoint (gdbarch, pc);
+ return pc;
+}
+
/* Support for convert_from_func_ptr_addr (ARCH, ADDR, TARG) on PPC64
GNU/Linux.
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 1ba691e..f65e809 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -3629,7 +3629,11 @@ find_function_start_sal (struct symbol *sym, int funfirstline)
&& (COMPUNIT_LOCATIONS_VALID (SYMTAB_COMPUNIT (sal.symtab))
|| SYMTAB_LANGUAGE (sal.symtab) == language_asm))
{
+ struct gdbarch *gdbarch = symbol_arch (sym);
+
sal.pc = BLOCK_START (SYMBOL_BLOCK_VALUE (sym));
+ if (gdbarch_skip_entrypoint_p (gdbarch))
+ sal.pc = gdbarch_skip_entrypoint (gdbarch, sal.pc);
return sal;
}
diff --git a/gdb/testsuite/gdb.opt/solib-intra-step-lib.c b/gdb/testsuite/gdb.opt/solib-intra-step-lib.c
new file mode 100644
index 0000000..9ab1211
--- /dev/null
+++ b/gdb/testsuite/gdb.opt/solib-intra-step-lib.c
@@ -0,0 +1,30 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ 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/>. */
+
+#include <stdlib.h>
+
+void
+shlib_second (int dummy)
+{ /* second-retry */
+ abort (); /* second-hit */
+}
+
+void
+shlib_first (void)
+{ /* first-retry */
+ shlib_second (0); /* first-hit */
+}
diff --git a/gdb/testsuite/gdb.opt/solib-intra-step-main.c b/gdb/testsuite/gdb.opt/solib-intra-step-main.c
new file mode 100644
index 0000000..186bd5f
--- /dev/null
+++ b/gdb/testsuite/gdb.opt/solib-intra-step-main.c
@@ -0,0 +1,25 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ 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/>. */
+
+extern void shlib_first (void);
+
+int
+main (void)
+{
+ shlib_first ();
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.opt/solib-intra-step.exp b/gdb/testsuite/gdb.opt/solib-intra-step.exp
new file mode 100644
index 0000000..044c4bd
--- /dev/null
+++ b/gdb/testsuite/gdb.opt/solib-intra-step.exp
@@ -0,0 +1,86 @@
+# 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/>.
+
+standard_testfile
+
+if {[skip_shlib_tests]} {
+ return 0
+}
+
+# Library file.
+set libname "${testfile}-lib"
+set srcfile_lib ${srcdir}/${subdir}/${libname}.c
+set binfile_lib [standard_output_file ${libname}.so]
+set lib_flags [list debug optimize=-O2]
+# Binary file.
+set testfile "${testfile}-main"
+set srcfile ${srcdir}/${subdir}/${testfile}.c
+set binfile [standard_output_file ${testfile}]
+set bin_flags [list debug shlib=${binfile_lib}]
+
+if [get_compiler_info] {
+ return -1
+}
+
+if { [gdb_compile_shlib ${srcfile_lib} ${binfile_lib} $lib_flags] != ""
+ || [gdb_compile ${srcfile} ${binfile} executable $bin_flags] != "" } {
+ untested "Could not compile $binfile_lib or $binfile."
+ return -1
+}
+
+clean_restart ${binfile}
+gdb_load_shlibs $binfile_lib
+
+if ![runto_main] then {
+ return 0
+}
+
+set test "first-hit"
+gdb_test_multiple "step" $test {
+ -re " first-hit .*\r\n$gdb_prompt $" {
+ pass $test
+ }
+ -re " first-retry .*\r\n$gdb_prompt $" {
+ gdb_test "step" " first-hit .*" "first-hit (optimized)"
+ }
+}
+
+set test "second-hit"
+gdb_test_multiple "step" $test {
+ -re " second-hit .*\r\n$gdb_prompt $" {
+ pass $test
+ }
+ -re " first-retry .*\r\n$gdb_prompt $" {
+ set test "second-hit (optimized 1)"
+ gdb_test_multiple "step" $test {
+ -re " second-hit .*\r\n$gdb_prompt $" {
+ pass $test
+ }
+ -re " first-hit .*\r\n$gdb_prompt $" {
+ gdb_test "step" " second-hit .*" "second-hit (optimized 2)"
+ }
+ }
+ }
+ -re " second-retry .*\r\n$gdb_prompt $" {
+ gdb_test "step" " second-hit .*" "second-hit (optimized 3)"
+ }
+}
+
+if ![runto_main] then {
+ return 0
+}
+
+gdb_breakpoint "shlib_second"
+gdb_continue_to_breakpoint "second-hit" ".* (second-hit|second-retry) .*"
--mYCpIKhGyMATD0i+--

View File

@ -0,0 +1,220 @@
http://sourceware.org/ml/gdb-patches/2015-10/msg00166.html
Subject: [patch] Fix internal error on DW_OP_bregx(-1)
--ibTvN161/egqYuK8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Hi,
https://bugzilla.redhat.com/show_bug.cgi?id=1270564#c15
https://bugzilla.redhat.com/attachment.cgi?id=1081772
clang-3.5.0-9.fc22.x86_64
<3><22b2>: Abbrev Number: 69 (DW_TAG_variable)
<22b3> DW_AT_location : 7 byte block: 92 ff ff ff ff f 0 (DW_OP_bregx: 4294967295 (r-1) 0)
<22bb> DW_AT_name : (indirect string, offset: 0x2a36): texture_data
<22c1> DW_AT_type : <0x1d3>
(gdb) p variable
warning: Unmapped DWARF Register #-1 encountered.
regcache.c:177: internal-error: register_size: Assertion `regnum >= 0 && regnum < (gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch))' failed.
[...]
Quit this debugging session? (y or n) FAIL: gdb.dwarf2/dw2-regno-invalid.exp: p variable (GDB internal error)
-> (x86_64)
(gdb) p variable
warning: Unmapped DWARF Register #-1 encountered.
Invalid register #-1, expecting 0 <= # < 220
(gdb) PASS: gdb.dwarf2/dw2-regno-invalid.exp: p variable
-> (i386)
(gdb) p variable
Invalid register #104, expecting 0 <= # < 104
(gdb) PASS: gdb.dwarf2/dw2-regno-invalid.exp: p variable
GDB calls gdbarch_dwarf2_reg_to_regnum() first which returns -1 in the x86_64
case
if (regnum == -1)
warning (_("Unmapped DWARF Register #%d encountered."), reg);
but in i386 case it does:
/* This will hopefully provoke a warning. */
return gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch);
and the default implementation is a nop, leaving whatever register number
the DWARF specified.
No regressions on {x86_64,x86_64-m32,i686}-fedorarawhide-linux-gnu.
Jan
--ibTvN161/egqYuK8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline; filename="undefreg.patch"
gdb/ChangeLog
2015-10-12 Jan Kratochvil <jan.kratochvil@redhat.com>
* findvar.c (address_from_register): Check REGNUM validity.
gdb/testsuite/ChangeLog
2015-10-12 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.dwarf2/dw2-regno-invalid.S: New file.
* gdb.dwarf2/dw2-regno-invalid.exp: New file.
diff --git a/gdb/findvar.c b/gdb/findvar.c
index 0f46e53..855947d 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -927,6 +927,12 @@ address_from_register (int regnum, struct frame_info *frame)
struct type *type = builtin_type (gdbarch)->builtin_data_ptr;
struct value *value;
CORE_ADDR result;
+ int regnum_max_excl = (gdbarch_num_regs (gdbarch)
+ + gdbarch_num_pseudo_regs (gdbarch));
+
+ if (regnum < 0 || regnum >= regnum_max_excl)
+ error (_("Invalid register #%d, expecting 0 <= # < %d"), regnum,
+ regnum_max_excl);
/* This routine may be called during early unwinding, at a time
where the ID of FRAME is not yet known. Calling value_from_register
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-regno-invalid.S b/gdb/testsuite/gdb.dwarf2/dw2-regno-invalid.S
new file mode 100644
index 0000000..075bfd6
--- /dev/null
+++ b/gdb/testsuite/gdb.dwarf2/dw2-regno-invalid.S
@@ -0,0 +1,91 @@
+/* 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/>. */
+
+ .section .debug_info
+debug_start:
+ .4byte debug_end - 1f /* Length of Compilation Unit Info */
+1:
+ .2byte 0x3 /* DWARF version number */
+ .4byte .Ldebug_abbrev0 /* Offset Into Abbrev. Section */
+ .byte 0x4 /* Pointer Size (in bytes) */
+ .uleb128 0x1 /* (DIE (0xb) DW_TAG_compile_unit) */
+ .ascii "clang-3.5.0-9.fc22.x86_64\0" /* DW_AT_producer */
+ .byte 0x1 /* DW_AT_language */
+ .ascii "1.c\0" /* DW_AT_name */
+ .4byte main_label /* DW_AT_low_pc */
+ .4byte main_label+0x10000 /* DW_AT_high_pc */
+
+ .uleb128 2 /* Abbrev: DW_TAG_subprogram */
+ .byte 1 /* DW_AT_external */
+ .ascii "main\0" /* DW_AT_name */
+ .4byte main_label /* DW_AT_low_pc */
+ .4byte main_label+0x10000 /* DW_AT_high_pc */
+
+ .uleb128 0x4 /* (DW_TAG_variable) */
+ .ascii "variable\0" /* DW_AT_name */
+ .2byte 2f - 1f /* DW_AT_location: DW_FORM_block2 */
+1:
+ .byte 0x92 /* DW_OP_bregx */
+ .uleb128 0xffffffff
+ .sleb128 0
+2:
+
+ .byte 0x0 /* end of children of main */
+ .byte 0x0 /* end of children of CU */
+debug_end:
+
+ .section .debug_abbrev
+.Ldebug_abbrev0:
+ .uleb128 0x1 /* (abbrev code) */
+ .uleb128 0x11 /* (TAG: DW_TAG_compile_unit) */
+ .byte 0x1 /* DW_children_yes */
+ .uleb128 0x25 /* (DW_AT_producer) */
+ .uleb128 0x8 /* (DW_FORM_string) */
+ .uleb128 0x13 /* (DW_AT_language) */
+ .uleb128 0xb /* (DW_FORM_data1) */
+ .uleb128 0x3 /* (DW_AT_name) */
+ .uleb128 0x8 /* (DW_FORM_string) */
+ .uleb128 0x11 /* DW_AT_low_pc */
+ .uleb128 0x1 /* DW_FORM_addr */
+ .uleb128 0x12 /* DW_AT_high_pc */
+ .uleb128 0x1 /* DW_FORM_addr */
+ .byte 0x0
+ .byte 0x0
+
+ .uleb128 2 /* Abbrev code */
+ .uleb128 0x2e /* DW_TAG_subprogram */
+ .byte 1 /* has_children */
+ .uleb128 0x3f /* DW_AT_external */
+ .uleb128 0xc /* DW_FORM_flag */
+ .uleb128 0x3 /* DW_AT_name */
+ .uleb128 0x8 /* DW_FORM_string */
+ .uleb128 0x11 /* DW_AT_low_pc */
+ .uleb128 0x1 /* DW_FORM_addr */
+ .uleb128 0x12 /* DW_AT_high_pc */
+ .uleb128 0x1 /* DW_FORM_addr */
+ .byte 0x0 /* Terminator */
+ .byte 0x0 /* Terminator */
+
+
+ .uleb128 0x4 /* (abbrev code) */
+ .uleb128 0x34 /* (TAG: DW_TAG_variable) */
+ .byte 0x0 /* DW_children_yes */
+ .uleb128 0x3 /* (DW_AT_name) */
+ .uleb128 0x8 /* (DW_FORM_string) */
+ .uleb128 0x02 /* (DW_AT_location) */
+ .uleb128 0x3 /* (DW_FORM_block2) */
+ .byte 0x0
+ .byte 0x0
+ .byte 0x0
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-regno-invalid.exp b/gdb/testsuite/gdb.dwarf2/dw2-regno-invalid.exp
new file mode 100644
index 0000000..7c3a404
--- /dev/null
+++ b/gdb/testsuite/gdb.dwarf2/dw2-regno-invalid.exp
@@ -0,0 +1,32 @@
+# 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/>.
+load_lib dwarf.exp
+
+# This test can only be run on targets which support DWARF-2 and use gas.
+if {![dwarf2_support]} {
+ return 0
+}
+
+standard_testfile .S main.c
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile} ${srcdir}/${subdir}/${srcfile2}" \
+ "${binfile}" executable {}] != "" } {
+ return -1
+}
+
+clean_restart ${binfile}
+runto_main
+
+gdb_test "p variable"
--ibTvN161/egqYuK8--

File diff suppressed because it is too large Load Diff

View File

@ -137,10 +137,10 @@ Content-Type: text/x-patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=bitpos-tdep.patch
Index: gdb-7.8.50.20141228/gdb/alpha-tdep.c
Index: gdb-7.9.50.20150520/gdb/alpha-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/alpha-tdep.c 2015-01-05 22:18:55.988023607 +0100
+++ gdb-7.8.50.20141228/gdb/alpha-tdep.c 2015-01-05 22:19:08.086078440 +0100
--- gdb-7.9.50.20150520.orig/gdb/alpha-tdep.c 2015-05-31 17:15:01.056868035 +0200
+++ gdb-7.9.50.20150520/gdb/alpha-tdep.c 2015-05-31 17:15:03.419882846 +0200
@@ -298,18 +298,18 @@ alpha_push_dummy_call (struct gdbarch *g
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
@ -184,20 +184,20 @@ Index: gdb-7.8.50.20141228/gdb/alpha-tdep.c
memcpy (arg_reg_buffer + offset, contents, tlen);
offset += tlen;
contents += tlen;
Index: gdb-7.8.50.20141228/gdb/amd64-tdep.c
Index: gdb-7.9.50.20150520/gdb/amd64-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/amd64-tdep.c 2015-01-05 22:18:55.989023612 +0100
+++ gdb-7.8.50.20141228/gdb/amd64-tdep.c 2015-01-05 22:19:08.087078444 +0100
@@ -700,7 +700,7 @@ amd64_return_value (struct gdbarch *gdba
--- gdb-7.9.50.20150520.orig/gdb/amd64-tdep.c 2015-05-31 17:15:01.058868047 +0200
+++ gdb-7.9.50.20150520/gdb/amd64-tdep.c 2015-05-31 17:15:40.253113722 +0200
@@ -701,7 +701,7 @@ amd64_return_value (struct gdbarch *gdba
gdb_byte *readbuf, const gdb_byte *writebuf)
{
enum amd64_reg_class class[2];
enum amd64_reg_class theclass[2];
- int len = TYPE_LENGTH (type);
+ LONGEST len = TYPE_LENGTH (type);
static int integer_regnum[] = { AMD64_RAX_REGNUM, AMD64_RDX_REGNUM };
static int sse_regnum[] = { AMD64_XMM0_REGNUM, AMD64_XMM1_REGNUM };
int integer_reg = 0;
@@ -851,8 +851,8 @@ amd64_push_arguments (struct regcache *r
@@ -852,8 +852,8 @@ amd64_push_arguments (struct regcache *r
};
struct value **stack_args = alloca (nargs * sizeof (struct value *));
int num_stack_args = 0;
@ -208,19 +208,19 @@ Index: gdb-7.8.50.20141228/gdb/amd64-tdep.c
int integer_reg = 0;
int sse_reg = 0;
int i;
@@ -864,7 +864,7 @@ amd64_push_arguments (struct regcache *r
@@ -865,7 +865,7 @@ amd64_push_arguments (struct regcache *r
for (i = 0; i < nargs; i++)
{
struct type *type = value_type (args[i]);
- int len = TYPE_LENGTH (type);
+ LONGEST len = TYPE_LENGTH (type);
enum amd64_reg_class class[2];
enum amd64_reg_class theclass[2];
int needed_integer_regs = 0;
int needed_sse_regs = 0;
Index: gdb-7.8.50.20141228/gdb/amd64-windows-tdep.c
Index: gdb-7.9.50.20150520/gdb/amd64-windows-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/amd64-windows-tdep.c 2015-01-05 22:18:55.990023616 +0100
+++ gdb-7.8.50.20141228/gdb/amd64-windows-tdep.c 2015-01-05 22:19:08.087078444 +0100
--- gdb-7.9.50.20150520.orig/gdb/amd64-windows-tdep.c 2015-05-31 17:15:01.059868054 +0200
+++ gdb-7.9.50.20150520/gdb/amd64-windows-tdep.c 2015-05-31 17:15:03.421882859 +0200
@@ -288,7 +288,7 @@ amd64_windows_return_value (struct gdbar
struct type *type, struct regcache *regcache,
gdb_byte *readbuf, const gdb_byte *writebuf)
@ -230,11 +230,11 @@ Index: gdb-7.8.50.20141228/gdb/amd64-windows-tdep.c
int regnum = -1;
/* See if our value is returned through a register. If it is, then
Index: gdb-7.8.50.20141228/gdb/arm-tdep.c
Index: gdb-7.9.50.20150520/gdb/arm-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/arm-tdep.c 2015-01-05 22:18:55.995023639 +0100
+++ gdb-7.8.50.20141228/gdb/arm-tdep.c 2015-01-05 22:19:08.089078453 +0100
@@ -3524,7 +3524,7 @@ arm_vfp_cprc_reg_char (enum arm_vfp_cprc
--- gdb-7.9.50.20150520.orig/gdb/arm-tdep.c 2015-05-31 17:15:01.069868116 +0200
+++ gdb-7.9.50.20150520/gdb/arm-tdep.c 2015-05-31 17:15:03.425882884 +0200
@@ -3537,7 +3537,7 @@ arm_vfp_cprc_reg_char (enum arm_vfp_cprc
array). Vector types are not currently supported, matching the
generic AAPCS support. */
@ -243,7 +243,7 @@ Index: gdb-7.8.50.20141228/gdb/arm-tdep.c
arm_vfp_cprc_sub_candidate (struct type *t,
enum arm_vfp_cprc_base_type *base_type)
{
@@ -3587,7 +3587,7 @@ arm_vfp_cprc_sub_candidate (struct type
@@ -3600,7 +3600,7 @@ arm_vfp_cprc_sub_candidate (struct type
case TYPE_CODE_ARRAY:
{
@ -252,7 +252,7 @@ Index: gdb-7.8.50.20141228/gdb/arm-tdep.c
unsigned unitlen;
count = arm_vfp_cprc_sub_candidate (TYPE_TARGET_TYPE (t), base_type);
if (count == -1)
@@ -3607,13 +3607,15 @@ arm_vfp_cprc_sub_candidate (struct type
@@ -3620,13 +3620,15 @@ arm_vfp_cprc_sub_candidate (struct type
case TYPE_CODE_STRUCT:
{
@ -271,7 +271,7 @@ Index: gdb-7.8.50.20141228/gdb/arm-tdep.c
if (sub_count == -1)
return -1;
count += sub_count;
@@ -3633,13 +3635,15 @@ arm_vfp_cprc_sub_candidate (struct type
@@ -3646,13 +3648,15 @@ arm_vfp_cprc_sub_candidate (struct type
case TYPE_CODE_UNION:
{
@ -290,7 +290,7 @@ Index: gdb-7.8.50.20141228/gdb/arm-tdep.c
if (sub_count == -1)
return -1;
count = (count > sub_count ? count : sub_count);
@@ -3675,7 +3679,7 @@ arm_vfp_call_candidate (struct type *t,
@@ -3688,7 +3692,7 @@ arm_vfp_call_candidate (struct type *t,
int *count)
{
enum arm_vfp_cprc_base_type b = VFP_CPRC_UNKNOWN;
@ -299,7 +299,7 @@ Index: gdb-7.8.50.20141228/gdb/arm-tdep.c
if (c <= 0 || c > 4)
return 0;
*base_type = b;
@@ -3756,7 +3760,7 @@ arm_push_dummy_call (struct gdbarch *gdb
@@ -3769,7 +3773,7 @@ arm_push_dummy_call (struct gdbarch *gdb
for (argnum = 0; argnum < nargs; argnum++)
{
@ -308,10 +308,10 @@ Index: gdb-7.8.50.20141228/gdb/arm-tdep.c
struct type *arg_type;
struct type *target_type;
enum type_code typecode;
Index: gdb-7.8.50.20141228/gdb/avr-tdep.c
Index: gdb-7.9.50.20150520/gdb/avr-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/avr-tdep.c 2015-01-05 22:18:55.996023643 +0100
+++ gdb-7.8.50.20141228/gdb/avr-tdep.c 2015-01-05 22:19:08.089078453 +0100
--- gdb-7.9.50.20150520.orig/gdb/avr-tdep.c 2015-05-31 17:15:01.071868129 +0200
+++ gdb-7.9.50.20150520/gdb/avr-tdep.c 2015-05-31 17:15:03.425882884 +0200
@@ -1196,13 +1196,14 @@ avr_dummy_id (struct gdbarch *gdbarch, s
struct stack_item
@ -345,10 +345,10 @@ Index: gdb-7.8.50.20141228/gdb/avr-tdep.c
/* Calculate the potential last register needed. */
last_regnum = regnum - (len + (len & 1));
Index: gdb-7.8.50.20141228/gdb/bfin-tdep.c
Index: gdb-7.9.50.20150520/gdb/bfin-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/bfin-tdep.c 2015-01-05 22:18:55.996023643 +0100
+++ gdb-7.8.50.20141228/gdb/bfin-tdep.c 2015-01-05 22:19:08.090078458 +0100
--- gdb-7.9.50.20150520.orig/gdb/bfin-tdep.c 2015-05-31 17:15:01.071868129 +0200
+++ gdb-7.9.50.20150520/gdb/bfin-tdep.c 2015-05-31 17:15:03.426882890 +0200
@@ -504,7 +504,7 @@ bfin_push_dummy_call (struct gdbarch *gd
gdb_byte buf[4];
int i;
@ -367,10 +367,10 @@ Index: gdb-7.8.50.20141228/gdb/bfin-tdep.c
sp -= container_len;
write_memory (sp, value_contents_writeable (args[i]), container_len);
Index: gdb-7.8.50.20141228/gdb/cris-tdep.c
Index: gdb-7.9.50.20150520/gdb/cris-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/cris-tdep.c 2015-01-05 22:18:55.997023648 +0100
+++ gdb-7.8.50.20141228/gdb/cris-tdep.c 2015-01-05 22:19:08.090078458 +0100
--- gdb-7.9.50.20150520.orig/gdb/cris-tdep.c 2015-05-31 17:15:01.073868142 +0200
+++ gdb-7.9.50.20150520/gdb/cris-tdep.c 2015-05-31 17:15:03.427882897 +0200
@@ -663,13 +663,13 @@ static CORE_ADDR cris_unwind_sp (struct
struct stack_item
@ -405,10 +405,10 @@ Index: gdb-7.8.50.20141228/gdb/cris-tdep.c
/* How may registers worth of storage do we need for this argument? */
reg_demand = (len / 4) + (len % 4 != 0 ? 1 : 0);
Index: gdb-7.8.50.20141228/gdb/h8300-tdep.c
Index: gdb-7.9.50.20150520/gdb/h8300-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/h8300-tdep.c 2015-01-05 22:18:55.998023652 +0100
+++ gdb-7.8.50.20141228/gdb/h8300-tdep.c 2015-01-05 22:19:08.091078463 +0100
--- gdb-7.9.50.20150520.orig/gdb/h8300-tdep.c 2015-05-31 17:15:01.074868148 +0200
+++ gdb-7.9.50.20150520/gdb/h8300-tdep.c 2015-05-31 17:15:03.427882897 +0200
@@ -639,7 +639,7 @@ h8300_push_dummy_call (struct gdbarch *g
int struct_return, CORE_ADDR struct_addr)
{
@ -441,11 +441,11 @@ Index: gdb-7.8.50.20141228/gdb/h8300-tdep.c
for (offset = 0; offset < padded_len; offset += wordsize)
{
Index: gdb-7.8.50.20141228/gdb/hppa-tdep.c
Index: gdb-7.9.50.20150520/gdb/hppa-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/hppa-tdep.c 2015-01-05 22:18:55.999023657 +0100
+++ gdb-7.8.50.20141228/gdb/hppa-tdep.c 2015-01-05 22:19:08.091078463 +0100
@@ -960,7 +960,7 @@ hppa64_push_dummy_call (struct gdbarch *
--- gdb-7.9.50.20150520.orig/gdb/hppa-tdep.c 2015-05-31 17:15:01.076868160 +0200
+++ gdb-7.9.50.20150520/gdb/hppa-tdep.c 2015-05-31 17:15:03.428882903 +0200
@@ -991,7 +991,7 @@ hppa64_push_dummy_call (struct gdbarch *
{
struct value *arg = args[i];
struct type *type = value_type (arg);
@ -454,7 +454,7 @@ Index: gdb-7.8.50.20141228/gdb/hppa-tdep.c
const bfd_byte *valbuf;
bfd_byte fptrbuf[8];
int regnum;
@@ -1155,7 +1155,7 @@ hppa64_return_value (struct gdbarch *gdb
@@ -1186,7 +1186,7 @@ hppa64_return_value (struct gdbarch *gdb
struct type *type, struct regcache *regcache,
gdb_byte *readbuf, const gdb_byte *writebuf)
{
@ -463,10 +463,10 @@ Index: gdb-7.8.50.20141228/gdb/hppa-tdep.c
int regnum, offset;
if (len > 16)
Index: gdb-7.8.50.20141228/gdb/i386-darwin-tdep.c
Index: gdb-7.9.50.20150520/gdb/i386-darwin-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/i386-darwin-tdep.c 2015-01-05 22:18:55.999023657 +0100
+++ gdb-7.8.50.20141228/gdb/i386-darwin-tdep.c 2015-01-05 22:19:08.091078463 +0100
--- gdb-7.9.50.20150520.orig/gdb/i386-darwin-tdep.c 2015-05-31 17:15:01.076868160 +0200
+++ gdb-7.9.50.20150520/gdb/i386-darwin-tdep.c 2015-05-31 17:15:03.428882903 +0200
@@ -163,7 +163,7 @@ i386_darwin_push_dummy_call (struct gdba
for (write_pass = 0; write_pass < 2; write_pass++)
@ -476,11 +476,11 @@ Index: gdb-7.8.50.20141228/gdb/i386-darwin-tdep.c
int num_m128 = 0;
if (struct_return)
Index: gdb-7.8.50.20141228/gdb/i386-tdep.c
Index: gdb-7.9.50.20150520/gdb/i386-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/i386-tdep.c 2015-01-05 22:18:56.002023671 +0100
+++ gdb-7.8.50.20141228/gdb/i386-tdep.c 2015-01-05 22:19:08.092078467 +0100
@@ -2643,7 +2643,7 @@ i386_push_dummy_call (struct gdbarch *gd
--- gdb-7.9.50.20150520.orig/gdb/i386-tdep.c 2015-05-31 17:15:01.082868198 +0200
+++ gdb-7.9.50.20150520/gdb/i386-tdep.c 2015-05-31 17:15:03.430882915 +0200
@@ -2651,7 +2651,7 @@ i386_push_dummy_call (struct gdbarch *gd
gdb_byte buf[4];
int i;
int write_pass;
@ -489,7 +489,7 @@ Index: gdb-7.8.50.20141228/gdb/i386-tdep.c
/* Determine the total space required for arguments and struct
return address in a first pass (allowing for 16-byte-aligned
@@ -2651,7 +2651,7 @@ i386_push_dummy_call (struct gdbarch *gd
@@ -2659,7 +2659,7 @@ i386_push_dummy_call (struct gdbarch *gd
for (write_pass = 0; write_pass < 2; write_pass++)
{
@ -498,7 +498,7 @@ Index: gdb-7.8.50.20141228/gdb/i386-tdep.c
if (struct_return)
{
@@ -2668,7 +2668,7 @@ i386_push_dummy_call (struct gdbarch *gd
@@ -2676,7 +2676,7 @@ i386_push_dummy_call (struct gdbarch *gd
for (i = 0; i < nargs; i++)
{
@ -507,7 +507,7 @@ Index: gdb-7.8.50.20141228/gdb/i386-tdep.c
if (write_pass)
{
@@ -2875,7 +2875,7 @@ i386_reg_struct_return_p (struct gdbarch
@@ -2883,7 +2883,7 @@ i386_reg_struct_return_p (struct gdbarch
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
enum type_code code = TYPE_CODE (type);
@ -516,7 +516,7 @@ Index: gdb-7.8.50.20141228/gdb/i386-tdep.c
gdb_assert (code == TYPE_CODE_STRUCT
|| code == TYPE_CODE_UNION
@@ -3621,7 +3621,7 @@ static int
@@ -3629,7 +3629,7 @@ static int
i386_convert_register_p (struct gdbarch *gdbarch,
int regnum, struct type *type)
{
@ -525,7 +525,7 @@ Index: gdb-7.8.50.20141228/gdb/i386-tdep.c
/* Values may be spread across multiple registers. Most debugging
formats aren't expressive enough to specify the locations, so
@@ -3654,7 +3654,7 @@ i386_register_to_value (struct frame_inf
@@ -3662,7 +3662,7 @@ i386_register_to_value (struct frame_inf
int *optimizedp, int *unavailablep)
{
struct gdbarch *gdbarch = get_frame_arch (frame);
@ -534,7 +534,7 @@ Index: gdb-7.8.50.20141228/gdb/i386-tdep.c
if (i386_fp_regnum_p (gdbarch, regnum))
return i387_register_to_value (frame, regnum, type, to,
@@ -3690,7 +3690,7 @@ static void
@@ -3698,7 +3698,7 @@ static void
i386_value_to_register (struct frame_info *frame, int regnum,
struct type *type, const gdb_byte *from)
{
@ -543,11 +543,11 @@ Index: gdb-7.8.50.20141228/gdb/i386-tdep.c
if (i386_fp_regnum_p (get_frame_arch (frame), regnum))
{
Index: gdb-7.8.50.20141228/gdb/iq2000-tdep.c
Index: gdb-7.9.50.20150520/gdb/iq2000-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/iq2000-tdep.c 2015-01-05 22:18:56.003023675 +0100
+++ gdb-7.8.50.20141228/gdb/iq2000-tdep.c 2015-01-05 22:19:08.092078467 +0100
@@ -653,8 +653,9 @@ iq2000_push_dummy_call (struct gdbarch *
--- gdb-7.9.50.20150520.orig/gdb/iq2000-tdep.c 2015-05-31 17:15:01.083868204 +0200
+++ gdb-7.9.50.20150520/gdb/iq2000-tdep.c 2015-05-31 17:15:03.431882922 +0200
@@ -651,8 +651,9 @@ iq2000_push_dummy_call (struct gdbarch *
const bfd_byte *val;
bfd_byte buf[4];
struct type *type;
@ -559,10 +559,10 @@ Index: gdb-7.8.50.20141228/gdb/iq2000-tdep.c
/* Used to copy struct arguments into the stack. */
CORE_ADDR struct_ptr;
Index: gdb-7.8.50.20141228/gdb/m32r-tdep.c
Index: gdb-7.9.50.20150520/gdb/m32r-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/m32r-tdep.c 2015-01-05 22:18:56.003023675 +0100
+++ gdb-7.8.50.20141228/gdb/m32r-tdep.c 2015-01-05 22:19:08.093078472 +0100
--- gdb-7.9.50.20150520.orig/gdb/m32r-tdep.c 2015-05-31 17:15:01.083868204 +0200
+++ gdb-7.9.50.20150520/gdb/m32r-tdep.c 2015-05-31 17:15:03.431882922 +0200
@@ -687,7 +687,7 @@ m32r_push_dummy_call (struct gdbarch *gd
CORE_ADDR regval;
gdb_byte *val;
@ -572,10 +572,10 @@ Index: gdb-7.8.50.20141228/gdb/m32r-tdep.c
/* First force sp to a 4-byte alignment. */
sp = sp & ~3;
Index: gdb-7.8.50.20141228/gdb/m68k-tdep.c
Index: gdb-7.9.50.20150520/gdb/m68k-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/m68k-tdep.c 2015-01-05 22:18:56.003023675 +0100
+++ gdb-7.8.50.20141228/gdb/m68k-tdep.c 2015-01-05 22:19:08.093078472 +0100
--- gdb-7.9.50.20150520.orig/gdb/m68k-tdep.c 2015-05-31 17:15:01.084868210 +0200
+++ gdb-7.9.50.20150520/gdb/m68k-tdep.c 2015-05-31 17:15:03.432882928 +0200
@@ -382,7 +382,7 @@ m68k_reg_struct_return_p (struct gdbarch
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
@ -598,10 +598,10 @@ Index: gdb-7.8.50.20141228/gdb/m68k-tdep.c
/* Non-scalars bigger than 4 bytes are left aligned, others are
right aligned. */
Index: gdb-7.8.50.20141228/gdb/m88k-tdep.c
Index: gdb-7.9.50.20150520/gdb/m88k-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/m88k-tdep.c 2015-01-05 22:18:56.004023680 +0100
+++ gdb-7.8.50.20141228/gdb/m88k-tdep.c 2015-01-05 22:19:08.093078472 +0100
--- gdb-7.9.50.20150520.orig/gdb/m88k-tdep.c 2015-05-31 17:15:01.085868217 +0200
+++ gdb-7.9.50.20150520/gdb/m88k-tdep.c 2015-05-31 17:15:03.432882928 +0200
@@ -257,13 +257,13 @@ m88k_store_arguments (struct regcache *r
{
struct gdbarch *gdbarch = get_regcache_arch (regcache);
@ -629,10 +629,10 @@ Index: gdb-7.8.50.20141228/gdb/m88k-tdep.c
if (m88k_in_register_p (type))
{
Index: gdb-7.8.50.20141228/gdb/mep-tdep.c
Index: gdb-7.9.50.20150520/gdb/mep-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/mep-tdep.c 2015-01-05 22:18:56.005023684 +0100
+++ gdb-7.8.50.20141228/gdb/mep-tdep.c 2015-01-05 22:19:08.093078472 +0100
--- gdb-7.9.50.20150520.orig/gdb/mep-tdep.c 2015-05-31 17:15:01.086868223 +0200
+++ gdb-7.9.50.20150520/gdb/mep-tdep.c 2015-05-31 17:15:03.433882934 +0200
@@ -2269,7 +2269,7 @@ push_large_arguments (CORE_ADDR sp, int
for (i = 0; i < argc; i++)
@ -642,10 +642,10 @@ Index: gdb-7.8.50.20141228/gdb/mep-tdep.c
if (arg_len > MEP_GPR_SIZE)
{
Index: gdb-7.8.50.20141228/gdb/mips-tdep.c
Index: gdb-7.9.50.20150520/gdb/mips-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/mips-tdep.c 2015-01-05 22:18:56.009023702 +0100
+++ gdb-7.8.50.20141228/gdb/mips-tdep.c 2015-01-05 22:19:08.095078481 +0100
--- gdb-7.9.50.20150520.orig/gdb/mips-tdep.c 2015-05-31 17:15:01.094868273 +0200
+++ gdb-7.9.50.20150520/gdb/mips-tdep.c 2015-05-31 17:15:03.435882947 +0200
@@ -455,7 +455,7 @@ static void
mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache,
int reg_num, int length,
@ -791,10 +791,10 @@ Index: gdb-7.8.50.20141228/gdb/mips-tdep.c
val = value_contents (arg);
Index: gdb-7.8.50.20141228/gdb/mn10300-tdep.c
Index: gdb-7.9.50.20150520/gdb/mn10300-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/mn10300-tdep.c 2015-01-05 22:18:56.010023707 +0100
+++ gdb-7.8.50.20141228/gdb/mn10300-tdep.c 2015-01-05 22:19:08.096078485 +0100
--- gdb-7.9.50.20150520.orig/gdb/mn10300-tdep.c 2015-05-31 17:15:01.095868279 +0200
+++ gdb-7.9.50.20150520/gdb/mn10300-tdep.c 2015-05-31 17:15:03.435882947 +0200
@@ -1225,7 +1225,7 @@ mn10300_push_dummy_call (struct gdbarch
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
const int push_size = register_size (gdbarch, E_PC_REGNUM);
@ -804,10 +804,10 @@ Index: gdb-7.8.50.20141228/gdb/mn10300-tdep.c
int stack_offset = 0;
int argnum;
const gdb_byte *val;
Index: gdb-7.8.50.20141228/gdb/mt-tdep.c
Index: gdb-7.9.50.20150520/gdb/mt-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/mt-tdep.c 2015-01-05 22:18:56.010023707 +0100
+++ gdb-7.8.50.20141228/gdb/mt-tdep.c 2015-01-05 22:19:08.096078485 +0100
--- gdb-7.9.50.20150520.orig/gdb/mt-tdep.c 2015-05-31 17:15:01.096868286 +0200
+++ gdb-7.9.50.20150520/gdb/mt-tdep.c 2015-05-31 17:15:03.436882953 +0200
@@ -781,9 +781,9 @@ mt_push_dummy_call (struct gdbarch *gdba
gdb_byte buf[MT_MAX_STRUCT_SIZE];
int argreg = MT_1ST_ARGREG;
@ -820,10 +820,10 @@ Index: gdb-7.8.50.20141228/gdb/mt-tdep.c
int i, j;
/* First handle however many args we can fit into MT_1ST_ARGREG thru
Index: gdb-7.8.50.20141228/gdb/ppc-sysv-tdep.c
Index: gdb-7.9.50.20150520/gdb/ppc-sysv-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/ppc-sysv-tdep.c 2015-01-05 22:18:56.011023711 +0100
+++ gdb-7.8.50.20141228/gdb/ppc-sysv-tdep.c 2015-01-05 22:19:08.096078485 +0100
--- gdb-7.9.50.20150520.orig/gdb/ppc-sysv-tdep.c 2015-05-31 17:15:01.097868292 +0200
+++ gdb-7.9.50.20150520/gdb/ppc-sysv-tdep.c 2015-05-31 17:15:03.436882953 +0200
@@ -66,7 +66,7 @@ ppc_sysv_abi_push_dummy_call (struct gdb
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
int opencl_abi = ppc_sysv_use_opencl_abi (value_type (function));
@ -868,11 +868,11 @@ Index: gdb-7.8.50.20141228/gdb/ppc-sysv-tdep.c
/* Enforce alignment of stack location, if requested. */
if (align > tdep->wordsize)
Index: gdb-7.8.50.20141228/gdb/rl78-tdep.c
Index: gdb-7.9.50.20150520/gdb/rl78-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/rl78-tdep.c 2015-01-05 22:18:56.011023711 +0100
+++ gdb-7.8.50.20141228/gdb/rl78-tdep.c 2015-01-05 22:19:08.096078485 +0100
@@ -1251,8 +1251,8 @@ rl78_push_dummy_call (struct gdbarch *gd
--- gdb-7.9.50.20150520.orig/gdb/rl78-tdep.c 2015-05-31 17:15:01.097868292 +0200
+++ gdb-7.9.50.20150520/gdb/rl78-tdep.c 2015-05-31 17:15:03.437882959 +0200
@@ -1333,8 +1333,8 @@ rl78_push_dummy_call (struct gdbarch *gd
for (i = nargs - 1; i >= 0; i--)
{
struct type *value_type = value_enclosing_type (args[i]);
@ -883,10 +883,10 @@ Index: gdb-7.8.50.20141228/gdb/rl78-tdep.c
sp -= container_len;
write_memory (rl78_make_data_address (sp),
Index: gdb-7.8.50.20141228/gdb/rs6000-aix-tdep.c
Index: gdb-7.9.50.20150520/gdb/rs6000-aix-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/rs6000-aix-tdep.c 2015-01-05 22:18:56.012023716 +0100
+++ gdb-7.8.50.20141228/gdb/rs6000-aix-tdep.c 2015-01-05 22:19:08.097078490 +0100
--- gdb-7.9.50.20150520.orig/gdb/rs6000-aix-tdep.c 2015-05-31 17:15:01.098868298 +0200
+++ gdb-7.9.50.20150520/gdb/rs6000-aix-tdep.c 2015-05-31 17:15:03.437882959 +0200
@@ -186,9 +186,9 @@ rs6000_push_dummy_call (struct gdbarch *
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
@ -908,32 +908,32 @@ Index: gdb-7.8.50.20141228/gdb/rs6000-aix-tdep.c
if (argbytes)
{
Index: gdb-7.8.50.20141228/gdb/s390-linux-tdep.c
Index: gdb-7.9.50.20150520/gdb/s390-linux-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/s390-linux-tdep.c 2015-01-05 22:18:56.013023720 +0100
+++ gdb-7.8.50.20141228/gdb/s390-linux-tdep.c 2015-01-05 22:19:08.097078490 +0100
@@ -2334,7 +2334,7 @@ is_float_like (struct type *type)
--- gdb-7.9.50.20150520.orig/gdb/s390-linux-tdep.c 2015-05-31 17:15:01.099868304 +0200
+++ gdb-7.9.50.20150520/gdb/s390-linux-tdep.c 2015-05-31 17:16:13.285320769 +0200
@@ -2463,7 +2463,7 @@ s390_function_arg_vector (struct type *t
/* Determine whether N is a power of two. */
static int
-is_power_of_two (unsigned int n)
+is_power_of_two (ULONGEST n)
{
return ((n & (n - 1)) == 0);
return n && ((n & (n - 1)) == 0);
}
@@ -2520,7 +2520,7 @@ s390_push_dummy_call (struct gdbarch *gd
{
struct value *arg = args[i];
struct type *type = check_typedef (value_type (arg));
- unsigned length = TYPE_LENGTH (type);
+ ULONGEST length = TYPE_LENGTH (type);
@@ -2520,7 +2520,7 @@ s390_handle_arg (struct s390_arg_state *
enum bfd_endian byte_order, int is_unnamed)
{
struct type *type = check_typedef (value_type (arg));
- unsigned int length = TYPE_LENGTH (type);
+ ULONGEST length = TYPE_LENGTH (type);
int write_mode = as->regcache != NULL;
if (s390_function_arg_pass_by_reference (type))
{
Index: gdb-7.8.50.20141228/gdb/score-tdep.c
if (s390_function_arg_float (type))
Index: gdb-7.9.50.20150520/gdb/score-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/score-tdep.c 2015-01-05 22:18:56.013023720 +0100
+++ gdb-7.8.50.20141228/gdb/score-tdep.c 2015-01-05 22:19:08.097078490 +0100
--- gdb-7.9.50.20150520.orig/gdb/score-tdep.c 2015-05-31 17:15:01.100868311 +0200
+++ gdb-7.9.50.20150520/gdb/score-tdep.c 2015-05-31 17:15:03.439882972 +0200
@@ -514,7 +514,7 @@ score_push_dummy_call (struct gdbarch *g
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
int argnum;
@ -943,10 +943,10 @@ Index: gdb-7.8.50.20141228/gdb/score-tdep.c
CORE_ADDR stack_offset = 0;
CORE_ADDR addr = 0;
Index: gdb-7.8.50.20141228/gdb/sh-tdep.c
Index: gdb-7.9.50.20150520/gdb/sh-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/sh-tdep.c 2015-01-05 22:18:56.014023725 +0100
+++ gdb-7.8.50.20141228/gdb/sh-tdep.c 2015-01-05 22:19:08.098078494 +0100
--- gdb-7.9.50.20150520.orig/gdb/sh-tdep.c 2015-05-31 17:15:01.101868317 +0200
+++ gdb-7.9.50.20150520/gdb/sh-tdep.c 2015-05-31 17:15:03.439882972 +0200
@@ -805,7 +805,7 @@ sh_skip_prologue (struct gdbarch *gdbarc
static int
sh_use_struct_convention (int renesas_abi, struct type *type)
@ -985,10 +985,10 @@ Index: gdb-7.8.50.20141228/gdb/sh-tdep.c
int pass_on_stack = 0;
int last_reg_arg = INT_MAX;
Index: gdb-7.8.50.20141228/gdb/sh64-tdep.c
Index: gdb-7.9.50.20150520/gdb/sh64-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/sh64-tdep.c 2015-01-05 22:18:56.015023729 +0100
+++ gdb-7.8.50.20141228/gdb/sh64-tdep.c 2015-01-05 22:19:08.098078494 +0100
--- gdb-7.9.50.20150520.orig/gdb/sh64-tdep.c 2015-05-31 17:15:01.102868323 +0200
+++ gdb-7.9.50.20150520/gdb/sh64-tdep.c 2015-05-31 17:15:03.440882978 +0200
@@ -1056,7 +1056,7 @@ sh64_push_dummy_call (struct gdbarch *gd
CORE_ADDR struct_addr)
{
@ -1007,10 +1007,10 @@ Index: gdb-7.8.50.20141228/gdb/sh64-tdep.c
int argreg_size;
int fp_args[12];
Index: gdb-7.8.50.20141228/gdb/sparc-tdep.c
Index: gdb-7.9.50.20150520/gdb/sparc-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/sparc-tdep.c 2015-01-05 22:18:56.016023734 +0100
+++ gdb-7.8.50.20141228/gdb/sparc-tdep.c 2015-01-05 22:19:08.098078494 +0100
--- gdb-7.9.50.20150520.orig/gdb/sparc-tdep.c 2015-05-31 17:15:01.103868329 +0200
+++ gdb-7.9.50.20150520/gdb/sparc-tdep.c 2015-05-31 17:15:03.441882984 +0200
@@ -525,7 +525,7 @@ sparc32_store_arguments (struct regcache
for (i = 0; i < nargs; i++)
{
@ -1020,10 +1020,10 @@ Index: gdb-7.8.50.20141228/gdb/sparc-tdep.c
if (sparc_structure_or_union_p (type)
|| (sparc_floating_p (type) && len == 16)
Index: gdb-7.8.50.20141228/gdb/sparc64-tdep.c
Index: gdb-7.9.50.20150520/gdb/sparc64-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/sparc64-tdep.c 2015-01-05 22:18:56.016023734 +0100
+++ gdb-7.8.50.20141228/gdb/sparc64-tdep.c 2015-01-05 22:19:08.099078499 +0100
--- gdb-7.9.50.20150520.orig/gdb/sparc64-tdep.c 2015-05-31 17:15:01.104868336 +0200
+++ gdb-7.9.50.20150520/gdb/sparc64-tdep.c 2015-05-31 17:15:03.441882984 +0200
@@ -636,7 +636,8 @@ sparc64_16_byte_align_p (struct type *ty
static void
@ -1079,10 +1079,10 @@ Index: gdb-7.8.50.20141228/gdb/sparc64-tdep.c
int regnum = -1;
gdb_byte buf[16];
Index: gdb-7.8.50.20141228/gdb/spu-tdep.c
Index: gdb-7.9.50.20150520/gdb/spu-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/spu-tdep.c 2015-01-05 22:18:56.017023739 +0100
+++ gdb-7.8.50.20141228/gdb/spu-tdep.c 2015-01-05 22:19:08.099078499 +0100
--- gdb-7.9.50.20150520.orig/gdb/spu-tdep.c 2015-05-31 17:15:01.105868342 +0200
+++ gdb-7.9.50.20150520/gdb/spu-tdep.c 2015-05-31 17:15:03.442882990 +0200
@@ -1430,7 +1430,7 @@ spu_push_dummy_call (struct gdbarch *gdb
struct value *arg = args[i];
struct type *type = check_typedef (value_type (arg));
@ -1101,10 +1101,10 @@ Index: gdb-7.8.50.20141228/gdb/spu-tdep.c
int preferred_slot;
if (spu_scalar_value_p (type))
Index: gdb-7.8.50.20141228/gdb/tic6x-tdep.c
Index: gdb-7.9.50.20150520/gdb/tic6x-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/tic6x-tdep.c 2015-01-05 22:18:56.018023743 +0100
+++ gdb-7.8.50.20141228/gdb/tic6x-tdep.c 2015-01-05 22:19:08.099078499 +0100
--- gdb-7.9.50.20150520.orig/gdb/tic6x-tdep.c 2015-05-31 17:15:01.106868348 +0200
+++ gdb-7.9.50.20150520/gdb/tic6x-tdep.c 2015-05-31 17:15:03.442882990 +0200
@@ -895,7 +895,7 @@ tic6x_push_dummy_call (struct gdbarch *g
int argreg = 0;
int argnum;
@ -1142,10 +1142,10 @@ Index: gdb-7.8.50.20141228/gdb/tic6x-tdep.c
addr = sp + stack_offset;
write_memory (addr, val, len);
Index: gdb-7.8.50.20141228/gdb/tilegx-tdep.c
Index: gdb-7.9.50.20150520/gdb/tilegx-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/tilegx-tdep.c 2015-01-05 22:18:56.018023743 +0100
+++ gdb-7.8.50.20141228/gdb/tilegx-tdep.c 2015-01-05 22:19:08.100078503 +0100
--- gdb-7.9.50.20150520.orig/gdb/tilegx-tdep.c 2015-05-31 17:15:01.107868355 +0200
+++ gdb-7.9.50.20150520/gdb/tilegx-tdep.c 2015-05-31 17:15:03.442882990 +0200
@@ -288,7 +288,7 @@ tilegx_push_dummy_call (struct gdbarch *
CORE_ADDR stack_dest = sp;
int argreg = TILEGX_R0_REGNUM;
@ -1155,10 +1155,10 @@ Index: gdb-7.8.50.20141228/gdb/tilegx-tdep.c
static const gdb_byte four_zero_words[16] = { 0 };
/* If struct_return is 1, then the struct return address will
Index: gdb-7.8.50.20141228/gdb/v850-tdep.c
Index: gdb-7.9.50.20150520/gdb/v850-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/v850-tdep.c 2015-01-05 22:18:56.019023748 +0100
+++ gdb-7.8.50.20141228/gdb/v850-tdep.c 2015-01-05 22:19:08.100078503 +0100
--- gdb-7.9.50.20150520.orig/gdb/v850-tdep.c 2015-05-31 17:15:01.107868355 +0200
+++ gdb-7.9.50.20150520/gdb/v850-tdep.c 2015-05-31 17:15:03.443882997 +0200
@@ -1019,7 +1019,7 @@ v850_push_dummy_call (struct gdbarch *gd
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
int argreg;
@ -1177,10 +1177,10 @@ Index: gdb-7.8.50.20141228/gdb/v850-tdep.c
gdb_byte *val;
gdb_byte valbuf[v850_reg_size];
Index: gdb-7.8.50.20141228/gdb/vax-tdep.c
Index: gdb-7.9.50.20150520/gdb/vax-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/vax-tdep.c 2015-01-05 22:18:56.019023748 +0100
+++ gdb-7.8.50.20141228/gdb/vax-tdep.c 2015-01-05 22:19:08.100078503 +0100
--- gdb-7.9.50.20150520.orig/gdb/vax-tdep.c 2015-05-31 17:15:01.108868361 +0200
+++ gdb-7.9.50.20150520/gdb/vax-tdep.c 2015-05-31 17:15:03.443882997 +0200
@@ -111,7 +111,7 @@ vax_store_arguments (struct regcache *re
struct gdbarch *gdbarch = get_regcache_arch (regcache);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
@ -1199,10 +1199,10 @@ Index: gdb-7.8.50.20141228/gdb/vax-tdep.c
sp -= (len + 3) & ~3;
count += (len + 3) / 4;
Index: gdb-7.8.50.20141228/gdb/xstormy16-tdep.c
Index: gdb-7.9.50.20150520/gdb/xstormy16-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/xstormy16-tdep.c 2015-01-05 22:18:56.020023752 +0100
+++ gdb-7.8.50.20141228/gdb/xstormy16-tdep.c 2015-01-05 22:19:08.100078503 +0100
--- gdb-7.9.50.20150520.orig/gdb/xstormy16-tdep.c 2015-05-31 17:15:01.108868361 +0200
+++ gdb-7.9.50.20150520/gdb/xstormy16-tdep.c 2015-05-31 17:15:03.443882997 +0200
@@ -233,8 +233,9 @@ xstormy16_push_dummy_call (struct gdbarc
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
CORE_ADDR stack_dest = sp;
@ -1215,10 +1215,10 @@ Index: gdb-7.8.50.20141228/gdb/xstormy16-tdep.c
const gdb_byte *val;
gdb_byte buf[xstormy16_pc_size];
Index: gdb-7.8.50.20141228/gdb/xtensa-tdep.c
Index: gdb-7.9.50.20150520/gdb/xtensa-tdep.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/xtensa-tdep.c 2015-01-05 22:18:56.021023757 +0100
+++ gdb-7.8.50.20141228/gdb/xtensa-tdep.c 2015-01-05 22:19:08.101078508 +0100
--- gdb-7.9.50.20150520.orig/gdb/xtensa-tdep.c 2015-05-31 17:15:01.110868373 +0200
+++ gdb-7.9.50.20150520/gdb/xtensa-tdep.c 2015-05-31 17:15:03.444883003 +0200
@@ -1646,8 +1646,7 @@ xtensa_store_return_value (struct type *
if (len > (callsize > 8 ? 8 : 16))

View File

@ -1,106 +0,0 @@
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

View File

@ -1,53 +0,0 @@
commit 7a270e0c9ba0eb738a4c30258ab29c09963fcd4d
Author: Alexander Klimov <alserkli@inbox.ru>
Date: Tue Jan 27 19:56:45 2015 +0200
Fix build failure in symfile.c::unmap_overlay_command (GCC5 bug)
Compilation of (GDB) 7.9.50.20150127-cvs with (GCC) 5.0.0 20150127
fails with
In file included from symfile.c:32:0:
symfile.c: In function 'unmap_overlay_command':
objfiles.h:628:3: error: 'sec' may be used uninitialized in this
function [-Werror=maybe-uninitialized]
for (osect = objfile->sections; osect < objfile->sections_end; osect++) \
^
symfile.c:3442:23: note: 'sec' was declared here
struct obj_section *sec;
^
cc1: all warnings being treated as errors
make[2]: *** [symfile.o] Error 1
make[2]: Leaving directory `gdb/gdb'
While the bug was reported to GCC as
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64823>,
the attached patch simply initializes sec with NULL.
gdb/ChangeLog:
* symfile.c (unmap_overlay_command): Initialize sec to NULL.
Tested on x86_64-linux.
### a/gdb/ChangeLog
### b/gdb/ChangeLog
## -1,3 +1,7 @@
+2015-01-29 Joel Brobecker <brobecker@adacore.com> (tiny patch)
+
+ * symfile.c (unmap_overlay_command): Initialize sec to NULL.
+
2015-01-27 Doug Evans <dje@google.com>
* NEWS: Mention gdb.Objfile.username.
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -3439,7 +3439,7 @@ static void
unmap_overlay_command (char *args, int from_tty)
{
struct objfile *objfile;
- struct obj_section *sec;
+ struct obj_section *sec = NULL;
if (!overlay_debugging)
error (_("Overlay debugging not enabled. "

View File

@ -31,30 +31,30 @@ Jan
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline; filename="vlastringonly.patch"
Index: gdb-7.8.50.20141228/gdb/gdbtypes.c
Index: gdb-7.9.50.20150520/gdb/gdbtypes.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/gdbtypes.c 2015-01-08 18:15:18.475682523 +0100
+++ gdb-7.8.50.20141228/gdb/gdbtypes.c 2015-01-08 18:39:01.423134700 +0100
@@ -1684,6 +1684,7 @@ is_dynamic_type_internal (struct type *t
return !has_static_range (TYPE_RANGE_DATA (type));
--- gdb-7.9.50.20150520.orig/gdb/gdbtypes.c 2015-05-31 16:14:04.164533833 +0200
+++ gdb-7.9.50.20150520/gdb/gdbtypes.c 2015-05-31 16:14:05.844545344 +0200
@@ -1851,6 +1851,7 @@ is_dynamic_type_internal (struct type *t
}
case TYPE_CODE_ARRAY:
+ case TYPE_CODE_STRING:
{
gdb_assert (TYPE_NFIELDS (type) == 1);
@@ -1992,6 +1993,7 @@ resolve_dynamic_type_internal (struct ty
@@ -2192,6 +2193,7 @@ resolve_dynamic_type_internal (struct ty
}
case TYPE_CODE_ARRAY:
+ case TYPE_CODE_STRING:
resolved_type = resolve_dynamic_array (type, addr);
resolved_type = resolve_dynamic_array (type, addr_stack);
break;
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 2015-01-08 18:15:18.897684435 +0100
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 2015-05-31 16:14:05.844545344 +0200
@@ -0,0 +1,24 @@
+! Copyright 2010 Free Software Foundation, Inc.
+!
@ -80,10 +80,10 @@ Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f9
+ real :: dummy
+ dummy = 1
+end subroutine bar
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp 2015-01-08 18:15:18.897684435 +0100
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp 2015-05-31 16:14:05.845545351 +0200
@@ -0,0 +1,39 @@
+# Copyright 2010 Free Software Foundation, Inc.
+
@ -124,10 +124,10 @@ Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
+}
+
+gdb_test "bt" {foo \(string='hello'.*}
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 2015-01-08 18:15:18.897684435 +0100
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 2015-05-31 16:14:05.845545351 +0200
@@ -0,0 +1,36 @@
+! Copyright 2010 Free Software Foundation, Inc.
+!
@ -165,3 +165,17 @@ Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
+ end interface
+ call foo ('hello')
+end
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-strings.exp
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/testsuite/gdb.fortran/vla-strings.exp 2015-05-31 16:14:04.167533854 +0200
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-strings.exp 2015-05-31 16:14:31.073718201 +0200
@@ -33,9 +33,6 @@ gdb_continue_to_breakpoint "var_char-all
gdb_test "print var_char" \
" = \\(PTR TO -> \\( character\\*10 \\)\\) ${hex}" \
"print var_char after allocated first time"
-gdb_test "print *var_char" \
- " = '\\\\000\\\\000\\\\000\\\\000\\\\000\\\\000\\\\000\\\\000\\\\000\\\\000'" \
- "print *var_char after allocated first time"
gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*10 \\)" \
"whatis var_char first time"
gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*10 \\)" \

View File

@ -6,10 +6,10 @@ GIT snapshot:
commit 511bff520372ffc10fa2ff569c176bdf1e6e475d
Index: gdb-7.8.90.20150126/gdb/c-valprint.c
Index: gdb-7.9.50.20150520/gdb/c-valprint.c
===================================================================
--- gdb-7.8.90.20150126.orig/gdb/c-valprint.c 2015-01-26 07:47:25.832758314 +0100
+++ gdb-7.8.90.20150126/gdb/c-valprint.c 2015-01-26 07:47:42.394829861 +0100
--- gdb-7.9.50.20150520.orig/gdb/c-valprint.c 2015-05-29 08:27:02.657717326 +0200
+++ gdb-7.9.50.20150520/gdb/c-valprint.c 2015-05-29 08:27:06.253740209 +0200
@@ -537,7 +537,16 @@ c_value_print (struct value *val, struct
{
/* normal case */
@ -28,12 +28,12 @@ Index: gdb-7.8.90.20150126/gdb/c-valprint.c
fprintf_filtered (stream, ") ");
}
}
Index: gdb-7.8.90.20150126/gdb/dwarf2loc.h
Index: gdb-7.9.50.20150520/gdb/dwarf2loc.h
===================================================================
--- gdb-7.8.90.20150126.orig/gdb/dwarf2loc.h 2015-01-26 07:47:25.832758314 +0100
+++ gdb-7.8.90.20150126/gdb/dwarf2loc.h 2015-01-26 07:47:42.395829865 +0100
@@ -111,6 +111,11 @@ int dwarf2_evaluate_property (const stru
CORE_ADDR address,
--- gdb-7.9.50.20150520.orig/gdb/dwarf2loc.h 2015-05-29 08:27:02.658717333 +0200
+++ gdb-7.9.50.20150520/gdb/dwarf2loc.h 2015-05-29 08:27:06.253740209 +0200
@@ -131,6 +131,11 @@ int dwarf2_evaluate_property (const stru
struct property_addr_info *addr_stack,
CORE_ADDR *value);
+/* Checks if a dwarf location definition is valid.
@ -44,11 +44,11 @@ Index: gdb-7.8.90.20150126/gdb/dwarf2loc.h
/* A helper for the compiler interface that compiles a single dynamic
property to C code.
Index: gdb-7.8.90.20150126/gdb/dwarf2read.c
Index: gdb-7.9.50.20150520/gdb/dwarf2read.c
===================================================================
--- gdb-7.8.90.20150126.orig/gdb/dwarf2read.c 2015-01-26 07:47:25.845758371 +0100
+++ gdb-7.8.90.20150126/gdb/dwarf2read.c 2015-01-26 07:48:05.833931116 +0100
@@ -1855,6 +1855,12 @@ static void process_cu_includes (void);
--- gdb-7.9.50.20150520.orig/gdb/dwarf2read.c 2015-05-29 08:27:02.676717447 +0200
+++ gdb-7.9.50.20150520/gdb/dwarf2read.c 2015-05-29 10:04:52.272600212 +0200
@@ -1868,6 +1868,12 @@ static void process_cu_includes (void);
static void check_producer (struct dwarf2_cu *cu);
static void free_line_header_voidp (void *arg);
@ -61,7 +61,7 @@ Index: gdb-7.8.90.20150126/gdb/dwarf2read.c
/* Various complaints about symbol reading that don't abort the process. */
@@ -14354,29 +14360,92 @@ read_tag_string_type (struct die_info *d
@@ -14431,29 +14437,92 @@ read_tag_string_type (struct die_info *d
struct gdbarch *gdbarch = get_objfile_arch (objfile);
struct type *type, *range_type, *index_type, *char_type;
struct attribute *attr;
@ -161,7 +161,7 @@ Index: gdb-7.8.90.20150126/gdb/dwarf2read.c
char_type = language_string_char_type (cu->language_defn, gdbarch);
type = create_string_type (NULL, char_type, range_type);
@@ -14693,13 +14762,15 @@ read_base_type (struct die_info *die, st
@@ -14776,13 +14845,15 @@ read_base_type (struct die_info *die, st
return set_die_type (die, type, cu);
}
@ -178,7 +178,7 @@ Index: gdb-7.8.90.20150126/gdb/dwarf2read.c
{
struct dwarf2_property_baton *baton;
struct obstack *obstack = &cu->objfile->objfile_obstack;
@@ -14712,8 +14783,25 @@ attr_to_dynamic_prop (const struct attri
@@ -14795,8 +14866,25 @@ attr_to_dynamic_prop (const struct attri
baton = obstack_alloc (obstack, sizeof (*baton));
baton->referenced_type = NULL;
baton->locexpr.per_cu = cu->per_cu;
@ -206,38 +206,38 @@ Index: gdb-7.8.90.20150126/gdb/dwarf2read.c
prop->data.baton = baton;
prop->kind = PROP_LOCEXPR;
gdb_assert (prop->data.baton != NULL);
@@ -14743,8 +14831,28 @@ attr_to_dynamic_prop (const struct attri
baton = obstack_alloc (obstack, sizeof (*baton));
baton->referenced_type = die_type (target_die, target_cu);
baton->locexpr.per_cu = cu->per_cu;
- baton->locexpr.size = DW_BLOCK (target_attr)->size;
- baton->locexpr.data = DW_BLOCK (target_attr)->data;
@@ -14832,8 +14920,28 @@ attr_to_dynamic_prop (const struct attri
baton = obstack_alloc (obstack, sizeof (*baton));
baton->referenced_type = die_type (target_die, target_cu);
baton->locexpr.per_cu = cu->per_cu;
- baton->locexpr.size = DW_BLOCK (target_attr)->size;
- baton->locexpr.data = DW_BLOCK (target_attr)->data;
+
+ if (additional_data != NULL && additional_data_size > 0)
+ {
+ gdb_byte *data;
+ if (additional_data != NULL && additional_data_size > 0)
+ {
+ gdb_byte *data;
+
+ data = obstack_alloc (&cu->objfile->objfile_obstack,
+ DW_BLOCK (target_attr)->size + additional_data_size);
+ memcpy (data, DW_BLOCK (target_attr)->data,
+ DW_BLOCK (target_attr)->size);
+ memcpy (data + DW_BLOCK (target_attr)->size,
+ additional_data, additional_data_size);
+ data = obstack_alloc (&cu->objfile->objfile_obstack,
+ DW_BLOCK (target_attr)->size + additional_data_size);
+ memcpy (data, DW_BLOCK (target_attr)->data,
+ DW_BLOCK (target_attr)->size);
+ memcpy (data + DW_BLOCK (target_attr)->size,
+ additional_data, additional_data_size);
+
+ baton->locexpr.data = data;
+ baton->locexpr.size = (DW_BLOCK (target_attr)->size
+ + additional_data_size);
+ }
+ else
+ {
+ baton->locexpr.data = DW_BLOCK (target_attr)->data;
+ baton->locexpr.size = DW_BLOCK (target_attr)->size;
+ }
+ baton->locexpr.data = data;
+ baton->locexpr.size = (DW_BLOCK (target_attr)->size
+ + additional_data_size);
+ }
+ else
+ {
+ baton->locexpr.data = DW_BLOCK (target_attr)->data;
+ baton->locexpr.size = DW_BLOCK (target_attr)->size;
+ }
+
prop->data.baton = baton;
prop->kind = PROP_LOCEXPR;
gdb_assert (prop->data.baton != NULL);
@@ -14779,7 +14887,7 @@ read_subrange_type (struct die_info *die
prop->data.baton = baton;
prop->kind = PROP_LOCEXPR;
gdb_assert (prop->data.baton != NULL);
@@ -14887,7 +14995,7 @@ read_subrange_type (struct die_info *die
struct type *base_type, *orig_base_type;
struct type *range_type;
struct attribute *attr;
@ -246,7 +246,7 @@ Index: gdb-7.8.90.20150126/gdb/dwarf2read.c
int low_default_is_valid;
int high_bound_is_count = 0;
const char *name;
@@ -14799,7 +14907,9 @@ read_subrange_type (struct die_info *die
@@ -14907,7 +15015,9 @@ read_subrange_type (struct die_info *die
low.kind = PROP_CONST;
high.kind = PROP_CONST;
@ -256,7 +256,7 @@ Index: gdb-7.8.90.20150126/gdb/dwarf2read.c
/* Set LOW_DEFAULT_IS_VALID if current language and DWARF version allow
omitting DW_AT_lower_bound. */
@@ -14832,19 +14942,26 @@ read_subrange_type (struct die_info *die
@@ -14940,19 +15050,26 @@ read_subrange_type (struct die_info *die
break;
}
@ -286,7 +286,7 @@ Index: gdb-7.8.90.20150126/gdb/dwarf2read.c
{
/* If bounds are constant do the final calculation here. */
if (low.kind == PROP_CONST && high.kind == PROP_CONST)
@@ -14908,7 +15025,7 @@ read_subrange_type (struct die_info *die
@@ -15016,7 +15133,7 @@ read_subrange_type (struct die_info *die
&& !TYPE_UNSIGNED (base_type) && (high.data.const_val & negative_mask))
high.data.const_val |= negative_mask;
@ -295,18 +295,10 @@ Index: gdb-7.8.90.20150126/gdb/dwarf2read.c
if (high_bound_is_count)
TYPE_RANGE_DATA (range_type)->flag_upper_bound_is_count = 1;
@@ -21994,7 +22111,44 @@ set_die_type (struct die_info *die, stru
@@ -22128,9 +22245,37 @@ set_die_type (struct die_info *die, stru
&& !HAVE_GNAT_AUX_INFO (type))
INIT_GNAT_SPECIFIC (type);
/* Read DW_AT_data_location and set in type. */
attr = dwarf2_attr (die, DW_AT_data_location, cu);
- if (attr_to_dynamic_prop (attr, die, cu, &prop))
+ if (attr_to_dynamic_prop (attr, die, cu, &prop, NULL, 0))
+ {
+ TYPE_DATA_LOCATION (type)
+ = obstack_alloc (&objfile->objfile_obstack, sizeof (prop));
+ *TYPE_DATA_LOCATION (type) = prop;
+ }
+
+ /* Read DW_AT_allocated and set in type. */
+ attr = dwarf2_attr (die, DW_AT_allocated, cu);
+ if (attr_form_is_block (attr))
@ -335,16 +327,17 @@ Index: gdb-7.8.90.20150126/gdb/dwarf2read.c
+ }
+ }
+
+ /* Read DW_AT_data_location and set in type. */
+ attr = dwarf2_attr (die, DW_AT_data_location, cu);
/* Read DW_AT_data_location and set in type. */
attr = dwarf2_attr (die, DW_AT_data_location, cu);
- if (attr_to_dynamic_prop (attr, die, cu, &prop))
+ if (attr_to_dynamic_prop (attr, die, cu, &prop, NULL, 0))
{
TYPE_DATA_LOCATION (type)
= obstack_alloc (&objfile->objfile_obstack, sizeof (prop));
Index: gdb-7.8.90.20150126/gdb/f-typeprint.c
add_dyn_prop (DYN_PROP_DATA_LOCATION, prop, type, objfile);
if (dwarf2_per_objfile->die_type_hash == NULL)
Index: gdb-7.9.50.20150520/gdb/f-typeprint.c
===================================================================
--- gdb-7.8.90.20150126.orig/gdb/f-typeprint.c 2015-01-26 07:47:25.846758375 +0100
+++ gdb-7.8.90.20150126/gdb/f-typeprint.c 2015-01-26 07:47:42.402829895 +0100
--- gdb-7.9.50.20150520.orig/gdb/f-typeprint.c 2015-05-29 08:27:02.678717460 +0200
+++ gdb-7.9.50.20150520/gdb/f-typeprint.c 2015-05-29 08:27:06.261740260 +0200
@@ -30,6 +30,7 @@
#include "gdbcore.h"
#include "target.h"
@ -429,10 +422,10 @@ Index: gdb-7.8.90.20150126/gdb/f-typeprint.c
if (arrayprint_recurse_level == 1)
fprintf_filtered (stream, ")");
else
Index: gdb-7.8.90.20150126/gdb/f-valprint.c
Index: gdb-7.9.50.20150520/gdb/f-valprint.c
===================================================================
--- gdb-7.8.90.20150126.orig/gdb/f-valprint.c 2015-01-26 07:47:25.847758379 +0100
+++ gdb-7.8.90.20150126/gdb/f-valprint.c 2015-01-26 07:47:42.403829900 +0100
--- gdb-7.9.50.20150520.orig/gdb/f-valprint.c 2015-05-29 08:26:49.567634019 +0200
+++ gdb-7.9.50.20150520/gdb/f-valprint.c 2015-05-29 08:27:06.262740266 +0200
@@ -36,8 +36,6 @@
extern void _initialize_f_valprint (void);
@ -619,11 +612,11 @@ Index: gdb-7.8.90.20150126/gdb/f-valprint.c
if (index != TYPE_NFIELDS (type) - 1)
fputs_filtered (", ", stream);
}
Index: gdb-7.8.90.20150126/gdb/gdbtypes.c
Index: gdb-7.9.50.20150520/gdb/gdbtypes.c
===================================================================
--- gdb-7.8.90.20150126.orig/gdb/gdbtypes.c 2015-01-26 07:47:25.850758392 +0100
+++ gdb-7.8.90.20150126/gdb/gdbtypes.c 2015-01-26 07:47:42.404829904 +0100
@@ -815,7 +815,8 @@ allocate_stub_method (struct type *type)
--- gdb-7.9.50.20150520.orig/gdb/gdbtypes.c 2015-05-29 08:27:02.683717492 +0200
+++ gdb-7.9.50.20150520/gdb/gdbtypes.c 2015-05-29 10:54:36.236498749 +0200
@@ -824,7 +824,8 @@ allocate_stub_method (struct type *type)
struct type *
create_range_type (struct type *result_type, struct type *index_type,
const struct dynamic_prop *low_bound,
@ -633,7 +626,7 @@ Index: gdb-7.8.90.20150126/gdb/gdbtypes.c
{
if (result_type == NULL)
result_type = alloc_type_copy (index_type);
@@ -830,6 +831,7 @@ create_range_type (struct type *result_t
@@ -839,6 +840,7 @@ create_range_type (struct type *result_t
TYPE_ZALLOC (result_type, sizeof (struct range_bounds));
TYPE_RANGE_DATA (result_type)->low = *low_bound;
TYPE_RANGE_DATA (result_type)->high = *high_bound;
@ -641,7 +634,7 @@ Index: gdb-7.8.90.20150126/gdb/gdbtypes.c
if (low_bound->kind == PROP_CONST && low_bound->data.const_val >= 0)
TYPE_UNSIGNED (result_type) = 1;
@@ -858,7 +860,7 @@ struct type *
@@ -867,7 +869,7 @@ struct type *
create_static_range_type (struct type *result_type, struct type *index_type,
LONGEST low_bound, LONGEST high_bound)
{
@ -650,7 +643,7 @@ Index: gdb-7.8.90.20150126/gdb/gdbtypes.c
low.kind = PROP_CONST;
low.data.const_val = low_bound;
@@ -866,7 +868,11 @@ create_static_range_type (struct type *r
@@ -875,7 +877,11 @@ create_static_range_type (struct type *r
high.kind = PROP_CONST;
high.data.const_val = high_bound;
@ -663,7 +656,7 @@ Index: gdb-7.8.90.20150126/gdb/gdbtypes.c
return result_type;
}
@@ -1020,18 +1026,24 @@ create_array_type_with_stride (struct ty
@@ -1068,18 +1074,24 @@ create_array_type_with_stride (struct ty
TYPE_CODE (result_type) = TYPE_CODE_ARRAY;
TYPE_TARGET_TYPE (result_type) = element_type;
@ -690,7 +683,7 @@ Index: gdb-7.8.90.20150126/gdb/gdbtypes.c
else if (bit_stride > 0)
TYPE_LENGTH (result_type) =
(bit_stride * (high_bound - low_bound + 1) + 7) / 8;
@@ -1630,12 +1642,31 @@ stub_noname_complaint (void)
@@ -1789,12 +1801,31 @@ stub_noname_complaint (void)
static int
is_dynamic_type_internal (struct type *type, int top_level)
{
@ -722,7 +715,7 @@ Index: gdb-7.8.90.20150126/gdb/gdbtypes.c
/* Types that have a dynamic TYPE_DATA_LOCATION are considered
dynamic, even if the type itself is statically defined.
From a user's point of view, this may appear counter-intuitive;
@@ -1656,11 +1687,19 @@ is_dynamic_type_internal (struct type *t
@@ -1823,11 +1854,19 @@ is_dynamic_type_internal (struct type *t
{
gdb_assert (TYPE_NFIELDS (type) == 1);
@ -745,14 +738,15 @@ Index: gdb-7.8.90.20150126/gdb/gdbtypes.c
}
case TYPE_CODE_STRUCT:
@@ -1673,6 +1712,17 @@ is_dynamic_type_internal (struct type *t
@@ -1840,6 +1879,18 @@ is_dynamic_type_internal (struct type *t
&& is_dynamic_type_internal (TYPE_FIELD_TYPE (type, i), 0))
return 1;
}
+ case TYPE_CODE_PTR:
+ {
+ if (TYPE_TARGET_TYPE (type)
+ && TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_STRING)
+ && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_STRING
+ || TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY))
+ return is_dynamic_type (check_typedef (TYPE_TARGET_TYPE (type)));
+
+ return 0;
@ -763,8 +757,8 @@ Index: gdb-7.8.90.20150126/gdb/gdbtypes.c
break;
}
@@ -1701,7 +1751,8 @@ resolve_dynamic_range (struct type *dyn_
struct type *static_range_type;
@@ -1869,7 +1920,8 @@ resolve_dynamic_range (struct type *dyn_
struct type *static_range_type, *static_target_type;
const struct dynamic_prop *prop;
const struct dwarf2_locexpr_baton *baton;
- struct dynamic_prop low_bound, high_bound;
@ -773,28 +767,30 @@ Index: gdb-7.8.90.20150126/gdb/gdbtypes.c
gdb_assert (TYPE_CODE (dyn_range_type) == TYPE_CODE_RANGE);
@@ -1732,10 +1783,17 @@ resolve_dynamic_range (struct type *dyn_
high_bound.kind = PROP_UNDEFINED;
@@ -1901,12 +1953,19 @@ resolve_dynamic_range (struct type *dyn_
high_bound.data.const_val = 0;
}
+
+ prop = &TYPE_RANGE_DATA (dyn_range_type)->stride;
+ if (dwarf2_evaluate_property (prop, addr, &value))
+ if (dwarf2_evaluate_property (prop, addr_stack, &value))
+ {
+ stride.kind = PROP_CONST;
+ stride.data.const_val = value;
+ }
+
static_target_type
- = resolve_dynamic_type_internal (TYPE_TARGET_TYPE (dyn_range_type),
+ = resolve_dynamic_type_internal (TYPE_TARGET_TYPE (range_copy),
addr_stack, 0);
- static_range_type = create_range_type (copy_type (dyn_range_type),
- TYPE_TARGET_TYPE (dyn_range_type),
- &low_bound, &high_bound);
+ static_range_type = create_range_type (range_copy,
+ TYPE_TARGET_TYPE (range_copy),
static_target_type,
- &low_bound, &high_bound);
+ &low_bound, &high_bound, &stride);
TYPE_RANGE_DATA (static_range_type)->flag_bound_evaluated = 1;
return static_range_type;
}
@@ -1751,23 +1809,46 @@ resolve_dynamic_array (struct type *type
@@ -1923,23 +1982,47 @@ resolve_dynamic_array (struct type *type
struct type *elt_type;
struct type *range_type;
struct type *ary_dim;
@ -807,17 +803,17 @@ Index: gdb-7.8.90.20150126/gdb/gdbtypes.c
elt_type = type;
range_type = check_typedef (TYPE_INDEX_TYPE (elt_type));
range_type = resolve_dynamic_range (range_type, addr);
range_type = resolve_dynamic_range (range_type, addr_stack);
+ prop = TYPE_ALLOCATED_PROP (type);
+ if (dwarf2_evaluate_property (prop, addr, &value))
+ if (dwarf2_evaluate_property (prop, addr_stack, &value))
+ {
+ TYPE_ALLOCATED_PROP (copy)->kind = PROP_CONST;
+ TYPE_ALLOCATED_PROP (copy)->data.const_val = value;
+ }
+
+ prop = TYPE_ASSOCIATED_PROP (type);
+ if (dwarf2_evaluate_property (prop, addr, &value))
+ if (dwarf2_evaluate_property (prop, addr_stack, &value))
+ {
+ TYPE_ASSOCIATED_PROP (copy)->kind = PROP_CONST;
+ TYPE_ASSOCIATED_PROP (copy)->data.const_val = value;
@ -826,64 +822,32 @@ Index: gdb-7.8.90.20150126/gdb/gdbtypes.c
ary_dim = check_typedef (TYPE_TARGET_TYPE (elt_type));
- if (ary_dim != NULL && TYPE_CODE (ary_dim) == TYPE_CODE_ARRAY)
- elt_type = resolve_dynamic_array (TYPE_TARGET_TYPE (type), addr);
- elt_type = resolve_dynamic_array (TYPE_TARGET_TYPE (type), addr_stack);
+ if (ary_dim != NULL && (TYPE_CODE (ary_dim) == TYPE_CODE_ARRAY
+ || TYPE_CODE (ary_dim) == TYPE_CODE_STRING))
+ elt_type = resolve_dynamic_array (TYPE_TARGET_TYPE (copy), addr);
+ elt_type = resolve_dynamic_array (TYPE_TARGET_TYPE (copy), addr_stack);
else
elt_type = TYPE_TARGET_TYPE (type);
- return create_array_type (copy_type (type),
- elt_type,
- range_type);
+ if (TYPE_CODE (type) == TYPE_CODE_STRING)
- return create_array_type_with_stride (copy_type (type),
- elt_type, range_type,
- TYPE_FIELD_BITSIZE (type, 0));
+ if (TYPE_CODE (type) == TYPE_CODE_STRING
+ && TYPE_FIELD_BITSIZE (type, 0) == 0)
+ return create_string_type (copy,
+ elt_type,
+ range_type);
+ else
+ return create_array_type (copy,
+ return create_array_type_with_stride (copy,
+ elt_type,
+ range_type);
+ range_type, TYPE_FIELD_BITSIZE (type, 0));
}
/* Resolve dynamic bounds of members of the union TYPE to static
@@ -1938,6 +2019,25 @@ resolve_dynamic_type_internal (struct ty
else
TYPE_DATA_LOCATION (resolved_type) = NULL;
@@ -4453,6 +4536,20 @@ copy_type_recursive (struct objfile *obj
TYPE_DYN_PROP_LIST (type));
+ /* Resolve data_location attribute. */
+ prop = TYPE_DATA_LOCATION (resolved_type);
+ if (dwarf2_evaluate_property (prop, addr, &value))
+ {
+ struct type *range_type = TYPE_INDEX_TYPE (resolved_type);
+
+ /* Adjust the data location with the value of byte stride if set, which
+ can describe the separation between successive elements along the
+ dimension. */
+ if (TYPE_BYTE_STRIDE (range_type) < 0)
+ value += (TYPE_HIGH_BOUND (range_type) - TYPE_LOW_BOUND (range_type))
+ * TYPE_BYTE_STRIDE (range_type);
+
+ TYPE_DATA_LOCATION_ADDR (resolved_type) = value;
+ TYPE_DATA_LOCATION_KIND (resolved_type) = PROP_CONST;
+ }
+ else
+ TYPE_DATA_LOCATION (resolved_type) = NULL;
+
return resolved_type;
}
@@ -4174,6 +4274,27 @@ copy_type_recursive (struct objfile *obj
sizeof (struct dynamic_prop));
}
+ /* Copy the data location information. */
+ if (TYPE_DATA_LOCATION (type) != NULL)
+ {
+ TYPE_DATA_LOCATION (new_type) = xmalloc (sizeof (struct dynamic_prop));
+ *TYPE_DATA_LOCATION (new_type) = *TYPE_DATA_LOCATION (type);
+ }
+
+ /* Copy allocated information. */
+ if (TYPE_ALLOCATED_PROP (type) != NULL)
+ {
@ -901,8 +865,8 @@ Index: gdb-7.8.90.20150126/gdb/gdbtypes.c
/* Copy pointers to other types. */
if (TYPE_TARGET_TYPE (type))
TYPE_TARGET_TYPE (new_type) =
@@ -4227,6 +4348,44 @@ copy_type (const struct type *type)
sizeof (struct dynamic_prop));
@@ -4494,6 +4591,35 @@ copy_type_recursive (struct objfile *obj
gdb_assert_not_reached ("bad type_specific_kind");
}
+ if (TYPE_ALLOCATED_PROP (type))
@ -923,15 +887,6 @@ Index: gdb-7.8.90.20150126/gdb/gdbtypes.c
+ sizeof (struct dynamic_prop));
+ }
+
+ if (TYPE_DATA_LOCATION (type))
+ {
+ TYPE_DATA_LOCATION (new_type)
+ = OBSTACK_ZALLOC (&TYPE_OWNER (type).objfile->objfile_obstack,
+ struct dynamic_prop);
+ memcpy (TYPE_DATA_LOCATION (new_type), TYPE_DATA_LOCATION (type),
+ sizeof (struct dynamic_prop));
+ }
+
+ if (TYPE_NFIELDS (type))
+ {
+ int nfields = TYPE_NFIELDS (type);
@ -945,26 +900,41 @@ Index: gdb-7.8.90.20150126/gdb/gdbtypes.c
+
return new_type;
}
Index: gdb-7.8.90.20150126/gdb/gdbtypes.h
@@ -4519,6 +4645,14 @@ copy_type (const struct type *type)
TYPE_DYN_PROP_LIST (new_type)
= copy_dynamic_prop_list (&TYPE_OBJFILE (type) -> objfile_obstack,
TYPE_DYN_PROP_LIST (type));
+ if (TYPE_ALLOCATED_PROP (type) != NULL)
+ TYPE_ALLOCATED_PROP (new_type) = obstack_copy
+ (&TYPE_OBJFILE (type)->objfile_obstack, TYPE_ALLOCATED_PROP (type),
+ sizeof (*TYPE_ALLOCATED_PROP (type)));
+ if (TYPE_ASSOCIATED_PROP (type) != NULL)
+ TYPE_ASSOCIATED_PROP (new_type) = obstack_copy
+ (&TYPE_OBJFILE (type)->objfile_obstack, TYPE_ASSOCIATED_PROP (type),
+ sizeof (*TYPE_ASSOCIATED_PROP (type)));
return new_type;
}
Index: gdb-7.9.50.20150520/gdb/gdbtypes.h
===================================================================
--- gdb-7.8.90.20150126.orig/gdb/gdbtypes.h 2015-01-26 07:47:25.852758401 +0100
+++ gdb-7.8.90.20150126/gdb/gdbtypes.h 2015-01-26 07:47:42.405829908 +0100
@@ -660,6 +660,10 @@ struct main_type
--- gdb-7.9.50.20150520.orig/gdb/gdbtypes.h 2015-05-29 08:27:02.685717504 +0200
+++ gdb-7.9.50.20150520/gdb/gdbtypes.h 2015-05-29 08:46:08.862924052 +0200
@@ -569,6 +569,10 @@ struct range_bounds
struct dynamic_prop high;
struct dynamic_prop high;
+ /* * Stride of range. */
+ /* * Stride of range. */
+
+ struct dynamic_prop stride;
+ struct dynamic_prop stride;
+
/* True if HIGH range bound contains the number of elements in the
subrange. This affects how the final hight bound is computed. */
/* True if HIGH range bound contains the number of elements in the
subrange. This affects how the final hight bound is computed. */
@@ -720,6 +724,18 @@ struct main_type
this field yields to the location of the data for an object. */
@@ -741,6 +745,18 @@ struct main_type
struct dynamic_prop *data_location;
/* * Contains all dynamic type properties. */
struct dynamic_prop_list *dyn_prop_list;
+
+ /* Structure for DW_AT_allocated.
+ The presence of this attribute indicates that the object of the type
@ -980,7 +950,7 @@ Index: gdb-7.8.90.20150126/gdb/gdbtypes.h
};
/* * A ``struct type'' describes a particular instance of a type, with
@@ -1198,6 +1214,39 @@ extern void allocate_gnat_aux_type (stru
@@ -1255,6 +1271,15 @@ extern void allocate_gnat_aux_type (stru
TYPE_RANGE_DATA(range_type)->high.kind
#define TYPE_LOW_BOUND_KIND(range_type) \
TYPE_RANGE_DATA(range_type)->low.kind
@ -993,16 +963,13 @@ Index: gdb-7.8.90.20150126/gdb/gdbtypes.h
+#define TYPE_BYTE_STRIDE_KIND(range_type) \
+ TYPE_RANGE_DATA(range_type)->stride.kind
+
+
+/* Attribute accessors for the type data location. */
+#define TYPE_DATA_LOCATION(thistype) \
+ TYPE_MAIN_TYPE(thistype)->data_location
+#define TYPE_DATA_LOCATION_BATON(thistype) \
+ TYPE_DATA_LOCATION (thistype)->data.baton
+#define TYPE_DATA_LOCATION_ADDR(thistype) \
+ TYPE_DATA_LOCATION (thistype)->data.const_val
+#define TYPE_DATA_LOCATION_KIND(thistype) \
+ TYPE_DATA_LOCATION (thistype)->kind
/* Property accessors for the type data location. */
#define TYPE_DATA_LOCATION(thistype) \
@@ -1265,6 +1290,20 @@ extern void allocate_gnat_aux_type (stru
TYPE_DATA_LOCATION (thistype)->data.const_val
#define TYPE_DATA_LOCATION_KIND(thistype) \
TYPE_DATA_LOCATION (thistype)->kind
+#define TYPE_ALLOCATED_PROP(thistype) TYPE_MAIN_TYPE(thistype)->allocated
+#define TYPE_ASSOCIATED_PROP(thistype) TYPE_MAIN_TYPE(thistype)->associated
+
@ -1018,9 +985,9 @@ Index: gdb-7.8.90.20150126/gdb/gdbtypes.h
+ && TYPE_ASSOCIATED_PROP (t)->kind == PROP_CONST \
+ && !TYPE_ASSOCIATED_PROP (t)->data.const_val)
/* Attribute accessors for the type data location. */
#define TYPE_DATA_LOCATION(thistype) \
@@ -1215,6 +1264,9 @@ extern void allocate_gnat_aux_type (stru
/* Attribute accessors for dynamic properties. */
#define TYPE_DYN_PROP_LIST(thistype) \
@@ -1283,6 +1322,9 @@ extern void allocate_gnat_aux_type (stru
TYPE_HIGH_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype))
#define TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED(arraytype) \
TYPE_LOW_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype))
@ -1030,7 +997,7 @@ Index: gdb-7.8.90.20150126/gdb/gdbtypes.h
#define TYPE_ARRAY_UPPER_BOUND_VALUE(arraytype) \
(TYPE_HIGH_BOUND(TYPE_INDEX_TYPE((arraytype))))
@@ -1685,6 +1737,7 @@ extern struct type *create_array_type_wi
@@ -1764,6 +1806,7 @@ extern struct type *create_array_type_wi
extern struct type *create_range_type (struct type *, struct type *,
const struct dynamic_prop *,
@ -1038,10 +1005,10 @@ Index: gdb-7.8.90.20150126/gdb/gdbtypes.h
const struct dynamic_prop *);
extern struct type *create_array_type (struct type *, struct type *,
Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-alloc-assoc.exp
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-alloc-assoc.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-alloc-assoc.exp 2015-01-26 07:47:42.405829908 +0100
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-alloc-assoc.exp 2015-05-29 08:27:06.266740292 +0200
@@ -0,0 +1,65 @@
+# Copyright 2014 Free Software Foundation, Inc.
+
@ -1108,10 +1075,10 @@ Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-alloc-assoc.exp
+gdb_continue_to_breakpoint "vla2-deallocated"
+gdb_test "print l" " = \\.FALSE\\." "print vla2 deallocated"
+gdb_test "print vla2" " = <not allocated>" "print deallocated vla2"
Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-datatypes.exp
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-datatypes.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-datatypes.exp 2015-01-26 07:47:42.405829908 +0100
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-datatypes.exp 2015-05-29 08:27:06.266740292 +0200
@@ -0,0 +1,82 @@
+# Copyright 2014 Free Software Foundation, Inc.
+
@ -1195,10 +1162,10 @@ Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-datatypes.exp
+ "print logicalvla(5,5,5) (2nd)"
+gdb_test "print charactervla(5,5,5)" " = 'X'" \
+ "print charactervla(5,5,5) (2nd)"
Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-datatypes.f90
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-datatypes.f90
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-datatypes.f90 2015-01-26 07:47:42.405829908 +0100
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-datatypes.f90 2015-05-29 08:27:06.266740292 +0200
@@ -0,0 +1,51 @@
+! Copyright 2014 Free Software Foundation, Inc.
+!
@ -1251,10 +1218,10 @@ Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-datatypes.f90
+ ! dummy statement for bp
+ l = .FALSE. ! vlas-modified
+end program vla_primitives
Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-func.exp
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-func.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-func.exp 2015-01-26 07:47:42.406829913 +0100
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-func.exp 2015-05-29 08:27:06.266740292 +0200
@@ -0,0 +1,61 @@
+# Copyright 2014 Free Software Foundation, Inc.
+
@ -1317,10 +1284,10 @@ Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-func.exp
+ "print vla3 (after func2)"
+gdb_test "ptype vla3" "type = integer\\\(kind=4\\\) \\\(10\\\)" \
+ "ptype vla3 (after func2)"
Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-func.f90
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-func.f90
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-func.f90 2015-01-26 07:47:42.406829913 +0100
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-func.f90 2015-05-29 08:27:06.267740298 +0200
@@ -0,0 +1,71 @@
+! Copyright 2014 Free Software Foundation, Inc.
+!
@ -1393,10 +1360,10 @@ Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-func.f90
+
+ ret = .TRUE. ! func2-returned
+end program vla_func
Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-history.exp
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-history.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-history.exp 2015-01-26 07:47:42.406829913 +0100
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-history.exp 2015-05-29 08:27:06.267740298 +0200
@@ -0,0 +1,62 @@
+# Copyright 2014 Free Software Foundation, Inc.
+
@ -1460,10 +1427,10 @@ Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-history.exp
+# Try to access history values for vla values.
+gdb_test "print \$9" " = 1311" "print \$9"
+gdb_test "print \$10" " = 1001" "print \$10"
Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-ptype-sub.exp
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-ptype-sub.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-ptype-sub.exp 2015-01-26 07:47:42.406829913 +0100
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-ptype-sub.exp 2015-05-29 08:27:06.267740298 +0200
@@ -0,0 +1,87 @@
+# Copyright 2014 Free Software Foundation, Inc.
+
@ -1552,10 +1519,10 @@ Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-ptype-sub.exp
+ "ptype array1(100) (arbitrary length)"
+gdb_test "ptype array2(4,100)" "type = integer\\\(kind=4\\\)" \
+ "ptype array2(4,100) (arbitrary length)"
Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-ptype.exp
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-ptype.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-ptype.exp 2015-01-26 07:47:42.406829913 +0100
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-ptype.exp 2015-05-29 08:27:06.267740298 +0200
@@ -0,0 +1,96 @@
+# Copyright 2014 Free Software Foundation, Inc.
+
@ -1653,10 +1620,10 @@ Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-ptype.exp
+gdb_test "ptype vla2(5, 45, 20)" \
+ "no such vector element because not allocated" \
+ "ptype vla2(5, 45, 20) not allocated"
Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-sizeof.exp
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-sizeof.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-sizeof.exp 2015-01-26 07:47:42.406829913 +0100
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-sizeof.exp 2015-05-29 08:27:06.267740298 +0200
@@ -0,0 +1,46 @@
+# Copyright 2014 Free Software Foundation, Inc.
+
@ -1704,10 +1671,10 @@ Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-sizeof.exp
+gdb_breakpoint [gdb_get_line_number "pvla-associated"]
+gdb_continue_to_breakpoint "pvla-associated"
+gdb_test "print sizeof(pvla)" " = 4000" "print sizeof associated pvla"
Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-stride.exp
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-stride.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-stride.exp 2015-01-26 07:47:42.407829917 +0100
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-stride.exp 2015-05-29 08:27:06.267740298 +0200
@@ -0,0 +1,44 @@
+# Copyright 2014 Free Software Foundation, Inc.
+
@ -1753,10 +1720,10 @@ Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-stride.exp
+gdb_continue_to_breakpoint "single-element"
+gdb_test "print pvla" " = \\\(5\\\)" "print single-element"
+gdb_test "print pvla(1)" " = 5" "print one single-element"
Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-stride.f90
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-stride.f90
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-stride.f90 2015-01-26 07:47:42.407829917 +0100
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-stride.f90 2015-05-29 08:27:06.268740305 +0200
@@ -0,0 +1,30 @@
+! Copyright 2014 Free Software Foundation, Inc.
+!
@ -1788,10 +1755,10 @@ Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-stride.f90
+
+ pvla => null() ! single-element
+end program vla_stride
Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-strings.exp
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-strings.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-strings.exp 2015-01-26 07:47:42.407829917 +0100
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-strings.exp 2015-05-29 08:27:06.268740305 +0200
@@ -0,0 +1,104 @@
+# Copyright 2014 Free Software Foundation, Inc.
+
@ -1897,10 +1864,10 @@ Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-strings.exp
+ "whatis var_char_p after associated"
+gdb_test "ptype var_char_p" "type = PTR TO -> \\( character\\*7 \\)" \
+ "ptype var_char_p after associated"
Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-strings.f90
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-strings.f90
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-strings.f90 2015-01-26 07:47:42.407829917 +0100
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-strings.f90 2015-05-31 15:25:01.305615755 +0200
@@ -0,0 +1,40 @@
+! Copyright 2014 Free Software Foundation, Inc.
+!
@ -1942,10 +1909,10 @@ Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-strings.f90
+ var_char_p => null()
+ l = associated(var_char_p) ! var_char_p-not-associated
+end program vla_strings
Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-sub.f90
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-sub.f90
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-sub.f90 2015-01-26 07:47:42.407829917 +0100
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-sub.f90 2015-05-29 08:27:06.268740305 +0200
@@ -0,0 +1,82 @@
+! Copyright 2014 Free Software Foundation, Inc.
+!
@ -2029,10 +1996,10 @@ Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-sub.f90
+
+ call bar(sub_arr3, sub_arr1)
+end program vla_sub
Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-value-sub-arbitrary.exp
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-value-sub-arbitrary.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-value-sub-arbitrary.exp 2015-01-26 07:47:42.407829917 +0100
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-value-sub-arbitrary.exp 2015-05-29 08:27:06.268740305 +0200
@@ -0,0 +1,35 @@
+# Copyright 2014 Free Software Foundation, Inc.
+
@ -2069,10 +2036,10 @@ Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-value-sub-arbitrary.exp
+gdb_test "p array1(100)" " = 100" "print arbitary array1(100)"
+gdb_test "p array2(4,10)" " = 1" "print arbitary array2(4,10)"
+gdb_test "p array2(4,100)" " = 1" "print arbitary array2(4,100)"
Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-value-sub-finish.exp
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-value-sub-finish.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-value-sub-finish.exp 2015-01-26 07:47:42.407829917 +0100
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-value-sub-finish.exp 2015-05-29 08:27:06.268740305 +0200
@@ -0,0 +1,49 @@
+# Copyright 2014 Free Software Foundation, Inc.
+
@ -2123,10 +2090,10 @@ Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-value-sub-finish.exp
+gdb_test "p sub_arr2(1, 1, 1)" " = 30" "sub_arr2(1, 1, 1) after finish"
+gdb_test "p sub_arr2(2, 1, 1)" " = 20" "sub_arr2(2, 1, 1) after finish"
+
Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-value-sub.exp
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-value-sub.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-value-sub.exp 2015-01-26 07:47:42.408829922 +0100
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-value-sub.exp 2015-05-29 08:27:06.269740311 +0200
@@ -0,0 +1,90 @@
+# Copyright 2014 Free Software Foundation, Inc.
+
@ -2218,10 +2185,10 @@ Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-value-sub.exp
+ "set array(2,2,2) to 20 in subroutine (passed vla)"
+gdb_test "print array2" " = \\( *\\( *\\( *30, *20, *3,\[()3, .\]*\\)" \
+ "print array2 in foo after it was mofified in debugger (passed vla)"
Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-value.exp
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-value.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-value.exp 2015-01-26 07:47:42.408829922 +0100
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-value.exp 2015-05-29 08:27:06.269740311 +0200
@@ -0,0 +1,148 @@
+# Copyright 2014 Free Software Foundation, Inc.
+
@ -2371,10 +2338,10 @@ Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla-value.exp
+gdb_continue_to_breakpoint "pvla-deassociated"
+gdb_test "print \$mypvar(1,3,8)" " = 1001" \
+ "print \$mypvar(1,3,8) after deallocated"
Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla.f90
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla.f90
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla.f90 2015-01-26 07:47:42.408829922 +0100
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla.f90 2015-05-29 08:27:06.269740311 +0200
@@ -0,0 +1,56 @@
+! Copyright 2014 Free Software Foundation, Inc.
+!
@ -2432,11 +2399,11 @@ Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.fortran/vla.f90
+ allocate (vla3 (2,2)) ! vla2-deallocated
+ vla3(:,:) = 13
+end program vla
Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.mi/mi-vla-fortran.exp
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.mi/mi-vla-fortran.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.90.20150126/gdb/testsuite/gdb.mi/mi-vla-fortran.exp 2015-01-26 07:47:42.408829922 +0100
@@ -0,0 +1,182 @@
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.mi/mi-vla-fortran.exp 2015-05-29 11:13:53.951656591 +0200
@@ -0,0 +1,181 @@
+# Copyright 2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
@ -2507,8 +2474,7 @@ Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.mi/mi-vla-fortran.exp
+mi_run_cmd
+mi_expect_stop "breakpoint-hit" "vla" "" ".*vla.f90" "$bp_lineno" \
+ { "" "disp=\"del\"" } "run to breakpoint at line $bp_lineno"
+mi_gdb_test "510-data-evaluate-expression vla1" \
+ "510\\^done,value=\"\\(0, 0, 0, 0, 0\\)\"" "evaluate allocated vla"
+# Content of 'vla1' is uninitialized here.
+
+mi_create_varobj_checked vla1_allocated vla1 "real\\\(kind=4\\\) \\\(5\\\)" \
+ "create local variable vla1_allocated"
@ -2619,10 +2585,10 @@ Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.mi/mi-vla-fortran.exp
+
+mi_gdb_exit
+return 0
Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.mi/vla.f90
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.mi/vla.f90
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.90.20150126/gdb/testsuite/gdb.mi/vla.f90 2015-01-26 07:47:42.409829926 +0100
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.mi/vla.f90 2015-05-29 08:27:06.270740317 +0200
@@ -0,0 +1,42 @@
+! Copyright 2014 Free Software Foundation, Inc.
+!
@ -2666,11 +2632,11 @@ Index: gdb-7.8.90.20150126/gdb/testsuite/gdb.mi/vla.f90
+ pvla2 => null()
+ l = associated(pvla2) ! pvla2-set-to-null
+end program vla
Index: gdb-7.8.90.20150126/gdb/typeprint.c
Index: gdb-7.9.50.20150520/gdb/typeprint.c
===================================================================
--- gdb-7.8.90.20150126.orig/gdb/typeprint.c 2015-01-26 07:47:25.856758418 +0100
+++ gdb-7.8.90.20150126/gdb/typeprint.c 2015-01-26 07:47:42.409829926 +0100
@@ -456,6 +456,13 @@ whatis_exp (char *exp, int show)
--- gdb-7.9.50.20150520.orig/gdb/typeprint.c 2015-05-29 08:27:02.688717523 +0200
+++ gdb-7.9.50.20150520/gdb/typeprint.c 2015-05-29 08:27:06.270740317 +0200
@@ -458,6 +458,13 @@ whatis_exp (char *exp, int show)
type = value_type (val);
@ -2684,10 +2650,10 @@ Index: gdb-7.8.90.20150126/gdb/typeprint.c
get_user_print_options (&opts);
if (opts.objectprint)
{
Index: gdb-7.8.90.20150126/gdb/valarith.c
Index: gdb-7.9.50.20150520/gdb/valarith.c
===================================================================
--- gdb-7.8.90.20150126.orig/gdb/valarith.c 2015-01-26 07:47:25.857758422 +0100
+++ gdb-7.8.90.20150126/gdb/valarith.c 2015-01-26 07:47:42.409829926 +0100
--- gdb-7.9.50.20150520.orig/gdb/valarith.c 2015-05-29 08:27:02.689717530 +0200
+++ gdb-7.9.50.20150520/gdb/valarith.c 2015-05-29 08:27:06.271740324 +0200
@@ -193,12 +193,31 @@ value_subscripted_rvalue (struct value *
struct type *array_type = check_typedef (value_type (array));
struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type));
@ -2722,10 +2688,10 @@ Index: gdb-7.8.90.20150126/gdb/valarith.c
if (VALUE_LVAL (array) == lval_memory && value_lazy (array))
v = allocate_value_lazy (elt_type);
Index: gdb-7.8.90.20150126/gdb/valprint.c
Index: gdb-7.9.50.20150520/gdb/valprint.c
===================================================================
--- gdb-7.8.90.20150126.orig/gdb/valprint.c 2015-01-26 07:47:25.858758427 +0100
+++ gdb-7.8.90.20150126/gdb/valprint.c 2015-01-26 07:47:42.410829930 +0100
--- gdb-7.9.50.20150520.orig/gdb/valprint.c 2015-05-29 08:27:02.690717536 +0200
+++ gdb-7.9.50.20150520/gdb/valprint.c 2015-05-29 08:27:06.271740324 +0200
@@ -303,6 +303,18 @@ valprint_check_validity (struct ui_file
{
CHECK_TYPEDEF (type);
@ -2764,7 +2730,7 @@ Index: gdb-7.8.90.20150126/gdb/valprint.c
/* A generic val_print that is suitable for use by language
implementations of the la_val_print method. This function can
handle most type codes, though not all, notably exception
@@ -800,12 +824,16 @@ static int
@@ -802,12 +826,16 @@ static int
value_check_printable (struct value *val, struct ui_file *stream,
const struct value_print_options *options)
{
@ -2781,7 +2747,7 @@ Index: gdb-7.8.90.20150126/gdb/valprint.c
if (value_entirely_optimized_out (val))
{
if (options->summary && !val_print_scalar_type_p (value_type (val)))
@@ -831,6 +859,18 @@ value_check_printable (struct value *val
@@ -833,6 +861,18 @@ value_check_printable (struct value *val
return 0;
}
@ -2800,23 +2766,23 @@ Index: gdb-7.8.90.20150126/gdb/valprint.c
return 1;
}
Index: gdb-7.8.90.20150126/gdb/valprint.h
Index: gdb-7.9.50.20150520/gdb/valprint.h
===================================================================
--- gdb-7.8.90.20150126.orig/gdb/valprint.h 2015-01-26 07:47:25.859758431 +0100
+++ gdb-7.8.90.20150126/gdb/valprint.h 2015-01-26 07:47:42.410829930 +0100
@@ -217,4 +217,8 @@ extern void output_command_const (const
extern int val_print_scalar_type_p (struct type *type);
--- gdb-7.9.50.20150520.orig/gdb/valprint.h 2015-05-29 08:27:02.691717543 +0200
+++ gdb-7.9.50.20150520/gdb/valprint.h 2015-05-29 08:27:06.272740330 +0200
@@ -232,4 +232,8 @@ extern void print_command_parse_format (
struct format_data *fmtp);
extern void print_value (struct value *val, const struct format_data *fmtp);
+extern void val_print_not_allocated (struct ui_file *stream);
+
+extern void val_print_not_associated (struct ui_file *stream);
+
#endif
Index: gdb-7.8.90.20150126/gdb/value.c
Index: gdb-7.9.50.20150520/gdb/value.c
===================================================================
--- gdb-7.8.90.20150126.orig/gdb/value.c 2015-01-26 07:47:25.860758435 +0100
+++ gdb-7.8.90.20150126/gdb/value.c 2015-01-26 07:47:42.411829935 +0100
--- gdb-7.9.50.20150520.orig/gdb/value.c 2015-05-29 08:27:02.693717555 +0200
+++ gdb-7.9.50.20150520/gdb/value.c 2015-05-29 08:27:06.273740337 +0200
@@ -40,6 +40,7 @@
#include "tracepoint.h"
#include "cp-abi.h"
@ -2825,7 +2791,7 @@ Index: gdb-7.8.90.20150126/gdb/value.c
/* Prototypes for exported functions. */
@@ -1755,6 +1756,25 @@ set_value_component_location (struct val
@@ -1776,6 +1777,25 @@ set_value_component_location (struct val
if (funcs->copy_closure)
component->location.computed.closure = funcs->copy_closure (whole);
}
@ -2851,7 +2817,7 @@ Index: gdb-7.8.90.20150126/gdb/value.c
}
@@ -3041,13 +3061,22 @@ value_primitive_field (struct value *arg
@@ -3080,13 +3100,22 @@ value_primitive_field (struct value *arg
v = allocate_value_lazy (type);
else
{
@ -2880,7 +2846,7 @@ Index: gdb-7.8.90.20150126/gdb/value.c
}
set_value_component_location (v, arg1);
VALUE_REGNUM (v) = VALUE_REGNUM (arg1);
@@ -3635,7 +3664,8 @@ readjust_indirect_value_type (struct val
@@ -3674,7 +3703,8 @@ readjust_indirect_value_type (struct val
struct value *original_value)
{
/* Re-adjust type. */
@ -2890,7 +2856,7 @@ Index: gdb-7.8.90.20150126/gdb/value.c
/* Add embedding info. */
set_value_enclosing_type (value, enc_type);
@@ -3652,6 +3682,12 @@ coerce_ref (struct value *arg)
@@ -3691,6 +3721,12 @@ coerce_ref (struct value *arg)
struct value *retval;
struct type *enc_type;
@ -2903,7 +2869,7 @@ Index: gdb-7.8.90.20150126/gdb/value.c
retval = coerce_ref_if_computed (arg);
if (retval)
return retval;
@@ -3786,8 +3822,14 @@ value_fetch_lazy (struct value *val)
@@ -3825,8 +3861,14 @@ value_fetch_lazy (struct value *val)
}
else if (VALUE_LVAL (val) == lval_memory)
{
@ -2919,11 +2885,11 @@ Index: gdb-7.8.90.20150126/gdb/value.c
if (TYPE_LENGTH (type))
read_value_memory (val, 0, value_stack (val),
Index: gdb-7.8.90.20150126/gdb/dwarf2loc.c
Index: gdb-7.9.50.20150520/gdb/dwarf2loc.c
===================================================================
--- gdb-7.8.90.20150126.orig/gdb/dwarf2loc.c 2015-01-26 07:47:25.862758444 +0100
+++ gdb-7.8.90.20150126/gdb/dwarf2loc.c 2015-01-26 07:47:42.412829939 +0100
@@ -2293,6 +2293,11 @@ dwarf2_evaluate_loc_desc_full (struct ty
--- gdb-7.9.50.20150520.orig/gdb/dwarf2loc.c 2015-05-29 08:27:02.694717562 +0200
+++ gdb-7.9.50.20150520/gdb/dwarf2loc.c 2015-05-29 08:27:06.274740343 +0200
@@ -2294,6 +2294,11 @@ dwarf2_evaluate_loc_desc_full (struct ty
int in_stack_memory = dwarf_expr_fetch_in_stack_memory (ctx, 0);
do_cleanups (value_chain);
@ -2935,7 +2901,7 @@ Index: gdb-7.8.90.20150126/gdb/dwarf2loc.c
retval = value_at_lazy (type, address + byte_offset);
if (in_stack_memory)
set_value_stack (retval, 1);
@@ -2552,6 +2557,19 @@ dwarf2_compile_property_to_c (struct ui_
@@ -2577,6 +2582,19 @@ dwarf2_compile_property_to_c (struct ui_
data, data + size, per_cu);
}

View File

@ -1,3 +1,55 @@
-------------------------------------------------------------------
Thu Jan 14 16:46:43 UTC 2016 - matz@suse.de
- Rebase to gdb version 7.10.1 as of version in Fedora 23:
* reverse debugging on aarch64
* new commands or subcommands:
- info os cpu, set/show serial parity, info dll
- maint print symbol-cache/symbol-cache-statistics,
maint flush-symbol-cache
- record btrace bts, record bts
- compile print
- show/set mpx bound
- tui enable/disable
- record btrace pt, record pt
- maint info btrace,
maint btrace packet-history/clear-packet-history/clear
* s390 support for vector ABI
* "set sysroot" improvements related to remote targets
* better support for debugging containerized programs
(without "set sysroot")
* HISTSIZE environment variable is replaced by GDBHISTSIZE
* python scripting:
- it's possible to write frame unwinders
- several new methods in Objfile, Type and Value classes
- gdb can auto-load scripts contained in special sections
named '.debug_gdb_scripts'.
* extensions for the MI interface, new remote packet types
- Removed obsolete patches:
0001-S390-Add-target-descriptions-for-vector-register-set.patch
0001-S390-Fix-compiler-invocation-with-compile-command.patch
0001-S390-Support-new-vector-register-sections.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
gdb-6.5-bz190810-gdbserver-arch-advice.patch
gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch
gdb-6.8-bz457187-largefile-test.patch
gdb-enable-count-crash.patch
gdb-libstdc++-v3-python-r155978.tar.bz2
gdb-no-dg-extract-results-py.patch
gdb-python3-py_hash_t-32bit.patch
gdb-python3-testsuite.patch
gdb-s390-reorder-arch.diff
gdb-upstream.patch
- Added new patches from Fedora:
gdb-pahole-python2.patch
gdb-probes-based-interface-robust-1of2.patch
gdb-probes-based-interface-robust-2of2.patch
gdb-rhbz1260558-ppc64le-skip_trampoline_code.patch
gdb-rhbz1270564-invalid-dwarf-regno.patch
-------------------------------------------------------------------
Fri Jul 10 13:49:28 UTC 2015 - matz@suse.de

274
gdb.spec
View File

@ -1,7 +1,7 @@
#
# spec file for package gdb
#
# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2016 SUSE LINUX 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.1
Version: 7.10.1
Release: 0
# The release always contains a leading reserved number, start it at 1.
@ -78,7 +78,7 @@ Source3: gdb-gstack.man
Source4: gdbinit
# libstdc++ pretty printers from GCC SVN HEAD (4.5 experimental).
%global libstdcxxpython gdb-libstdc++-v3-python-r155978
%global libstdcxxpython gdb-libstdc++-v3-python-r225521
Source5: %{libstdcxxpython}.tar.bz2
# Provide gdbtui for RHEL-5 and RHEL-6 as it is removed upstream (BZ 797664).
@ -92,136 +92,123 @@ Source13: gdb-rpmlintrc
#Fedora Packages begin
Patch1: gdb-6.3-rh-testversion-20041202.patch
Patch2: gdb-upstream.patch
Patch3: gdb-archer.patch
Patch4: gdb-vla-intel.patch
Patch5: gdb-vla-intel-logical-not.patch
Patch6: gdb-vla-intel-stringbt-fix.patch
Patch7: gdb-vla-intel-04of23-fix.patch
Patch8: gdb-6.3-rh-dummykfail-20041202.patch
Patch9: gdb-6.3-ppc64syscall-20040622.patch
Patch10: gdb-6.3-ppc64displaysymbol-20041124.patch
Patch11: gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch
Patch12: gdb-6.3-gstack-20050411.patch
Patch13: gdb-6.3-test-pie-20050107.patch
Patch14: gdb-6.3-test-self-20050110.patch
Patch15: gdb-6.3-test-dtorfix-20050121.patch
Patch16: gdb-6.3-test-movedir-20050125.patch
Patch17: gdb-6.3-threaded-watchpoints2-20050225.patch
Patch18: gdb-6.3-inferior-notification-20050721.patch
Patch19: gdb-6.3-inheritancetest-20050726.patch
Patch20: gdb-6.3-readnever-20050907.patch
Patch21: gdb-6.5-bz203661-emit-relocs.patch
Patch22: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
Patch23: gdb-6.5-sharedlibrary-path.patch
Patch24: gdb-6.5-bz190810-gdbserver-arch-advice.patch
Patch25: gdb-6.5-BEA-testsuite.patch
Patch26: gdb-6.5-last-address-space-byte-test.patch
Patch27: gdb-6.5-readline-long-line-crash-test.patch
Patch28: gdb-6.5-bz216711-clone-is-outermost.patch
Patch29: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch
Patch30: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch
Patch31: gdb-6.5-bz109921-DW_AT_decl_file-test.patch
Patch32: gdb-6.3-bz140532-ppc-unwinding-test.patch
Patch33: gdb-6.3-bz202689-exec-from-pthread-test.patch
Patch34: gdb-6.6-bz230000-power6-disassembly-test.patch
Patch35: gdb-6.3-bz231832-obstack-2gb.patch
Patch36: gdb-6.6-bz229517-gcore-without-terminal.patch
Patch37: gdb-6.6-bz235197-fork-detach-info.patch
Patch38: gdb-6.6-testsuite-timeouts.patch
Patch39: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch
Patch40: gdb-6.6-scheduler_locking-step-is-default.patch
Patch41: gdb-6.3-attach-see-vdso-test.patch
Patch42: gdb-6.5-bz243845-stale-testing-zombie-test.patch
Patch43: gdb-6.6-buildid-locate.patch
Patch44: gdb-6.6-buildid-locate-solib-missing-ids.patch
Patch45: gdb-6.6-buildid-locate-rpm.patch
Patch46: gdb-6.7-charsign-test.patch
Patch47: gdb-6.7-ppc-clobbered-registers-O2-test.patch
Patch48: gdb-6.5-ia64-libunwind-leak-test.patch
Patch49: gdb-6.5-missed-trap-on-step-test.patch
Patch50: gdb-6.7-bz426600-DW_TAG_interface_type-test.patch
Patch51: gdb-6.5-gcore-buffer-limit-test.patch
Patch52: gdb-6.6-threads-static-test.patch
Patch53: gdb-6.3-mapping-zero-inode-test.patch
Patch54: gdb-6.3-focus-cmd-prev-test.patch
Patch55: gdb-6.8-bz442765-threaded-exec-test.patch
Patch56: gdb-6.8-sparc64-silence-memcpy-check.patch
Patch57: gdb-6.5-section-num-fixup-test.patch
Patch58: gdb-6.8-bz436037-reg-no-longer-active.patch
Patch59: gdb-6.8-watchpoint-conditionals-test.patch
Patch60: gdb-6.8-bz466901-backtrace-full-prelinked.patch
Patch61: gdb-6.8-bz457187-largefile-test.patch
Patch62: gdb-simultaneous-step-resume-breakpoint-test.patch
Patch63: gdb-core-open-vdso-warning.patch
Patch64: gdb-x86_64-i386-syscall-restart.patch
Patch65: gdb-bz533176-fortran-omp-step.patch
Patch66: gdb-follow-child-stale-parent.patch
Patch67: gdb-ccache-workaround.patch
Patch68: gdb-archer-pie-addons.patch
Patch69: gdb-archer-pie-addons-keep-disabled.patch
Patch70: gdb-lineno-makeup-test.patch
Patch71: gdb-ppc-power7-test.patch
Patch72: gdb-bz541866-rwatch-before-run.patch
Patch73: gdb-moribund-utrace-workaround.patch
Patch74: gdb-archer-next-over-throw-cxx-exec.patch
Patch75: gdb-bz601887-dwarf4-rh-test.patch
Patch76: gdb-6.6-buildid-locate-core-as-arg.patch
Patch77: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
Patch78: gdb-test-bt-cfi-without-die.patch
Patch79: gdb-gdb-add-index-script.patch
Patch80: gdb-bz568248-oom-is-error.patch
Patch81: gdb-bz634108-solib_address.patch
Patch82: gdb-test-pid0-core.patch
Patch83: gdb-test-dw2-aranges.patch
Patch84: gdb-test-expr-cumulative-archer.patch
Patch85: gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch
Patch86: gdb-glibc-vdso-workaround.patch
Patch87: gdb-runtest-pie-override.patch
Patch88: gdb-attach-fail-reasons-5of5.patch
Patch89: gdb-stale-frame_info.patch
Patch90: gdb-glibc-strstr-workaround.patch
Patch91: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch
Patch92: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch
Patch93: gdb-rhbz795424-bitpos-20of25.patch
Patch94: gdb-rhbz795424-bitpos-21of25.patch
Patch95: gdb-rhbz795424-bitpos-22of25.patch
Patch96: gdb-rhbz795424-bitpos-23of25.patch
Patch97: gdb-rhbz795424-bitpos-25of25.patch
Patch98: gdb-rhbz795424-bitpos-25of25-test.patch
Patch99: gdb-rhbz795424-bitpos-lazyvalue.patch
Patch100: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch
Patch101: gdb-enable-count-crash.patch
Patch102: gdb-gnat-dwarf-crash-3of3.patch
Patch103: gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
Patch104: gdb-archer-vla-tests.patch
Patch105: gdb-btrobust.patch
Patch106: gdb-fortran-frame-string.patch
Patch107: gdb-python-gil.patch
Patch108: gdb-jit-reader-multilib.patch
Patch109: gdb-no-dg-extract-results-py.patch
Patch110: gdb-python3-py_hash_t-32bit.patch
Patch111: gdb-python3-testsuite.patch
Patch112: gdb-dts-rhel6-python-compat.patch
Patch113: gdb-6.6-buildid-locate-rpm-scl.patch
Patch114: gdb-readline62-ask-more-rh.patch
Patch115: gdb-6.8-attach-signalled-detach-stopped.patch
Patch116: gdb-6.8-quit-never-aborts.patch
Patch117: gdb-rhel5-compat.patch
Patch2: gdb-archer.patch
Patch3: gdb-vla-intel.patch
Patch4: gdb-vla-intel-logical-not.patch
Patch5: gdb-vla-intel-stringbt-fix.patch
Patch6: gdb-vla-intel-04of23-fix.patch
Patch7: gdb-6.3-rh-dummykfail-20041202.patch
Patch8: gdb-6.3-ppc64syscall-20040622.patch
Patch9: gdb-6.3-ppc64displaysymbol-20041124.patch
Patch10: gdb-6.3-gstack-20050411.patch
Patch11: gdb-6.3-test-pie-20050107.patch
Patch12: gdb-6.3-test-self-20050110.patch
Patch13: gdb-6.3-test-dtorfix-20050121.patch
Patch14: gdb-6.3-test-movedir-20050125.patch
Patch15: gdb-6.3-threaded-watchpoints2-20050225.patch
Patch16: gdb-6.3-inferior-notification-20050721.patch
Patch17: gdb-6.3-inheritancetest-20050726.patch
Patch18: gdb-6.3-readnever-20050907.patch
Patch19: gdb-6.5-bz203661-emit-relocs.patch
Patch20: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
Patch21: gdb-6.5-sharedlibrary-path.patch
Patch22: gdb-6.5-BEA-testsuite.patch
Patch23: gdb-6.5-last-address-space-byte-test.patch
Patch24: gdb-6.5-readline-long-line-crash-test.patch
Patch25: gdb-6.5-bz216711-clone-is-outermost.patch
Patch26: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch
Patch27: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch
Patch28: gdb-6.5-bz109921-DW_AT_decl_file-test.patch
Patch29: gdb-6.3-bz140532-ppc-unwinding-test.patch
Patch30: gdb-6.3-bz202689-exec-from-pthread-test.patch
Patch31: gdb-6.6-bz230000-power6-disassembly-test.patch
Patch32: gdb-6.3-bz231832-obstack-2gb.patch
Patch33: gdb-6.6-bz229517-gcore-without-terminal.patch
Patch34: gdb-6.6-bz235197-fork-detach-info.patch
Patch35: gdb-6.6-testsuite-timeouts.patch
Patch36: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch
Patch37: gdb-6.6-scheduler_locking-step-is-default.patch
Patch38: gdb-6.3-attach-see-vdso-test.patch
Patch39: gdb-6.5-bz243845-stale-testing-zombie-test.patch
Patch40: gdb-6.6-buildid-locate.patch
Patch41: gdb-6.6-buildid-locate-solib-missing-ids.patch
Patch42: gdb-6.6-buildid-locate-rpm.patch
Patch43: gdb-6.7-charsign-test.patch
Patch44: gdb-6.7-ppc-clobbered-registers-O2-test.patch
Patch45: gdb-6.5-ia64-libunwind-leak-test.patch
Patch46: gdb-6.5-missed-trap-on-step-test.patch
Patch47: gdb-6.7-bz426600-DW_TAG_interface_type-test.patch
Patch48: gdb-6.5-gcore-buffer-limit-test.patch
Patch49: gdb-6.6-threads-static-test.patch
Patch50: gdb-6.3-mapping-zero-inode-test.patch
Patch51: gdb-6.3-focus-cmd-prev-test.patch
Patch52: gdb-6.8-bz442765-threaded-exec-test.patch
Patch53: gdb-6.8-sparc64-silence-memcpy-check.patch
Patch54: gdb-6.5-section-num-fixup-test.patch
Patch55: gdb-6.8-bz436037-reg-no-longer-active.patch
Patch56: gdb-6.8-watchpoint-conditionals-test.patch
Patch57: gdb-6.8-bz466901-backtrace-full-prelinked.patch
Patch58: gdb-simultaneous-step-resume-breakpoint-test.patch
Patch59: gdb-core-open-vdso-warning.patch
Patch60: gdb-x86_64-i386-syscall-restart.patch
Patch61: gdb-bz533176-fortran-omp-step.patch
Patch62: gdb-follow-child-stale-parent.patch
Patch63: gdb-ccache-workaround.patch
Patch64: gdb-archer-pie-addons.patch
Patch65: gdb-archer-pie-addons-keep-disabled.patch
Patch66: gdb-lineno-makeup-test.patch
Patch67: gdb-ppc-power7-test.patch
Patch68: gdb-bz541866-rwatch-before-run.patch
Patch69: gdb-moribund-utrace-workaround.patch
Patch70: gdb-archer-next-over-throw-cxx-exec.patch
Patch71: gdb-bz601887-dwarf4-rh-test.patch
Patch72: gdb-6.6-buildid-locate-core-as-arg.patch
Patch73: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
Patch74: gdb-test-bt-cfi-without-die.patch
Patch75: gdb-gdb-add-index-script.patch
Patch76: gdb-bz568248-oom-is-error.patch
Patch77: gdb-bz634108-solib_address.patch
Patch78: gdb-test-pid0-core.patch
Patch79: gdb-test-dw2-aranges.patch
Patch80: gdb-test-expr-cumulative-archer.patch
Patch81: gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch
Patch82: gdb-glibc-vdso-workaround.patch
Patch83: gdb-runtest-pie-override.patch
Patch84: gdb-attach-fail-reasons-5of5.patch
Patch85: gdb-stale-frame_info.patch
Patch86: gdb-glibc-strstr-workaround.patch
Patch87: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch
Patch88: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch
Patch89: gdb-rhbz795424-bitpos-20of25.patch
Patch90: gdb-rhbz795424-bitpos-21of25.patch
Patch91: gdb-rhbz795424-bitpos-22of25.patch
Patch92: gdb-rhbz795424-bitpos-23of25.patch
Patch93: gdb-rhbz795424-bitpos-25of25.patch
Patch94: gdb-rhbz795424-bitpos-25of25-test.patch
Patch95: gdb-rhbz795424-bitpos-lazyvalue.patch
Patch96: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch
Patch97: gdb-gnat-dwarf-crash-3of3.patch
Patch98: gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
Patch99: gdb-archer-vla-tests.patch
Patch100: gdb-btrobust.patch
Patch101: gdb-fortran-frame-string.patch
Patch102: gdb-python-gil.patch
Patch103: gdb-jit-reader-multilib.patch
Patch104: gdb-probes-based-interface-robust-1of2.patch
Patch105: gdb-probes-based-interface-robust-2of2.patch
Patch106: gdb-rhbz1260558-ppc64le-skip_trampoline_code.patch
Patch107: gdb-rhbz1270564-invalid-dwarf-regno.patch
Patch108: gdb-dts-rhel6-python-compat.patch
Patch109: gdb-6.6-buildid-locate-rpm-scl.patch
Patch110: gdb-readline62-ask-more-rh.patch
Patch111: gdb-6.8-attach-signalled-detach-stopped.patch
Patch112: gdb-6.8-quit-never-aborts.patch
Patch113: gdb-rhel5-compat.patch
Patch114: gdb-pahole-python2.patch
#Fedora Packages end
# 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
@ -284,6 +271,11 @@ BuildRequires: gcc-ada
%endif
%if 0%{suse_version} > 1110
%ifarch x86_64 ppc64 s390x
%if 0%{suse_version} >= 1330
# Older distros miss this pseudo package, the Ada
# testsuite won't work completely
BuildRequires: gcc-ada-32bit
%endif
BuildRequires: gcc-c++-32bit
%endif
%endif
@ -465,32 +457,21 @@ find -name "*.info*"|xargs rm -f
%patch106 -p1
%patch107 -p1
%patch108 -p1
%patch108 -p1 -R
%patch109 -p1
%patch109 -p1 -R
%patch110 -p1
%patch110 -p1 -R
%patch111 -p1
%patch112 -p1
%patch112 -p1 -R
%patch113 -p1
%patch113 -p1 -R
%patch112 -p1 -R
%patch111 -p1 -R
%patch114 -p1
%patch114 -p1 -R
%patch115 -p1
%patch116 -p1
%patch117 -p1
%patch117 -p1 -R
%patch116 -p1 -R
%patch115 -p1 -R
#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.
@ -566,6 +547,7 @@ EXTRA_TARGETS=
--with-separate-debug-dir=/usr/lib/debug \
--disable-sim \
--disable-rpath \
--with-system-zlib \
%if %{suse_version} > 1110
--with-system-readline \
%else
@ -671,8 +653,6 @@ cd %{gdb_build}
#make %{?_smp_mflags} -C gdb/doc {gdb,annotate}{.info,/index.html,.pdf} MAKEHTMLFLAGS=--no-split
grep '#define HAVE_ZLIB_H 1' gdb/config.h
# Copy the <sourcetree>/gdb/NEWS file to the directory above it.
cp $RPM_BUILD_DIR/%{gdb_src}/gdb/NEWS $RPM_BUILD_DIR/%{gdb_src}