diff --git a/aarch64-avoid-initializers-for-vlas.patch b/aarch64-avoid-initializers-for-vlas.patch new file mode 100644 index 0000000..ef82521 --- /dev/null +++ b/aarch64-avoid-initializers-for-vlas.patch @@ -0,0 +1,50 @@ +From 0f363ed540fef466f45eab4570c23853e1f14898 Mon Sep 17 00:00:00 2001 +From: Roland McGrath +Date: Thu, 9 Feb 2023 10:47:17 -0800 +Subject: [PATCH] [aarch64] Avoid initializers for VLAs + +Clang doesn't accept initializer syntax for variable-length +arrays in C. Just use memset instead. +--- + gdb/aarch64-linux-nat.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c +index e4158236db2..ecb2eeb9540 100644 +--- a/gdb/aarch64-linux-nat.c ++++ b/gdb/aarch64-linux-nat.c +@@ -56,6 +56,8 @@ + + #include "nat/aarch64-mte-linux-ptrace.h" + ++#include ++ + #ifndef TRAP_HWBKPT + #define TRAP_HWBKPT 0x0004 + #endif +@@ -445,7 +447,9 @@ fetch_tlsregs_from_thread (struct regcache *regcache) + gdb_assert (regno != -1); + gdb_assert (tdep->tls_register_count > 0); + +- uint64_t tpidrs[tdep->tls_register_count] = { 0 }; ++ uint64_t tpidrs[tdep->tls_register_count]; ++ memset(tpidrs, 0, sizeof(tpidrs)); ++ + struct iovec iovec; + iovec.iov_base = tpidrs; + iovec.iov_len = sizeof (tpidrs); +@@ -471,7 +475,8 @@ store_tlsregs_to_thread (struct regcache *regcache) + gdb_assert (regno != -1); + gdb_assert (tdep->tls_register_count > 0); + +- uint64_t tpidrs[tdep->tls_register_count] = { 0 }; ++ uint64_t tpidrs[tdep->tls_register_count]; ++ memset(tpidrs, 0, sizeof(tpidrs)); + + for (int i = 0; i < tdep->tls_register_count; i++) + { + +base-commit: a39101060cdf2ee239833106fb3bdf9585f858aa +-- +2.35.3 + diff --git a/add-elfcompress_zstd.patch b/add-elfcompress_zstd.patch deleted file mode 100644 index 36e762b..0000000 --- a/add-elfcompress_zstd.patch +++ /dev/null @@ -1,29 +0,0 @@ -From f41928feb3e44fb27776afa062a1cd06263b7d1d Mon Sep 17 00:00:00 2001 -From: Cary Coutant -Date: Tue, 2 Aug 2022 16:19:43 -0700 -Subject: [PATCH 1/2] Add ELFCOMPRESS_ZSTD. - -include/elf/ - * common.h: Add ELFCOMPRESS_ZSTD. ---- - include/elf/common.h | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/include/elf/common.h b/include/elf/common.h -index 70d63e3299c..c409da2bd16 100644 ---- a/include/elf/common.h -+++ b/include/elf/common.h -@@ -588,6 +588,8 @@ - - /* Compression types. */ - #define ELFCOMPRESS_ZLIB 1 /* Compressed with zlib. */ -+#define ELFCOMPRESS_ZSTD 2 /* Compressed with zstd */ -+ /* (see http://www.zstandard.org). */ - #define ELFCOMPRESS_LOOS 0x60000000 /* OS-specific semantics, lo */ - #define ELFCOMPRESS_HIOS 0x6FFFFFFF /* OS-specific semantics, hi */ - #define ELFCOMPRESS_LOPROC 0x70000000 /* Processor-specific semantics, lo */ - -base-commit: 835a10f8541c7c4150098c82e097c4f606475cfa --- -2.35.3 - diff --git a/binutils-gdb-support-zstd-compressed-debug-section.patch b/binutils-gdb-support-zstd-compressed-debug-section.patch deleted file mode 100644 index 2520bec..0000000 --- a/binutils-gdb-support-zstd-compressed-debug-section.patch +++ /dev/null @@ -1,1288 +0,0 @@ -From 5a700ee4aabd1a2ed3530cab0b172c65b574ca41 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Thu, 23 Feb 2023 15:14:12 +0100 -Subject: [PATCH 2/2] binutils, gdb: support zstd compressed debug section - ---- - bfd/Makefile.am | 4 +- - bfd/Makefile.in | 13 ++- - bfd/aclocal.m4 | 2 + - bfd/bfd-in.h | 3 +- - bfd/bfd-in2.h | 12 +- - bfd/bfd.c | 26 +++-- - bfd/compress.c | 72 +++++++++--- - bfd/config.in | 3 + - bfd/configure | 268 ++++++++++++++++++++++++++++++++++++++++++++- - bfd/configure.ac | 3 +- - bfd/elf.c | 12 ++ - bfd/elfxx-target.h | 6 +- - bfd/section.c | 3 +- - config/zstd.m4 | 23 ++++ - configure | 10 ++ - configure.ac | 3 + - gdb/Makefile.in | 8 +- - gdb/NEWS | 2 + - gdb/acinclude.m4 | 3 +- - gdb/config.in | 3 + - gdb/configure | 137 ++++++++++++++++++++++- - gdb/configure.ac | 4 +- - 22 files changed, 570 insertions(+), 50 deletions(-) - create mode 100644 config/zstd.m4 - -diff --git a/bfd/Makefile.am b/bfd/Makefile.am -index b9a3f8207ac..e3fe1d34f6c 100644 ---- a/bfd/Makefile.am -+++ b/bfd/Makefile.am -@@ -57,7 +57,7 @@ ZLIBINC = @zlibinc@ - - WARN_CFLAGS = @WARN_CFLAGS@ - NO_WERROR = @NO_WERROR@ --AM_CFLAGS = $(WARN_CFLAGS) $(ZLIBINC) -+AM_CFLAGS = $(WARN_CFLAGS) $(ZLIBINC) $(ZSTD_CFLAGS) - AM_CPPFLAGS = -DBINDIR='"$(bindir)"' -DLIBDIR='"$(libdir)"' @LARGEFILE_CPPFLAGS@ - if PLUGINS - bfdinclude_HEADERS += $(INCDIR)/plugin-api.h -@@ -779,7 +779,7 @@ ofiles: stamp-ofiles ; @true - libbfd_la_SOURCES = $(BFD32_LIBS_CFILES) - EXTRA_libbfd_la_SOURCES = $(CFILES) - libbfd_la_DEPENDENCIES = $(OFILES) ofiles --libbfd_la_LIBADD = `cat ofiles` @SHARED_LIBADD@ $(LIBDL) $(ZLIB) -+libbfd_la_LIBADD = `cat ofiles` @SHARED_LIBADD@ $(LIBDL) $(ZLIB) $(ZSTD_LIBS) - libbfd_la_LDFLAGS += -release `cat libtool-soversion` @SHARED_LDFLAGS@ - - # libtool will build .libs/libbfd.a. We create libbfd.a in the build -diff --git a/bfd/Makefile.in b/bfd/Makefile.in -index 934dd4bc066..23b3e171c85 100644 ---- a/bfd/Makefile.in -+++ b/bfd/Makefile.in -@@ -122,10 +122,12 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ - $(top_srcdir)/../config/lead-dot.m4 \ - $(top_srcdir)/../config/nls.m4 \ - $(top_srcdir)/../config/override.m4 \ -+ $(top_srcdir)/../config/pkg.m4 \ - $(top_srcdir)/../config/plugins.m4 \ - $(top_srcdir)/../config/po.m4 \ - $(top_srcdir)/../config/progtest.m4 \ -- $(top_srcdir)/../config/zlib.m4 $(top_srcdir)/../libtool.m4 \ -+ $(top_srcdir)/../config/zlib.m4 \ -+ $(top_srcdir)/../config/zstd.m4 $(top_srcdir)/../libtool.m4 \ - $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ - $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ - $(top_srcdir)/bfd.m4 $(top_srcdir)/warning.m4 \ -@@ -405,6 +407,9 @@ PACKAGE_URL = @PACKAGE_URL@ - PACKAGE_VERSION = @PACKAGE_VERSION@ - PATH_SEPARATOR = @PATH_SEPARATOR@ - PKGVERSION = @PKGVERSION@ -+PKG_CONFIG = @PKG_CONFIG@ -+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ - POSUB = @POSUB@ - RANLIB = @RANLIB@ - REPORT_BUGS_TEXI = @REPORT_BUGS_TEXI@ -@@ -422,6 +427,8 @@ WARN_CFLAGS = @WARN_CFLAGS@ - WARN_CFLAGS_FOR_BUILD = @WARN_CFLAGS_FOR_BUILD@ - WARN_WRITE_STRINGS = @WARN_WRITE_STRINGS@ - XGETTEXT = @XGETTEXT@ -+ZSTD_CFLAGS = @ZSTD_CFLAGS@ -+ZSTD_LIBS = @ZSTD_LIBS@ - abs_builddir = @abs_builddir@ - abs_srcdir = @abs_srcdir@ - abs_top_builddir = @abs_top_builddir@ -@@ -526,7 +533,7 @@ libbfd_la_LDFLAGS = $(am__append_1) -release `cat libtool-soversion` \ - # case both are empty. - ZLIB = @zlibdir@ -lz - ZLIBINC = @zlibinc@ --AM_CFLAGS = $(WARN_CFLAGS) $(ZLIBINC) -+AM_CFLAGS = $(WARN_CFLAGS) $(ZLIBINC) $(ZSTD_CFLAGS) - AM_CPPFLAGS = -DBINDIR='"$(bindir)"' -DLIBDIR='"$(libdir)"' \ - @LARGEFILE_CPPFLAGS@ @HDEFINES@ @COREFLAG@ @TDEFINES@ \ - $(CSEARCH) $(CSWITCHES) $(HAVEVECS) @INCINTL@ -@@ -1208,7 +1215,7 @@ OFILES = $(BFD_BACKENDS) $(BFD_MACHINES) @COREFILE@ @bfd64_libs@ - libbfd_la_SOURCES = $(BFD32_LIBS_CFILES) - EXTRA_libbfd_la_SOURCES = $(CFILES) - libbfd_la_DEPENDENCIES = $(OFILES) ofiles --libbfd_la_LIBADD = `cat ofiles` @SHARED_LIBADD@ $(LIBDL) $(ZLIB) -+libbfd_la_LIBADD = `cat ofiles` @SHARED_LIBADD@ $(LIBDL) $(ZLIB) $(ZSTD_LIBS) - - # libtool will build .libs/libbfd.a. We create libbfd.a in the build - # directory so that we don't have to convert all the programs that use -diff --git a/bfd/aclocal.m4 b/bfd/aclocal.m4 -index 0f8aa1d4518..09b849dfc87 100644 ---- a/bfd/aclocal.m4 -+++ b/bfd/aclocal.m4 -@@ -1176,10 +1176,12 @@ m4_include([../config/largefile.m4]) - m4_include([../config/lead-dot.m4]) - m4_include([../config/nls.m4]) - m4_include([../config/override.m4]) -+m4_include([../config/pkg.m4]) - m4_include([../config/plugins.m4]) - m4_include([../config/po.m4]) - m4_include([../config/progtest.m4]) - m4_include([../config/zlib.m4]) -+m4_include([../config/zstd.m4]) - m4_include([../libtool.m4]) - m4_include([../ltoptions.m4]) - m4_include([../ltsugar.m4]) -diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h -index a1c4bf139fc..76f841fe457 100644 ---- a/bfd/bfd-in.h -+++ b/bfd/bfd-in.h -@@ -387,7 +387,8 @@ enum compressed_debug_section_type - COMPRESS_DEBUG_NONE = 0, - COMPRESS_DEBUG = 1 << 0, - COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1, -- COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2 -+ COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2, -+ COMPRESS_DEBUG_ZSTD = COMPRESS_DEBUG | 1 << 3 - }; - - /* This structure is used to keep track of stabs in sections -diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h -index c0b563aec02..85ab198d179 100644 ---- a/bfd/bfd-in2.h -+++ b/bfd/bfd-in2.h -@@ -394,7 +394,8 @@ enum compressed_debug_section_type - COMPRESS_DEBUG_NONE = 0, - COMPRESS_DEBUG = 1 << 0, - COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1, -- COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2 -+ COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2, -+ COMPRESS_DEBUG_ZSTD = COMPRESS_DEBUG | 1 << 3 - }; - - /* This structure is used to keep track of stabs in sections -@@ -1007,7 +1008,8 @@ typedef struct bfd_section - unsigned int compress_status : 2; - #define COMPRESS_SECTION_NONE 0 - #define COMPRESS_SECTION_DONE 1 --#define DECOMPRESS_SECTION_SIZED 2 -+#define DECOMPRESS_SECTION_ZLIB 2 -+#define DECOMPRESS_SECTION_ZSTD 3 - - /* The following flags are used by the ELF linker. */ - -@@ -6672,11 +6674,14 @@ struct bfd - /* Put pathnames into archives (non-POSIX). */ - #define BFD_ARCHIVE_FULL_PATH 0x100000 - -+ /* Compress sections in this BFD with SHF_COMPRESSED zstd. */ -+#define BFD_COMPRESS_ZSTD 0x400000 -+ - /* Flags bits to be saved in bfd_preserve_save. */ - #define BFD_FLAGS_SAVED \ - (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ - | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \ -- | BFD_USE_ELF_STT_COMMON) -+ | BFD_USE_ELF_STT_COMMON | BFD_COMPRESS_ZSTD) - - /* Flags bits which are for BFD use only. */ - #define BFD_FLAGS_FOR_BFD_USE_MASK \ -@@ -7300,6 +7305,7 @@ void bfd_update_compression_header - - bool bfd_check_compression_header - (bfd *abfd, bfd_byte *contents, asection *sec, -+ unsigned int *ch_type, - bfd_size_type *uncompressed_size, - unsigned int *uncompressed_alignment_power); - -diff --git a/bfd/bfd.c b/bfd/bfd.c -index 913ce2d6abe..c5fca601ce8 100644 ---- a/bfd/bfd.c -+++ b/bfd/bfd.c -@@ -176,11 +176,14 @@ CODE_FRAGMENT - . {* Put pathnames into archives (non-POSIX). *} - .#define BFD_ARCHIVE_FULL_PATH 0x100000 - . -+. {* Compress sections in this BFD with SHF_COMPRESSED zstd. *} -+.#define BFD_COMPRESS_ZSTD 0x400000 -+. - . {* Flags bits to be saved in bfd_preserve_save. *} - .#define BFD_FLAGS_SAVED \ - . (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ - . | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \ --. | BFD_USE_ELF_STT_COMMON) -+. | BFD_USE_ELF_STT_COMMON | BFD_COMPRESS_ZSTD) - . - . {* Flags bits which are for BFD use only. *} - .#define BFD_FLAGS_FOR_BFD_USE_MASK \ -@@ -2492,6 +2495,9 @@ bfd_update_compression_header (bfd *abfd, bfd_byte *contents, - { - const struct elf_backend_data *bed = get_elf_backend_data (abfd); - struct bfd_elf_section_data * esd = elf_section_data (sec); -+ const unsigned int ch_type = abfd->flags & BFD_COMPRESS_ZSTD -+ ? ELFCOMPRESS_ZSTD -+ : ELFCOMPRESS_ZLIB; - - /* Set the SHF_COMPRESSED bit. */ - elf_section_flags (sec) |= SHF_COMPRESSED; -@@ -2499,7 +2505,7 @@ bfd_update_compression_header (bfd *abfd, bfd_byte *contents, - if (bed->s->elfclass == ELFCLASS32) - { - Elf32_External_Chdr *echdr = (Elf32_External_Chdr *) contents; -- bfd_put_32 (abfd, ELFCOMPRESS_ZLIB, &echdr->ch_type); -+ bfd_put_32 (abfd, ch_type, &echdr->ch_type); - bfd_put_32 (abfd, sec->size, &echdr->ch_size); - bfd_put_32 (abfd, 1u << sec->alignment_power, - &echdr->ch_addralign); -@@ -2510,7 +2516,7 @@ bfd_update_compression_header (bfd *abfd, bfd_byte *contents, - else - { - Elf64_External_Chdr *echdr = (Elf64_External_Chdr *) contents; -- bfd_put_32 (abfd, ELFCOMPRESS_ZLIB, &echdr->ch_type); -+ bfd_put_32 (abfd, ch_type, &echdr->ch_type); - bfd_put_32 (abfd, 0, &echdr->ch_reserved); - bfd_put_64 (abfd, sec->size, &echdr->ch_size); - bfd_put_64 (abfd, UINT64_C (1) << sec->alignment_power, -@@ -2545,14 +2551,15 @@ bfd_update_compression_header (bfd *abfd, bfd_byte *contents, - SYNOPSIS - bool bfd_check_compression_header - (bfd *abfd, bfd_byte *contents, asection *sec, -+ unsigned int *ch_type, - bfd_size_type *uncompressed_size, - unsigned int *uncompressed_alignment_power); - - DESCRIPTION -- Check the compression header at CONTENTS of SEC in ABFD and -- store the uncompressed size in UNCOMPRESSED_SIZE and the -- uncompressed data alignment in UNCOMPRESSED_ALIGNMENT_POWER -- if the compression header is valid. -+ Check the compression header at CONTENTS of SEC in ABFD and store the -+ ch_type in CH_TYPE, uncompressed size in UNCOMPRESSED_SIZE, and the -+ uncompressed data alignment in UNCOMPRESSED_ALIGNMENT_POWER if the -+ compression header is valid. - - RETURNS - Return TRUE if the compression header is valid. -@@ -2561,6 +2568,7 @@ RETURNS - bool - bfd_check_compression_header (bfd *abfd, bfd_byte *contents, - asection *sec, -+ unsigned int *ch_type, - bfd_size_type *uncompressed_size, - unsigned int *uncompressed_alignment_power) - { -@@ -2583,7 +2591,9 @@ bfd_check_compression_header (bfd *abfd, bfd_byte *contents, - chdr.ch_size = bfd_get_64 (abfd, &echdr->ch_size); - chdr.ch_addralign = bfd_get_64 (abfd, &echdr->ch_addralign); - } -- if (chdr.ch_type == ELFCOMPRESS_ZLIB -+ *ch_type = chdr.ch_type; -+ if ((chdr.ch_type == ELFCOMPRESS_ZLIB -+ || chdr.ch_type == ELFCOMPRESS_ZSTD) - && chdr.ch_addralign == (chdr.ch_addralign & -chdr.ch_addralign)) - { - *uncompressed_size = chdr.ch_size; -diff --git a/bfd/compress.c b/bfd/compress.c -index b2e39826e38..0e75b687013 100644 ---- a/bfd/compress.c -+++ b/bfd/compress.c -@@ -20,18 +20,31 @@ - - #include "sysdep.h" - #include -+#ifdef HAVE_ZSTD -+#include -+#endif - #include "bfd.h" -+#include "elf-bfd.h" - #include "libbfd.h" - #include "safe-ctype.h" - - #define MAX_COMPRESSION_HEADER_SIZE 24 - - static bool --decompress_contents (bfd_byte *compressed_buffer, -+decompress_contents (bool is_zstd, bfd_byte *compressed_buffer, - bfd_size_type compressed_size, - bfd_byte *uncompressed_buffer, - bfd_size_type uncompressed_size) - { -+ if (is_zstd) -+ { -+#ifdef HAVE_ZSTD -+ size_t ret = ZSTD_decompress (uncompressed_buffer, uncompressed_size, -+ compressed_buffer, compressed_size); -+ return !ZSTD_isError (ret); -+#endif -+ } -+ - z_stream strm; - int rc; - -@@ -69,7 +82,7 @@ decompress_contents (bfd_byte *compressed_buffer, - } - - /* Compress data of the size specified in @var{uncompressed_size} -- and pointed to by @var{uncompressed_buffer} using zlib and store -+ and pointed to by @var{uncompressed_buffer} using zlib/zstd and store - as the contents field. This function assumes the contents - field was allocated using bfd_malloc() or equivalent. - -@@ -150,9 +163,10 @@ bfd_compress_section_contents (bfd *abfd, sec_ptr sec, - sec->size = orig_uncompressed_size; - if (decompress) - { -- if (!decompress_contents (uncompressed_buffer -- + orig_compression_header_size, -- zlib_size, buffer, buffer_size)) -+ if (!decompress_contents ( -+ sec->compress_status == DECOMPRESS_SECTION_ZSTD, -+ uncompressed_buffer + orig_compression_header_size, -+ zlib_size, buffer, buffer_size)) - { - bfd_set_error (bfd_error_bad_value); - bfd_release (abfd, buffer); -@@ -175,10 +189,23 @@ bfd_compress_section_contents (bfd *abfd, sec_ptr sec, - } - else - { -- if (compress ((Bytef*) buffer + header_size, -- &compressed_size, -- (const Bytef*) uncompressed_buffer, -- uncompressed_size) != Z_OK) -+ if (abfd->flags & BFD_COMPRESS_ZSTD) -+ { -+#if HAVE_ZSTD -+ compressed_size = ZSTD_compress ( -+ buffer + header_size, compressed_size, uncompressed_buffer, -+ uncompressed_size, ZSTD_CLEVEL_DEFAULT); -+ if (ZSTD_isError (compressed_size)) -+ { -+ bfd_release (abfd, buffer); -+ bfd_set_error (bfd_error_bad_value); -+ return 0; -+ } -+#endif -+ } -+ else if (compress ((Bytef *)buffer + header_size, &compressed_size, -+ (const Bytef *)uncompressed_buffer, uncompressed_size) -+ != Z_OK) - { - bfd_release (abfd, buffer); - bfd_set_error (bfd_error_bad_value); -@@ -237,6 +264,7 @@ bfd_get_full_section_contents (bfd *abfd, sec_ptr sec, bfd_byte **ptr) - bfd_size_type save_rawsize; - bfd_byte *compressed_buffer; - unsigned int compression_header_size; -+ const unsigned int compress_status = sec->compress_status; - - if (abfd->direction != write_direction && sec->rawsize != 0) - sz = sec->rawsize; -@@ -248,7 +276,7 @@ bfd_get_full_section_contents (bfd *abfd, sec_ptr sec, bfd_byte **ptr) - return true; - } - -- switch (sec->compress_status) -+ switch (compress_status) - { - case COMPRESS_SECTION_NONE: - if (p == NULL) -@@ -298,7 +326,8 @@ bfd_get_full_section_contents (bfd *abfd, sec_ptr sec, bfd_byte **ptr) - *ptr = p; - return true; - -- case DECOMPRESS_SECTION_SIZED: -+ case DECOMPRESS_SECTION_ZLIB: -+ case DECOMPRESS_SECTION_ZSTD: - /* Read in the full compressed section contents. */ - compressed_buffer = (bfd_byte *) bfd_malloc (sec->compressed_size); - if (compressed_buffer == NULL) -@@ -316,7 +345,7 @@ bfd_get_full_section_contents (bfd *abfd, sec_ptr sec, bfd_byte **ptr) - /* Restore rawsize and size. */ - sec->rawsize = save_rawsize; - sec->size = save_size; -- sec->compress_status = DECOMPRESS_SECTION_SIZED; -+ sec->compress_status = compress_status; - if (!ret) - goto fail_compressed; - -@@ -330,8 +359,10 @@ bfd_get_full_section_contents (bfd *abfd, sec_ptr sec, bfd_byte **ptr) - /* Set header size to the zlib header size if it is a - SHF_COMPRESSED section. */ - compression_header_size = 12; -- if (!decompress_contents (compressed_buffer + compression_header_size, -- sec->compressed_size - compression_header_size, p, sz)) -+ bool is_zstd = compress_status == DECOMPRESS_SECTION_ZSTD; -+ if (!decompress_contents ( -+ is_zstd, compressed_buffer + compression_header_size, -+ sec->compressed_size - compression_header_size, p, sz)) - { - bfd_set_error (bfd_error_bad_value); - if (p != *ptr) -@@ -381,7 +412,8 @@ DESCRIPTION - void - bfd_cache_section_contents (asection *sec, void *contents) - { -- if (sec->compress_status == DECOMPRESS_SECTION_SIZED) -+ if (sec->compress_status == DECOMPRESS_SECTION_ZLIB -+ || sec->compress_status == DECOMPRESS_SECTION_ZSTD) - sec->compress_status = COMPRESS_SECTION_DONE; - sec->contents = contents; - sec->flags |= SEC_IN_MEMORY; -@@ -418,6 +450,7 @@ bfd_is_section_compressed_with_header (bfd *abfd, sec_ptr sec, - int compression_header_size; - int header_size; - unsigned int saved = sec->compress_status; -+ unsigned int ch_type; - bool compressed; - - *uncompressed_align_pow_p = 0; -@@ -448,7 +481,7 @@ bfd_is_section_compressed_with_header (bfd *abfd, sec_ptr sec, - { - if (compression_header_size != 0) - { -- if (!bfd_check_compression_header (abfd, header, sec, -+ if (!bfd_check_compression_header (abfd, header, sec, &ch_type, - uncompressed_size_p, - uncompressed_align_pow_p)) - compression_header_size = -1; -@@ -507,7 +540,7 @@ SYNOPSIS - DESCRIPTION - Record compressed section size, update section size with - decompressed size and set compress_status to -- DECOMPRESS_SECTION_SIZED. -+ DECOMPRESS_SECTION_{ZLIB,ZSTD}. - - Return @code{FALSE} if the section is not a valid compressed - section. Otherwise, return @code{TRUE}. -@@ -521,6 +554,7 @@ bfd_init_section_decompress_status (bfd *abfd, sec_ptr sec) - int header_size; - bfd_size_type uncompressed_size; - unsigned int uncompressed_alignment_power = 0; -+ unsigned int ch_type; - z_stream strm; - - compression_header_size = bfd_get_compression_header_size (abfd, sec); -@@ -550,6 +584,7 @@ bfd_init_section_decompress_status (bfd *abfd, sec_ptr sec) - uncompressed_size = bfd_getb64 (header + 4); - } - else if (!bfd_check_compression_header (abfd, header, sec, -+ &ch_type, - &uncompressed_size, - &uncompressed_alignment_power)) - { -@@ -569,7 +604,8 @@ bfd_init_section_decompress_status (bfd *abfd, sec_ptr sec) - sec->compressed_size = sec->size; - sec->size = uncompressed_size; - bfd_set_section_alignment (sec, uncompressed_alignment_power); -- sec->compress_status = DECOMPRESS_SECTION_SIZED; -+ sec->compress_status = (ch_type == ELFCOMPRESS_ZSTD -+ ? DECOMPRESS_SECTION_ZSTD : DECOMPRESS_SECTION_ZLIB); - - return true; - } -diff --git a/bfd/config.in b/bfd/config.in -index f54a3cacbea..a59304e0a66 100644 ---- a/bfd/config.in -+++ b/bfd/config.in -@@ -232,6 +232,9 @@ - /* Define to 1 if you have the header file. */ - #undef HAVE_WINDOWS_H - -+/* Define to 1 if zstd is enabled. */ -+#undef HAVE_ZSTD -+ - /* Define to the sub-directory in which libtool stores uninstalled libraries. - */ - #undef LT_OBJDIR -diff --git a/bfd/configure b/bfd/configure -index 0ef4c206fb0..04004f9d3eb 100755 ---- a/bfd/configure -+++ b/bfd/configure -@@ -652,6 +652,11 @@ TDEFINES - SHARED_LIBADD - SHARED_LDFLAGS - LIBM -+ZSTD_LIBS -+ZSTD_CFLAGS -+PKG_CONFIG_LIBDIR -+PKG_CONFIG_PATH -+PKG_CONFIG - zlibinc - zlibdir - EXEEXT_FOR_BUILD -@@ -845,6 +850,7 @@ enable_maintainer_mode - enable_install_libbfd - enable_nls - with_system_zlib -+with_zstd - ' - ac_precious_vars='build_alias - host_alias -@@ -854,7 +860,12 @@ CFLAGS - LDFLAGS - LIBS - CPPFLAGS --CPP' -+CPP -+PKG_CONFIG -+PKG_CONFIG_PATH -+PKG_CONFIG_LIBDIR -+ZSTD_CFLAGS -+ZSTD_LIBS' - - - # Initialize some variables set by options. -@@ -1517,6 +1528,8 @@ Optional Packages: - Binutils" - --with-bugurl=URL Direct users to URL to report a bug - --with-system-zlib use installed libz -+ --with-zstd support zstd compressed debug sections -+ (default=auto) - - Some influential environment variables: - CC C compiler command -@@ -1527,6 +1540,13 @@ Some influential environment variables: - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CPP C preprocessor -+ PKG_CONFIG path to pkg-config utility -+ PKG_CONFIG_PATH -+ directories to add to pkg-config's search path -+ PKG_CONFIG_LIBDIR -+ path overriding pkg-config's built-in search path -+ ZSTD_CFLAGS C compiler flags for ZSTD, overriding pkg-config -+ ZSTD_LIBS linker flags for ZSTD, overriding pkg-config - - Use these variables to override the choices made by `configure' or to help - it to find libraries and programs with nonstandard names/locations. -@@ -11086,7 +11106,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11089 "configure" -+#line 11109 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -11192,7 +11212,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11195 "configure" -+#line 11215 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -13010,7 +13030,7 @@ $as_echo "#define USE_BINARY_FOPEN 1" >>confdefs.h - ;; - esac - --# Link in zlib if we can. This allows us to read compressed debug sections. -+# Link in zlib/zstd if we can. This allows us to read compressed debug sections. - # This is used only by compress.c. - - # Use the system's zlib library. -@@ -13030,6 +13050,246 @@ fi - - - -+ -+ -+ -+ -+ -+ -+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then -+ if test -n "$ac_tool_prefix"; then -+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. -+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_path_PKG_CONFIG+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ case $PKG_CONFIG in -+ [\\/]* | ?:[\\/]*) -+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. -+ ;; -+ *) -+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+ ;; -+esac -+fi -+PKG_CONFIG=$ac_cv_path_PKG_CONFIG -+if test -n "$PKG_CONFIG"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -+$as_echo "$PKG_CONFIG" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ -+fi -+if test -z "$ac_cv_path_PKG_CONFIG"; then -+ ac_pt_PKG_CONFIG=$PKG_CONFIG -+ # Extract the first word of "pkg-config", so it can be a program name with args. -+set dummy pkg-config; ac_word=$2 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ case $ac_pt_PKG_CONFIG in -+ [\\/]* | ?:[\\/]*) -+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. -+ ;; -+ *) -+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+ ;; -+esac -+fi -+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG -+if test -n "$ac_pt_PKG_CONFIG"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 -+$as_echo "$ac_pt_PKG_CONFIG" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ if test "x$ac_pt_PKG_CONFIG" = x; then -+ PKG_CONFIG="" -+ else -+ case $cross_compiling:$ac_tool_warned in -+yes:) -+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -+ac_tool_warned=yes ;; -+esac -+ PKG_CONFIG=$ac_pt_PKG_CONFIG -+ fi -+else -+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG" -+fi -+ -+fi -+if test -n "$PKG_CONFIG"; then -+ _pkg_min_version=0.9.0 -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 -+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } -+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -+$as_echo "yes" >&6; } -+ else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+ PKG_CONFIG="" -+ fi -+fi -+ -+ -+# Check whether --with-zstd was given. -+if test "${with_zstd+set}" = set; then : -+ withval=$with_zstd; -+else -+ with_zstd=auto -+fi -+ -+ -+if test "$with_zstd" != no; then -+ -+pkg_failed=no -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libzstd" >&5 -+$as_echo_n "checking for libzstd... " >&6; } -+ -+if test -n "$ZSTD_CFLAGS"; then -+ pkg_cv_ZSTD_CFLAGS="$ZSTD_CFLAGS" -+ elif test -n "$PKG_CONFIG"; then -+ if test -n "$PKG_CONFIG" && \ -+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libzstd\""; } >&5 -+ ($PKG_CONFIG --exists --print-errors "libzstd") 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; then -+ pkg_cv_ZSTD_CFLAGS=`$PKG_CONFIG --cflags "libzstd" 2>/dev/null` -+ test "x$?" != "x0" && pkg_failed=yes -+else -+ pkg_failed=yes -+fi -+ else -+ pkg_failed=untried -+fi -+if test -n "$ZSTD_LIBS"; then -+ pkg_cv_ZSTD_LIBS="$ZSTD_LIBS" -+ elif test -n "$PKG_CONFIG"; then -+ if test -n "$PKG_CONFIG" && \ -+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libzstd\""; } >&5 -+ ($PKG_CONFIG --exists --print-errors "libzstd") 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; then -+ pkg_cv_ZSTD_LIBS=`$PKG_CONFIG --libs "libzstd" 2>/dev/null` -+ test "x$?" != "x0" && pkg_failed=yes -+else -+ pkg_failed=yes -+fi -+ else -+ pkg_failed=untried -+fi -+ -+if test $pkg_failed = no; then -+ pkg_save_LDFLAGS="$LDFLAGS" -+ LDFLAGS="$LDFLAGS $pkg_cv_ZSTD_LIBS" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : -+ -+else -+ pkg_failed=yes -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+ LDFLAGS=$pkg_save_LDFLAGS -+fi -+ -+ -+ -+if test $pkg_failed = yes; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+ -+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then -+ _pkg_short_errors_supported=yes -+else -+ _pkg_short_errors_supported=no -+fi -+ if test $_pkg_short_errors_supported = yes; then -+ ZSTD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libzstd" 2>&1` -+ else -+ ZSTD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libzstd" 2>&1` -+ fi -+ # Put the nasty error message in config.log where it belongs -+ echo "$ZSTD_PKG_ERRORS" >&5 -+ -+ -+ if test "$with_zstd" = yes; then -+ as_fn_error $? "--with-zstd was given, but pkgconfig/libzstd.pc is not found" "$LINENO" 5 -+ fi -+ -+elif test $pkg_failed = untried; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+ -+ if test "$with_zstd" = yes; then -+ as_fn_error $? "--with-zstd was given, but pkgconfig/libzstd.pc is not found" "$LINENO" 5 -+ fi -+ -+else -+ ZSTD_CFLAGS=$pkg_cv_ZSTD_CFLAGS -+ ZSTD_LIBS=$pkg_cv_ZSTD_LIBS -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -+$as_echo "yes" >&6; } -+ -+ -+$as_echo "#define HAVE_ZSTD 1" >>confdefs.h -+ -+ -+fi -+fi -+ -+ - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Werror" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking compiler support for hidden visibility" >&5 -diff --git a/bfd/configure.ac b/bfd/configure.ac -index 9e873736792..62145b81063 100644 ---- a/bfd/configure.ac -+++ b/bfd/configure.ac -@@ -263,9 +263,10 @@ AC_CHECK_DECLS([basename, ffs, stpcpy, asprintf, vasprintf, strnlen]) - - BFD_BINARY_FOPEN - --# Link in zlib if we can. This allows us to read compressed debug sections. -+# Link in zlib/zstd if we can. This allows us to read compressed debug sections. - # This is used only by compress.c. - AM_ZLIB -+AC_ZSTD - - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Werror" -diff --git a/bfd/elf.c b/bfd/elf.c -index 82b53be99f9..ffdd2f507e5 100644 ---- a/bfd/elf.c -+++ b/bfd/elf.c -@@ -1252,6 +1252,18 @@ _bfd_elf_make_section_from_shdr (bfd *abfd, - abfd, name); - return false; - } -+#ifndef HAVE_ZSTD -+ if (newsect->compress_status == DECOMPRESS_SECTION_ZSTD) -+ { -+ _bfd_error_handler -+ /* xgettext:c-format */ -+ (_ ("%pB: section %s is compressed with zstd, but BFD " -+ "is not built with zstd support"), -+ abfd, name); -+ newsect->compress_status = COMPRESS_SECTION_NONE; -+ return false; -+ } -+#endif - } - - if (abfd->is_linker_input) -diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h -index 0579f64d1a0..4c03660f782 100644 ---- a/bfd/elfxx-target.h -+++ b/bfd/elfxx-target.h -@@ -985,7 +985,8 @@ const bfd_target TARGET_BIG_SYM = - /* object_flags: mask of all file flags */ - (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS - | DYNAMIC | WP_TEXT | D_PAGED | BFD_COMPRESS | BFD_DECOMPRESS -- | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON), -+ | BFD_COMPRESS_GABI | BFD_COMPRESS_ZSTD | BFD_CONVERT_ELF_COMMON -+ | BFD_USE_ELF_STT_COMMON), - - /* section_flags: mask of all section flags */ - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY -@@ -1089,7 +1090,8 @@ const bfd_target TARGET_LITTLE_SYM = - /* object_flags: mask of all file flags */ - (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS - | DYNAMIC | WP_TEXT | D_PAGED | BFD_COMPRESS | BFD_DECOMPRESS -- | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON), -+ | BFD_COMPRESS_GABI | BFD_COMPRESS_ZSTD | BFD_CONVERT_ELF_COMMON -+ | BFD_USE_ELF_STT_COMMON), - - /* section_flags: mask of all section flags */ - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY -diff --git a/bfd/section.c b/bfd/section.c -index 9a1071454f5..bca3c1340c2 100644 ---- a/bfd/section.c -+++ b/bfd/section.c -@@ -392,7 +392,8 @@ CODE_FRAGMENT - . unsigned int compress_status : 2; - .#define COMPRESS_SECTION_NONE 0 - .#define COMPRESS_SECTION_DONE 1 --.#define DECOMPRESS_SECTION_SIZED 2 -+.#define DECOMPRESS_SECTION_ZLIB 2 -+.#define DECOMPRESS_SECTION_ZSTD 3 - . - . {* The following flags are used by the ELF linker. *} - . -diff --git a/config/zstd.m4 b/config/zstd.m4 -new file mode 100644 -index 00000000000..6da4db68c58 ---- /dev/null -+++ b/config/zstd.m4 -@@ -0,0 +1,23 @@ -+dnl Copyright (C) 2022 Free Software Foundation, Inc. -+dnl This file is free software, distributed under the terms of the GNU -+dnl General Public License. As a special exception to the GNU General -+dnl Public License, this file may be distributed as part of a program -+dnl that contains a configuration script generated by Autoconf, under -+dnl the same distribution terms as the rest of that program. -+ -+dnl Enable features using the zstd library. -+AC_DEFUN([AC_ZSTD], [ -+AC_ARG_WITH(zstd, -+ [AS_HELP_STRING([--with-zstd], [support zstd compressed debug sections (default=auto)])], -+ [], [with_zstd=auto]) -+ -+AS_IF([test "$with_zstd" != no], -+ [PKG_CHECK_MODULES(ZSTD, [libzstd], [ -+ AC_DEFINE(HAVE_ZSTD, 1, [Define to 1 if zstd is enabled.]) -+ ], [ -+ if test "$with_zstd" = yes; then -+ AC_MSG_ERROR([--with-zstd was given, but pkgconfig/libzstd.pc is not found]) -+ fi -+ ]) -+ ]) -+]) -diff --git a/configure b/configure -index 26935ebda24..9149d7be19a 100755 ---- a/configure -+++ b/configure -@@ -783,6 +783,7 @@ ac_user_opts=' - enable_option_checking - with_build_libsubdir - with_system_zlib -+with_zstd - enable_as_accelerator_for - enable_offload_targets - enable_gold -@@ -1563,6 +1564,8 @@ Optional Packages: - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-build-libsubdir=DIR Directory where to find libraries for build system - --with-system-zlib use installed libz -+ --with-zstd Support zstd compressed debug sections -+ (default=auto) - --with-mpc=PATH specify prefix directory for installed MPC package. - Equivalent to --with-mpc-include=PATH/include plus - --with-mpc-lib=PATH/lib -@@ -2921,6 +2924,13 @@ if test x$with_system_zlib = xyes ; then - noconfigdirs="$noconfigdirs zlib" - fi - -+ -+# Check whether --with-zstd was given. -+if test "${with_zstd+set}" = set; then : -+ withval=$with_zstd; -+fi -+ -+ - # Don't compile the bundled readline/libreadline.a if --with-system-readline - # is provided. - if test x$with_system_readline = xyes ; then -diff --git a/configure.ac b/configure.ac -index bb8bdfb6ec0..388247fd87a 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -246,6 +246,9 @@ if test x$with_system_zlib = xyes ; then - noconfigdirs="$noconfigdirs zlib" - fi - -+AC_ARG_WITH(zstd, -+[AS_HELP_STRING([--with-zstd], [Support zstd compressed debug sections (default=auto)])]) -+ - # Don't compile the bundled readline/libreadline.a if --with-system-readline - # is provided. - if test x$with_system_readline = xyes ; then -diff --git a/gdb/Makefile.in b/gdb/Makefile.in -index b66ed380a79..39a3aa16936 100644 ---- a/gdb/Makefile.in -+++ b/gdb/Makefile.in -@@ -173,6 +173,9 @@ BFD_CFLAGS = -I$(BFD_DIR) -I$(BFD_SRC) - ZLIB = @zlibdir@ -lz - ZLIBINC = @zlibinc@ - -+ZSTD_CFLAGS = @ZSTD_CFLAGS@ -+ZSTD_LIBS = @ZSTD_LIBS@ -+ - # Where is the decnumber library? Typically in ../libdecnumber. - LIBDECNUMBER_DIR = ../libdecnumber - LIBDECNUMBER = $(LIBDECNUMBER_DIR)/libdecnumber.a -@@ -622,7 +625,7 @@ INTERNAL_CPPFLAGS = $(CPPFLAGS) @GUILE_CPPFLAGS@ @PYTHON_CPPFLAGS@ \ - INTERNAL_CFLAGS_BASE = \ - $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) \ - $(GDB_CFLAGS) $(OPCODES_CFLAGS) $(READLINE_CFLAGS) $(ZLIBINC) \ -- $(BFD_CFLAGS) $(INCLUDE_CFLAGS) $(LIBDECNUMBER_CFLAGS) \ -+ $(ZSTD_CFLAGS) $(BFD_CFLAGS) $(INCLUDE_CFLAGS) $(LIBDECNUMBER_CFLAGS) \ - $(INTL_CFLAGS) $(INCGNU) $(INCSUPPORT) $(LIBBACKTRACE_INC) \ - $(ENABLE_CFLAGS) $(INTERNAL_CPPFLAGS) $(SRCHIGH_CFLAGS) \ - $(TOP_CFLAGS) $(PTHREAD_CFLAGS) $(DEBUGINFOD_CFLAGS) -@@ -644,7 +647,7 @@ INTERNAL_LDFLAGS = \ - # Libraries and corresponding dependencies for compiling gdb. - # XM_CLIBS, defined in *config files, have host-dependent libs. - # LIBIBERTY appears twice on purpose. --CLIBS = $(SIM) $(READLINE) $(OPCODES) $(LIBCTF) $(BFD) $(ZLIB) \ -+CLIBS = $(SIM) $(READLINE) $(OPCODES) $(LIBCTF) $(BFD) $(ZLIB) $(ZSTD_LIBS) \ - $(LIBSUPPORT) $(INTL) $(LIBIBERTY) $(LIBDECNUMBER) \ - $(XM_CLIBS) $(GDBTKLIBS) $(LIBBACKTRACE_LIB) \ - @LIBS@ @GUILE_LIBS@ @PYTHON_LIBS@ \ -@@ -2090,6 +2093,7 @@ aclocal_m4_deps = \ - ../config/lcmessage.m4 \ - ../config/codeset.m4 \ - ../config/zlib.m4 \ -+ ../config/zstd.m4 \ - ../config/ax_pthread.m4 - - $(srcdir)/aclocal.m4: @MAINTAINER_MODE_TRUE@ $(aclocal_m4_deps) -diff --git a/gdb/NEWS b/gdb/NEWS -index 501ace1872e..51baf910761 100644 ---- a/gdb/NEWS -+++ b/gdb/NEWS -@@ -36,6 +36,8 @@ - Disabling this can cause a performance penalty when there are a lot of - symbols to load, but is useful for debugging purposes. - -+* gdb now supports zstd compressed debug sections (ELFCOMPRESS_ZSTD) for ELF. -+ - * New commands - - maint set backtrace-on-fatal-signal on|off -diff --git a/gdb/acinclude.m4 b/gdb/acinclude.m4 -index 95ff2b6f35e..28846119dcb 100644 ---- a/gdb/acinclude.m4 -+++ b/gdb/acinclude.m4 -@@ -43,6 +43,7 @@ m4_include([../config/lib-link.m4]) - m4_include([../config/iconv.m4]) - - m4_include([../config/zlib.m4]) -+m4_include([../config/zstd.m4]) - - m4_include([../gdbsupport/common.m4]) - -@@ -233,7 +234,7 @@ AC_DEFUN([GDB_AC_CHECK_BFD], [ - # always want our bfd. - CFLAGS="-I${srcdir}/../include -I../bfd -I${srcdir}/../bfd $CFLAGS" - ZLIBDIR=`echo $zlibdir | sed 's,\$(top_builddir)/,,g'` -- LDFLAGS="-L../bfd -L../libiberty $ZLIBDIR $LDFLAGS" -+ LDFLAGS="-L../bfd -L../libiberty $ZLIBDIR $ZSTD_LIBS $LDFLAGS" - intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'` - LIBS="-lbfd -liberty -lz $intl $LIBS" - AC_CACHE_CHECK( -diff --git a/gdb/config.in b/gdb/config.in -index 422ccdde171..3ba0a5b5ceb 100644 ---- a/gdb/config.in -+++ b/gdb/config.in -@@ -598,6 +598,9 @@ - /* Define to 1 if you have the `XML_StopParser' function. */ - #undef HAVE_XML_STOPPARSER - -+/* Define to 1 if zstd is enabled. */ -+#undef HAVE_ZSTD -+ - /* Define to 1 if your system has the _etext variable. */ - #undef HAVE__ETEXT - -diff --git a/gdb/configure b/gdb/configure -index ac372e3b65c..2fcba76b5e8 100755 ---- a/gdb/configure -+++ b/gdb/configure -@@ -747,6 +747,8 @@ READLINE_DEPS - READLINE - LTLIBICONV - LIBICONV -+ZSTD_LIBS -+ZSTD_CFLAGS - zlibinc - zlibdir - MIG -@@ -899,6 +901,7 @@ enable_codesign - with_pkgversion - with_bugurl - with_system_zlib -+with_zstd - with_gnu_ld - enable_rpath - with_libiconv_prefix -@@ -969,6 +972,8 @@ RPM_CFLAGS - RPM_LIBS - YACC - YFLAGS -+ZSTD_CFLAGS -+ZSTD_LIBS - XMKMF' - ac_subdirs_all='testsuite - gdbtk' -@@ -1651,6 +1656,8 @@ Optional Packages: - --with-pkgversion=PKG Use PKG in the version string in place of "GDB" - --with-bugurl=URL Direct users to URL to report a bug - --with-system-zlib use installed libz -+ --with-zstd support zstd compressed debug sections -+ (default=auto) - --with-gnu-ld assume the C compiler uses GNU ld default=no - --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib - --without-libiconv-prefix don't search for libiconv in includedir and libdir -@@ -1733,6 +1740,8 @@ Some influential environment variables: - YFLAGS The list of arguments that will be passed by default to $YACC. - This script will default YFLAGS to the empty string to avoid a - default value of `-d' given by some make applications. -+ ZSTD_CFLAGS C compiler flags for ZSTD, overriding pkg-config -+ ZSTD_LIBS linker flags for ZSTD, overriding pkg-config - XMKMF Path to xmkmf, Makefile generator for X Window System - - Use these variables to override the choices made by `configure' or to help -@@ -8730,7 +8739,8 @@ if test "$ac_res" != no; then : - fi - - --# Link in zlib if we can. This allows us to read compressed debug sections. -+# Link in zlib/zstd if we can. This allows us to read compressed debug -+# sections. - - # Use the system's zlib library. - zlibdir="-L\$(top_builddir)/../zlib" -@@ -8750,6 +8760,127 @@ fi - - - -+# Check whether --with-zstd was given. -+if test "${with_zstd+set}" = set; then : -+ withval=$with_zstd; -+else -+ with_zstd=auto -+fi -+ -+ -+if test "$with_zstd" != no; then : -+ -+pkg_failed=no -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libzstd" >&5 -+$as_echo_n "checking for libzstd... " >&6; } -+ -+if test -n "$ZSTD_CFLAGS"; then -+ pkg_cv_ZSTD_CFLAGS="$ZSTD_CFLAGS" -+ elif test -n "$PKG_CONFIG"; then -+ if test -n "$PKG_CONFIG" && \ -+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libzstd\""; } >&5 -+ ($PKG_CONFIG --exists --print-errors "libzstd") 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; then -+ pkg_cv_ZSTD_CFLAGS=`$PKG_CONFIG --cflags "libzstd" 2>/dev/null` -+ test "x$?" != "x0" && pkg_failed=yes -+else -+ pkg_failed=yes -+fi -+ else -+ pkg_failed=untried -+fi -+if test -n "$ZSTD_LIBS"; then -+ pkg_cv_ZSTD_LIBS="$ZSTD_LIBS" -+ elif test -n "$PKG_CONFIG"; then -+ if test -n "$PKG_CONFIG" && \ -+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libzstd\""; } >&5 -+ ($PKG_CONFIG --exists --print-errors "libzstd") 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; then -+ pkg_cv_ZSTD_LIBS=`$PKG_CONFIG --libs "libzstd" 2>/dev/null` -+ test "x$?" != "x0" && pkg_failed=yes -+else -+ pkg_failed=yes -+fi -+ else -+ pkg_failed=untried -+fi -+ -+if test $pkg_failed = no; then -+ pkg_save_LDFLAGS="$LDFLAGS" -+ LDFLAGS="$LDFLAGS $pkg_cv_ZSTD_LIBS" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : -+ -+else -+ pkg_failed=yes -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+ LDFLAGS=$pkg_save_LDFLAGS -+fi -+ -+ -+ -+if test $pkg_failed = yes; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+ -+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then -+ _pkg_short_errors_supported=yes -+else -+ _pkg_short_errors_supported=no -+fi -+ if test $_pkg_short_errors_supported = yes; then -+ ZSTD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libzstd" 2>&1` -+ else -+ ZSTD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libzstd" 2>&1` -+ fi -+ # Put the nasty error message in config.log where it belongs -+ echo "$ZSTD_PKG_ERRORS" >&5 -+ -+ -+ if test "$with_zstd" = yes; then -+ as_fn_error $? "--with-zstd was given, but pkgconfig/libzstd.pc is not found" "$LINENO" 5 -+ fi -+ -+elif test $pkg_failed = untried; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+ -+ if test "$with_zstd" = yes; then -+ as_fn_error $? "--with-zstd was given, but pkgconfig/libzstd.pc is not found" "$LINENO" 5 -+ fi -+ -+else -+ ZSTD_CFLAGS=$pkg_cv_ZSTD_CFLAGS -+ ZSTD_LIBS=$pkg_cv_ZSTD_LIBS -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -+$as_echo "yes" >&6; } -+ -+ -+$as_echo "#define HAVE_ZSTD 1" >>confdefs.h -+ -+ -+fi -+ -+fi -+ -+ -+ - if test "X$prefix" = "XNONE"; then - acl_final_prefix="$ac_default_prefix" - else -@@ -17832,7 +17963,7 @@ WIN32LIBS="$WIN32LIBS $WIN32APILIBS" - # always want our bfd. - CFLAGS="-I${srcdir}/../include -I../bfd -I${srcdir}/../bfd $CFLAGS" - ZLIBDIR=`echo $zlibdir | sed 's,\$(top_builddir)/,,g'` -- LDFLAGS="-L../bfd -L../libiberty $ZLIBDIR $LDFLAGS" -+ LDFLAGS="-L../bfd -L../libiberty $ZLIBDIR $ZSTD_LIBS $LDFLAGS" - intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'` - LIBS="-lbfd -liberty -lz $intl $LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELF support in BFD" >&5 -@@ -17947,7 +18078,7 @@ fi - # always want our bfd. - CFLAGS="-I${srcdir}/../include -I../bfd -I${srcdir}/../bfd $CFLAGS" - ZLIBDIR=`echo $zlibdir | sed 's,\$(top_builddir)/,,g'` -- LDFLAGS="-L../bfd -L../libiberty $ZLIBDIR $LDFLAGS" -+ LDFLAGS="-L../bfd -L../libiberty $ZLIBDIR $ZSTD_LIBS $LDFLAGS" - intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'` - LIBS="-lbfd -liberty -lz $intl $LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mach-O support in BFD" >&5 -diff --git a/gdb/configure.ac b/gdb/configure.ac -index f7d6c6180c3..0c27b6accbc 100644 ---- a/gdb/configure.ac -+++ b/gdb/configure.ac -@@ -671,8 +671,10 @@ AC_SEARCH_LIBS(gethostbyname, nsl) - # Some systems (e.g. Solaris) have `socketpair' in libsocket. - AC_SEARCH_LIBS(socketpair, socket) - --# Link in zlib if we can. This allows us to read compressed debug sections. -+# Link in zlib/zstd if we can. This allows us to read compressed debug -+# sections. - AM_ZLIB -+AC_ZSTD - - AM_ICONV - --- -2.35.3 - diff --git a/fix-comparison-of-unsigned-long-int-to-int-in-record_linux_system_call.patch b/fix-comparison-of-unsigned-long-int-to-int-in-record_linux_system_call.patch deleted file mode 100644 index 1136477..0000000 --- a/fix-comparison-of-unsigned-long-int-to-int-in-record_linux_system_call.patch +++ /dev/null @@ -1,270 +0,0 @@ -Fix comparison of unsigned long int to int in record_linux_system_call. - -The if statement in case gdb_sys_ioctl in function -record_linux_system_call in file gdb/linux-record.c is as follows: - - if (tmpulongest == tdep->ioctl_FIOCLEX - || tmpulongest == tdep->ioctl_FIONCLEX - .... - || tmpulongest == tdep->ioctl_TCSETSW - ... - } - -The PowerPC ioctl value for ioctl_TCSETW is 0x802c7415. The variable -ioctl_TCSETW is defined in gdb/linux-record.h as an int. The TCSETW value -has the MSB set to one so it is a negative integer. The comparison of the -unsigned long value tmpulongest to a negative integer value for -ioctl_TCSETSW fails. - -This patch changes the declarations for the ioctl_* values in struct -linux_record_tdep to unsigned long to fix the comparisons between -tmpulongest and the tdep->ioctl_* values. - -An additional test gdb.reverse/test_ioctl_TCSETSW.exp is added to verify -the gdb record_linux_system_call() if statement for the ioctl TCSETSW -succeeds. - -This patch has been tested on Power 10 and Intel with no test failures. - ---- - gdb/linux-record.h | 130 +++++++++++------------ - gdb/testsuite/gdb.reverse/test_ioctl_TCSETSW.c | 38 +++++++ - gdb/testsuite/gdb.reverse/test_ioctl_TCSETSW.exp | 45 ++++++++ - 3 files changed, 148 insertions(+), 65 deletions(-) - -diff --git a/gdb/linux-record.h b/gdb/linux-record.h -index 219c67f888d..39d7d4b54d0 100644 ---- a/gdb/linux-record.h -+++ b/gdb/linux-record.h -@@ -92,71 +92,71 @@ struct linux_record_tdep - int size_time_t; - - /* The values of the second argument of system call "sys_ioctl". */ -- int ioctl_TCGETS; -- int ioctl_TCSETS; -- int ioctl_TCSETSW; -- int ioctl_TCSETSF; -- int ioctl_TCGETA; -- int ioctl_TCSETA; -- int ioctl_TCSETAW; -- int ioctl_TCSETAF; -- int ioctl_TCSBRK; -- int ioctl_TCXONC; -- int ioctl_TCFLSH; -- int ioctl_TIOCEXCL; -- int ioctl_TIOCNXCL; -- int ioctl_TIOCSCTTY; -- int ioctl_TIOCGPGRP; -- int ioctl_TIOCSPGRP; -- int ioctl_TIOCOUTQ; -- int ioctl_TIOCSTI; -- int ioctl_TIOCGWINSZ; -- int ioctl_TIOCSWINSZ; -- int ioctl_TIOCMGET; -- int ioctl_TIOCMBIS; -- int ioctl_TIOCMBIC; -- int ioctl_TIOCMSET; -- int ioctl_TIOCGSOFTCAR; -- int ioctl_TIOCSSOFTCAR; -- int ioctl_FIONREAD; -- int ioctl_TIOCINQ; -- int ioctl_TIOCLINUX; -- int ioctl_TIOCCONS; -- int ioctl_TIOCGSERIAL; -- int ioctl_TIOCSSERIAL; -- int ioctl_TIOCPKT; -- int ioctl_FIONBIO; -- int ioctl_TIOCNOTTY; -- int ioctl_TIOCSETD; -- int ioctl_TIOCGETD; -- int ioctl_TCSBRKP; -- int ioctl_TIOCTTYGSTRUCT; -- int ioctl_TIOCSBRK; -- int ioctl_TIOCCBRK; -- int ioctl_TIOCGSID; -- int ioctl_TCGETS2; -- int ioctl_TCSETS2; -- int ioctl_TCSETSW2; -- int ioctl_TCSETSF2; -- int ioctl_TIOCGPTN; -- int ioctl_TIOCSPTLCK; -- int ioctl_FIONCLEX; -- int ioctl_FIOCLEX; -- int ioctl_FIOASYNC; -- int ioctl_TIOCSERCONFIG; -- int ioctl_TIOCSERGWILD; -- int ioctl_TIOCSERSWILD; -- int ioctl_TIOCGLCKTRMIOS; -- int ioctl_TIOCSLCKTRMIOS; -- int ioctl_TIOCSERGSTRUCT; -- int ioctl_TIOCSERGETLSR; -- int ioctl_TIOCSERGETMULTI; -- int ioctl_TIOCSERSETMULTI; -- int ioctl_TIOCMIWAIT; -- int ioctl_TIOCGICOUNT; -- int ioctl_TIOCGHAYESESP; -- int ioctl_TIOCSHAYESESP; -- int ioctl_FIOQSIZE; -+ ULONGEST ioctl_TCGETS; -+ ULONGEST ioctl_TCSETS; -+ ULONGEST ioctl_TCSETSW; -+ ULONGEST ioctl_TCSETSF; -+ ULONGEST ioctl_TCGETA; -+ ULONGEST ioctl_TCSETA; -+ ULONGEST ioctl_TCSETAW; -+ ULONGEST ioctl_TCSETAF; -+ ULONGEST ioctl_TCSBRK; -+ ULONGEST ioctl_TCXONC; -+ ULONGEST ioctl_TCFLSH; -+ ULONGEST ioctl_TIOCEXCL; -+ ULONGEST ioctl_TIOCNXCL; -+ ULONGEST ioctl_TIOCSCTTY; -+ ULONGEST ioctl_TIOCGPGRP; -+ ULONGEST ioctl_TIOCSPGRP; -+ ULONGEST ioctl_TIOCOUTQ; -+ ULONGEST ioctl_TIOCSTI; -+ ULONGEST ioctl_TIOCGWINSZ; -+ ULONGEST ioctl_TIOCSWINSZ; -+ ULONGEST ioctl_TIOCMGET; -+ ULONGEST ioctl_TIOCMBIS; -+ ULONGEST ioctl_TIOCMBIC; -+ ULONGEST ioctl_TIOCMSET; -+ ULONGEST ioctl_TIOCGSOFTCAR; -+ ULONGEST ioctl_TIOCSSOFTCAR; -+ ULONGEST ioctl_FIONREAD; -+ ULONGEST ioctl_TIOCINQ; -+ ULONGEST ioctl_TIOCLINUX; -+ ULONGEST ioctl_TIOCCONS; -+ ULONGEST ioctl_TIOCGSERIAL; -+ ULONGEST ioctl_TIOCSSERIAL; -+ ULONGEST ioctl_TIOCPKT; -+ ULONGEST ioctl_FIONBIO; -+ ULONGEST ioctl_TIOCNOTTY; -+ ULONGEST ioctl_TIOCSETD; -+ ULONGEST ioctl_TIOCGETD; -+ ULONGEST ioctl_TCSBRKP; -+ ULONGEST ioctl_TIOCTTYGSTRUCT; -+ ULONGEST ioctl_TIOCSBRK; -+ ULONGEST ioctl_TIOCCBRK; -+ ULONGEST ioctl_TIOCGSID; -+ ULONGEST ioctl_TCGETS2; -+ ULONGEST ioctl_TCSETS2; -+ ULONGEST ioctl_TCSETSW2; -+ ULONGEST ioctl_TCSETSF2; -+ ULONGEST ioctl_TIOCGPTN; -+ ULONGEST ioctl_TIOCSPTLCK; -+ ULONGEST ioctl_FIONCLEX; -+ ULONGEST ioctl_FIOCLEX; -+ ULONGEST ioctl_FIOASYNC; -+ ULONGEST ioctl_TIOCSERCONFIG; -+ ULONGEST ioctl_TIOCSERGWILD; -+ ULONGEST ioctl_TIOCSERSWILD; -+ ULONGEST ioctl_TIOCGLCKTRMIOS; -+ ULONGEST ioctl_TIOCSLCKTRMIOS; -+ ULONGEST ioctl_TIOCSERGSTRUCT; -+ ULONGEST ioctl_TIOCSERGETLSR; -+ ULONGEST ioctl_TIOCSERGETMULTI; -+ ULONGEST ioctl_TIOCSERSETMULTI; -+ ULONGEST ioctl_TIOCMIWAIT; -+ ULONGEST ioctl_TIOCGICOUNT; -+ ULONGEST ioctl_TIOCGHAYESESP; -+ ULONGEST ioctl_TIOCSHAYESESP; -+ ULONGEST ioctl_FIOQSIZE; - - /* The values of the second argument of system call "sys_fcntl" - and "sys_fcntl64". */ -diff --git a/gdb/testsuite/gdb.reverse/test_ioctl_TCSETSW.c b/gdb/testsuite/gdb.reverse/test_ioctl_TCSETSW.c -new file mode 100644 -index 00000000000..6365f968b30 ---- /dev/null -+++ b/gdb/testsuite/gdb.reverse/test_ioctl_TCSETSW.c -@@ -0,0 +1,38 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2012-2022 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 . */ -+ -+#include -+#include -+#include -+ -+/* The purpose of this test is to verify gdb record_linux_system_call() -+ recognizes the call for ioctl TCSETSW. */ -+ -+int -+main(void) -+{ -+ -+ struct termios term; -+ int result; -+ int fd = 0; -+ -+ /* The test just needs to generate an ioctl call for TCSETSW to see if gdb -+ record detected it or not. Success or failure of the ioctl call is -+ irrelevant. */ -+ result = tcsetattr(fd, TCSADRAIN, &term); /* TCSETSW call */ -+ result = 0; /* TCSETSW called */ -+} -diff --git a/gdb/testsuite/gdb.reverse/test_ioctl_TCSETSW.exp b/gdb/testsuite/gdb.reverse/test_ioctl_TCSETSW.exp -new file mode 100644 -index 00000000000..86a62ebe5e5 ---- /dev/null -+++ b/gdb/testsuite/gdb.reverse/test_ioctl_TCSETSW.exp -@@ -0,0 +1,45 @@ -+# Copyright 2008-2022 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 . -+# -+# Test ioctl TCSETSW record for PowerPC. -+# -+ -+standard_testfile .c -+ -+if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { -+ return -1 -+} -+ -+if ![runto_main] then { -+ untested "could not run to main" -+ continue -+} -+ -+# Recording of ioctls calls requires record full -+gdb_test_no_output "record full" -+ -+set stop [gdb_get_line_number "TCSETSW call"] -+gdb_test "break $stop" ".*Breakpoint .*" "stop at TCSETSW" -+gdb_test "continue" ".*Breakpoint .*" "at TCSETSW call" -+ -+set test "handle TCSETSW" -+gdb_test_multiple "step" $test { -+ -re "Process record and replay target doesn't support ioctl request 0x.*$gdb_prompt $" { -+ fail $test -+ } -+ -re ".*result = 0.*$gdb_prompt $" { -+ pass $test -+ } -+} diff --git a/fix-core-file-detach-crash-corefiles-29275.patch b/fix-core-file-detach-crash-corefiles-29275.patch deleted file mode 100644 index 496a6a2..0000000 --- a/fix-core-file-detach-crash-corefiles-29275.patch +++ /dev/null @@ -1,161 +0,0 @@ -Fix core-file -> detach -> crash (corefiles/29275) - -After loading a core file, you're supposed to be able to use "detach" -to unload the core file. That unfortunately regressed starting with -GDB 11, with these commits: - - 1192f124a308 - gdb: generalize commit_resume, avoid commit-resuming when threads have pending statuses - 408f66864a1a - detach in all-stop with threads running - -resulting in a GDB crash: - - ... - Thread 1 "gdb" received signal SIGSEGV, Segmentation fault. - 0x0000555555e842bf in maybe_set_commit_resumed_all_targets () at ../../src/gdb/infrun.c:2899 - 2899 if (proc_target->commit_resumed_state) - (top-gdb) bt - #0 0x0000555555e842bf in maybe_set_commit_resumed_all_targets () at ../../src/gdb/infrun.c:2899 - #1 0x0000555555e848bf in scoped_disable_commit_resumed::reset (this=0x7fffffffd440) at ../../src/gdb/infrun.c:3023 - #2 0x0000555555e84a0c in scoped_disable_commit_resumed::reset_and_commit (this=0x7fffffffd440) at ../../src/gdb/infrun.c:3049 - #3 0x0000555555e739cd in detach_command (args=0x0, from_tty=1) at ../../src/gdb/infcmd.c:2791 - #4 0x0000555555c0ba46 in do_simple_func (args=0x0, from_tty=1, c=0x55555662a600) at ../../src/gdb/cli/cli-decode.c:95 - #5 0x0000555555c112b0 in cmd_func (cmd=0x55555662a600, args=0x0, from_tty=1) at ../../src/gdb/cli/cli-decode.c:2514 - #6 0x0000555556173b1f in execute_command (p=0x5555565c5916 "", from_tty=1) at ../../src/gdb/top.c:699 - -The code that crashes looks like: - - static void - maybe_set_commit_resumed_all_targets () - { - scoped_restore_current_thread restore_thread; - - for (inferior *inf : all_non_exited_inferiors ()) - { - process_stratum_target *proc_target = inf->process_target (); - - if (proc_target->commit_resumed_state) - ^^^^^^^^^^^ - -With 'proc_target' above being null. all_non_exited_inferiors filters -out inferiors that have pid==0. We get here at the end of -detach_command, after core_target::detach has already run, at which -point the inferior _should_ have pid==0 and no process target. It is -clear it no longer has a process target, but, it still has a pid!=0 -somehow. - -The reason the inferior still has pid!=0, is that core_target::detach -just unpushes, and relies on core_target::close to actually do the -getting rid of the core and exiting the inferior. The problem with -that is that detach_command grabs an extra strong reference to the -process stratum target, so the unpush_target inside -core_target::detach doesn't actually result in a call to -core_target::close. - -Fix this my moving the cleaning up the core inferior to a shared -routine called by both core_target::close and core_target::detach. We -still need to cleanup the inferior from within core_file::close -because there are paths to it that want to get rid of the core without -going through detach. E.g., "core-file" -> "run". - -This commit includes a new test added to gdb.base/corefile.exp to -cover the "core-file core" -> "detach" scenario. - -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29275 - -Change-Id: Ic42bdd03182166b19f598428b0dbc2ce6f67c893 - ---- - gdb/corelow.c | 27 +++++++++++++++++++++------ - gdb/testsuite/gdb.base/corefile.exp | 12 ++++++++++++ - 2 files changed, 33 insertions(+), 6 deletions(-) - -diff --git a/gdb/corelow.c b/gdb/corelow.c -index 001c4f147fc..bdd7ddc59c2 100644 ---- a/gdb/corelow.c -+++ b/gdb/corelow.c -@@ -120,6 +120,9 @@ class core_target final : public process_stratum_target - - private: /* per-core data */ - -+ /* Get rid of the core inferior. */ -+ void clear_core (); -+ - /* The core's section table. Note that these target sections are - *not* mapped in the current address spaces' set of target - sections --- those should come only from pure executable or -@@ -290,10 +293,8 @@ core_target::build_file_mappings () - /* An arbitrary identifier for the core inferior. */ - #define CORELOW_PID 1 - --/* Close the core target. */ -- - void --core_target::close () -+core_target::clear_core () - { - if (core_bfd) - { -@@ -307,6 +308,14 @@ core_target::close () - - current_program_space->cbfd.reset (nullptr); - } -+} -+ -+/* Close the core target. */ -+ -+void -+core_target::close () -+{ -+ clear_core (); - - /* Core targets are heap-allocated (see core_target_open), so here - we delete ourselves. */ -@@ -592,9 +601,15 @@ core_target_open (const char *arg, int from_tty) - void - core_target::detach (inferior *inf, int from_tty) - { -- /* Note that 'this' is dangling after this call. unpush_target -- closes the target, and our close implementation deletes -- 'this'. */ -+ /* Get rid of the core. Don't rely on core_target::close doing it, -+ because target_detach may be called with core_target's refcount > 1, -+ meaning core_target::close may not be called yet by the -+ unpush_target call below. */ -+ clear_core (); -+ -+ /* Note that 'this' may be dangling after this call. unpush_target -+ closes the target if the refcount reaches 0, and our close -+ implementation deletes 'this'. */ - inf->unpush_target (this); - - /* Clear the register cache and the frame cache. */ -diff --git a/gdb/testsuite/gdb.base/corefile.exp b/gdb/testsuite/gdb.base/corefile.exp -index 4ed92a02955..7f3d2efe3a2 100644 ---- a/gdb/testsuite/gdb.base/corefile.exp -+++ b/gdb/testsuite/gdb.base/corefile.exp -@@ -207,6 +207,16 @@ gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(.*\\).*" "up in corefile.exp ( - - gdb_test "core" "No core file now." - -+# Test that we can unload the core with the "detach" command. -+ -+proc_with_prefix corefile_detach {} { -+ clean_restart $::binfile -+ -+ gdb_test "core-file $::corefile" "Core was generated by .*" "load core" -+ gdb_test "detach" "No core file now\\." "detach core" -+} -+ -+corefile_detach - - # Test a run (start) command will clear any loaded core file. - -@@ -222,6 +232,8 @@ proc corefile_test_run {} { - return - } - -+ clean_restart $::binfile -+ - gdb_test "core-file $corefile" "Core was generated by .*" "run: load core again" - gdb_test "info files" "\r\nLocal core dump file:\r\n.*" "run: sanity check we see the core file" - diff --git a/fix-for-gdb.base-solib-search.exp-test.patch b/fix-for-gdb.base-solib-search.exp-test.patch deleted file mode 100644 index b2b2e54..0000000 --- a/fix-for-gdb.base-solib-search.exp-test.patch +++ /dev/null @@ -1,140 +0,0 @@ -Fix for gdb.base/solib-search.exp test. - -The variable right_lib_flags is not being set correctly to define RIGHT. -The value RIGHT is needed to force the address of the library functions -lib1_func3 and lib2_func4 to occur at different address in the wrong and -right libraries. - -With RIGHT defined correctly, functions lib1_func3 and lib2_func4 occur -at different addresses the test runs correctly on Powerpc. - -The test needs the lib2 addresses to be different in the right and -wrong cases. That is the point of introducing function lib2_spacer -with the ifdef RIGHT compiler directive. - -On Intel, the ARRAY_SIZE of 1 versus 8192 is sufficient to get the -dynamic linker to move the addresses of the library. You can also get -the same effect on PowerPC but you must use a value much larger than -8192. - -The key thing is that the test was not properly setting RIGHT to -defined to get the lib2_spacer function on Intel and Powerpc. - -Without the patch, we have the Intel backtrace for the bad libraries: - -backtrace -#0 break_here () at /home/ ... /gdb/testsuite/gdb.base/solib-search.c:30 -#1 0x00007ffff7fae156 in ?? () -#2 0x00007fffffffc150 in ?? () -#3 0x00007ffff7fbb156 in ?? () -#4 0x00007fffffffc160 in ?? () -#5 0x00007ffff7fae146 in ?? () -#6 0x00007fffffffc170 in ?? () -#7 0x00007ffff7fbb146 in ?? () -#8 0x00007fffffffc180 in ?? () -#9 0x0000555555555156 in main () at /home/ ... /binutils-gdb/gdb/testsuite/gdb.base/solib-search.c:23 -Backtrace stopped: previous frame inner to this frame (corrupt stack?) -(gdb) PASS: gdb.base/solib-search.exp: backtrace (with wrong libs) (data collection) - -The backtrace on Intel with the good libraries is: - -backtrace -#0 break_here () at /.../binutils-gdb/gdb/testsuite/gdb.base/solib-search.c:30 -#1 0x00007ffff7fae156 in lib2_func4 () at /.../binutils-gdb/gdb/testsuite/gdb.base/solib-search-lib2.c:49 -#2 0x00007ffff7fbb156 in lib1_func3 () at /.../gdb.base/solib-search-lib1.c:49 -#3 0x00007ffff7fae146 in lib2_func2 () at /.../testsuite/gdb.base/solib-search-lib2.c:30 -#4 0x00007ffff7fbb146 in lib1_func1 () at /.../gdb.base/solib-search-lib1.c:30 -#5 0x0000555555555156 in main () at /...solib-search.c:23 -(gdb) PASS: gdb.base/solib-search.exp: backtrace (with right libs) (data collection) -PASS: gdb.base/solib-search.exp: backtrace (with right libs) - -In one case the backtrace is correct and the other it -is wrong on Intel. This is due to the fact that the ARRAY_SIZE caused -the dynamic linker to move the library function addresses around. I -believe it has to do with the default size of the data and code -sections used by the dynamic linker. - -So without the patch the backtrace on PowerPC looks like: - - backtrace -#0 break_here () at /.../solib-search.c:30 -#1 0x00007ffff7f007f4 in lib2_func4 () at /.../solib-search-lib2.c:49 -#2 0x00007ffff7f307f4 in lib1_func3 () at /.../solib-search-lib1.c:49 -#3 0x00007ffff7f007ac in lib2_func2 () at /.../solib-search-lib2.c:30 -#4 0x00007ffff7f307ac in lib1_func1 () at /.../solib-search-lib1.c:30 -#5 0x000000001000074c in main () at /.../solib-search.c:23 - -for both the good and bad libraries. - -The patch fixes defining RIGHT in solib-search-lib1.c and solib-search- -lib2.c. Note, without the patch the lib1_spacer and lib2_spacer -functions do not show up in the object dump of the Intel or Powerpc -libraries as it should. The patch fixes that by making sure RIGHT gets -defined. - -Now with the patch the backtrace for the bad library on PowerPC looks -like: - -backtrace -#0 break_here () at /.../solib-search.c:30 -#1 0x00007ffff7f0083c in __glink_PLTresolve () from /.../solib-search-lib2.so -Backtrace stopped: frame did not save the PC - -And the backtrace for the good libraries on PowerPC looks like: - -backtrace -#0 break_here () at /.../solib-search.c:30 -#1 0x00007ffff7f0083c in lib2_func4 () at /.../solib-search-lib2.c:49 -#2 0x00007ffff7f3083c in lib1_func3 () at /.../solib-search-lib1.c:49 -#3 0x00007ffff7f007cc in lib2_func2 () at /.../solib-search-lib2.c:30 -#4 0x00007ffff7f307cc in lib1_func1 () at /.../solib-search-lib1.c:30 -#5 0x000000001000074c in main () at /.../solib-search.c:23 -(gdb) PASS: gdb.base/solib-search.exp: backtrace (with right libs) (data collection) -PASS: gdb.base/solib-search.exp: backtrace (with right libs) - -The issue then is on Power where the ARRAY_SIZE of 1 versus 8192 is not -sufficient to cause the dymanic linker to allocate the libraries at -different addresses. I don't claim to understand the specifics of how -the dynamic linker works and what the default size is for the data and -code sections are. My guess is by default PowerPC allocates a larger -data size by default, which is large enough to hold array[8192]. The -default size of the data section allocated by the dynamic linker on -Intel is not large enough to hold array[8192] thus causing the code -section on Intel to have to move when the large array is defined. - -Note on PowerPC, if you make ARRAY_SIZE big enough, then you will cause -the library addresses to occur at different addresses as the larger -data section forces the code section to a different address. That was -actually my original fix for the program until I spoke with Doug Evans -who originally wrote the test. Doug noticed that RIGHT was not getting -defined as he originally intended in the test. - -With the patch to fix the definition of RIGHT, PowerPC has a bad and a -good backtrace because the address of lib1_func3 and lib2_func4 both -move because lib1_spacer and lib2_spacer are now defined -before lib1_func3 and lib2_func4. - -Without the patch, the lib1_spacer and lib2_spacer function doesn't show -up in the binary for the correct or incorrect library on Intel or PowerPC. -With the patch, RIGHT gets defined as originally intended for the test on -both architectures and lib1_spacer and lib2_spacer function show up in the -binaries on both architectures changing the other function addresses as -intended thus causing the test work as intended on PowerPC. - ---- - gdb/testsuite/gdb.base/solib-search.exp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gdb/testsuite/gdb.base/solib-search.exp b/gdb/testsuite/gdb.base/solib-search.exp -index eaabe508bf0..202e79d85de 100644 ---- a/gdb/testsuite/gdb.base/solib-search.exp -+++ b/gdb/testsuite/gdb.base/solib-search.exp -@@ -54,7 +54,7 @@ set binfile2_lib [standard_output_file ${libname2}.so] - - set lib_flags [list debug ldflags=-Wl,-Bsymbolic] - set wrong_lib_flags "$lib_flags additional_flags=-DARRAY_SIZE=1" --set right_lib_flags "$lib_flags additional_flags=-DARRAY_SIZE=8192 -DRIGHT" -+set right_lib_flags "$lib_flags additional_flags=-DARRAY_SIZE=8192 additional_flags=-DRIGHT" - - # Binary file. - standard_testfile .c diff --git a/fix-gdb-build-elf-support-check-lzstd.patch b/fix-gdb-build-elf-support-check-lzstd.patch deleted file mode 100644 index 929b6d8..0000000 --- a/fix-gdb-build-elf-support-check-lzstd.patch +++ /dev/null @@ -1,101 +0,0 @@ -From 1907d04cb6cb94052369995cf8373f2670908e2a Mon Sep 17 00:00:00 2001 -From: Pedro Alves -Date: Wed, 28 Sep 2022 11:33:30 +0100 -Subject: [PATCH] Fix GDB build: ELF support check & -lzstd - -GDB fails to build for me, on Ubuntu 20.04. I get: - - ... - CXXLD gdb - /usr/bin/ld: linux-tdep.o: in function `linux_corefile_thread(thread_info*, linux_corefile_thread_data*)': - /home/pedro/gdb/binutils-gdb/src/gdb/linux-tdep.c:1831: undefined reference to `gcore_elf_build_thread_register_notes(gdbarch*, thread_info*, gdb_signal, bfd*, std::unique_ptr >*, int*)' - /usr/bin/ld: linux-tdep.o: in function `linux_make_corefile_notes(gdbarch*, bfd*, int*)': - /home/pedro/gdb/binutils-gdb/src/gdb/linux-tdep.c:2117: undefined reference to `gcore_elf_make_tdesc_note(bfd*, std::unique_ptr >*, int*)' - collect2: error: ld returned 1 exit status - make[2]: *** [Makefile:2149: gdb] Error 1 - make[2]: Leaving directory '/home/pedro/gdb/binutils-gdb/build/gdb' - make[1]: *** [Makefile:11847: all-gdb] Error 2 - make[1]: Leaving directory '/home/pedro/gdb/binutils-gdb/build' - make: *** [Makefile:1004: all] Error 2 - -Those undefined functions exist in gdb/gcore-elf.c, which is only -included in the build if GDB's configure thinks that the target you're -configuring for is an ELF target. GDB's configure thinks my system -isn't ELF, which is incorrect. - -For the ELF support check, gdb/config.log shows: - - configure:17387: checking for ELF support in BFD - configure:17407: gcc -o conftest -I/home/pedro/gdb/binutils-gdb/src/gdb/../include -I../bfd -I/home/pedro/gdb/binutils-gdb/src/gdb/../bfd -g3 -O0 -L../bfd -L../libiberty -lzstd conftest.c -lbfd -liberty -lz -lncursesw -lm -ldl >&5 - /usr/bin/ld: ../bfd/libbfd.a(compress.o): in function `decompress_contents': - /home/pedro/gdb/binutils-gdb/src/bfd/compress.c:42: undefined reference to `ZSTD_decompress' - /usr/bin/ld: /home/pedro/gdb/binutils-gdb/src/bfd/compress.c:44: undefined reference to `ZSTD_isError' - /usr/bin/ld: ../bfd/libbfd.a(compress.o): in function `bfd_compress_section_contents': - /home/pedro/gdb/binutils-gdb/src/bfd/compress.c:195: undefined reference to `ZSTD_compress' - /usr/bin/ld: /home/pedro/gdb/binutils-gdb/src/bfd/compress.c:198: undefined reference to `ZSTD_isError' - collect2: error: ld returned 1 exit status - configure:17407: $? = 1 - ... - configure:17417: result: no - -Note how above, in the gcc command line, "-lzstd" appears before -"-lbfd". That explain the link failure. It should appear after, like --lz does. - -This commit fixes it, by moving ZSTD_LIBS from LDFLAGS to LIBS, next -to -lz, in GDB_AC_CHECK_BFD, and regenerating gdb/configure. - -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29630 -Change-Id: I1f4128dde634e8ea04c9002904f1005a8b3a6863 ---- - gdb/acinclude.m4 | 4 ++-- - gdb/configure | 8 ++++---- - 2 files changed, 6 insertions(+), 6 deletions(-) - -diff --git a/gdb/acinclude.m4 b/gdb/acinclude.m4 -index 28846119dcb..62fa66c7af3 100644 ---- a/gdb/acinclude.m4 -+++ b/gdb/acinclude.m4 -@@ -234,9 +234,9 @@ AC_DEFUN([GDB_AC_CHECK_BFD], [ - # always want our bfd. - CFLAGS="-I${srcdir}/../include -I../bfd -I${srcdir}/../bfd $CFLAGS" - ZLIBDIR=`echo $zlibdir | sed 's,\$(top_builddir)/,,g'` -- LDFLAGS="-L../bfd -L../libiberty $ZLIBDIR $ZSTD_LIBS $LDFLAGS" -+ LDFLAGS="-L../bfd -L../libiberty $ZLIBDIR $LDFLAGS" - intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'` -- LIBS="-lbfd -liberty -lz $intl $LIBS" -+ LIBS="-lbfd -liberty -lz $ZSTD_LIBS $intl $LIBS" - AC_CACHE_CHECK( - [$1], - [$2], -diff --git a/gdb/configure b/gdb/configure -index 2fcba76b5e8..a5f33ce65d9 100755 ---- a/gdb/configure -+++ b/gdb/configure -@@ -17963,9 +17963,9 @@ WIN32LIBS="$WIN32LIBS $WIN32APILIBS" - # always want our bfd. - CFLAGS="-I${srcdir}/../include -I../bfd -I${srcdir}/../bfd $CFLAGS" - ZLIBDIR=`echo $zlibdir | sed 's,\$(top_builddir)/,,g'` -- LDFLAGS="-L../bfd -L../libiberty $ZLIBDIR $ZSTD_LIBS $LDFLAGS" -+ LDFLAGS="-L../bfd -L../libiberty $ZLIBDIR $LDFLAGS" - intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'` -- LIBS="-lbfd -liberty -lz $intl $LIBS" -+ LIBS="-lbfd -liberty -lz $ZSTD_LIBS $intl $LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELF support in BFD" >&5 - $as_echo_n "checking for ELF support in BFD... " >&6; } - if ${gdb_cv_var_elf+:} false; then : -@@ -18078,9 +18078,9 @@ fi - # always want our bfd. - CFLAGS="-I${srcdir}/../include -I../bfd -I${srcdir}/../bfd $CFLAGS" - ZLIBDIR=`echo $zlibdir | sed 's,\$(top_builddir)/,,g'` -- LDFLAGS="-L../bfd -L../libiberty $ZLIBDIR $ZSTD_LIBS $LDFLAGS" -+ LDFLAGS="-L../bfd -L../libiberty $ZLIBDIR $LDFLAGS" - intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'` -- LIBS="-lbfd -liberty -lz $intl $LIBS" -+ LIBS="-lbfd -liberty -lz $ZSTD_LIBS $intl $LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mach-O support in BFD" >&5 - $as_echo_n "checking for Mach-O support in BFD... " >&6; } - if ${gdb_cv_var_macho+:} false; then : --- -2.35.3 - diff --git a/fix-pr30369-regression-on-aarch64-arm-pr30506.patch b/fix-pr30369-regression-on-aarch64-arm-pr30506.patch new file mode 100644 index 0000000..6801a5c --- /dev/null +++ b/fix-pr30369-regression-on-aarch64-arm-pr30506.patch @@ -0,0 +1,148 @@ +From 11a41bc318ba0307248eadf29bf7d4a1af31d3a8 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 16 May 2023 17:00:51 +0100 +Subject: [PATCH 2/2] Fix PR30369 regression on aarch64/arm (PR30506) + +The gdb.dwarf2/dw2-prologue-end-2.exp test was failing for both AArch64 and +Arm. + +As Tom pointed out here (https://inbox.sourceware.org/gdb-patches/6663707c-4297-c2f2-a0bd-f3e84fc62aad@suse.de/), +there are issues with both the prologue skipper for AArch64 and Arm and an +incorrect assumption by the testcase. + +This patch fixes both of AArch64's and Arm's prologue skippers to not skip past +the end of a function. It also incorporates a fix to the testcase so it +doesn't assume the prologue skipper will stop at the first instruction of the +functions/labels. + +Regression-tested on aarch64-linux/arm-linux Ubuntu 20.04/22.04 and +x86_64-linux Ubuntu 20.04. + +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30506 + +Co-Authored-By: Tom de Vries +Co-Authored-By: Luis Machado +--- + gdb/aarch64-tdep.c | 10 +++++++-- + gdb/arm-tdep.c | 21 ++++++++++++++++--- + .../gdb.dwarf2/dw2-prologue-end-2.exp | 12 +++++------ + 3 files changed, 32 insertions(+), 11 deletions(-) + +diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c +index 499b87ef480..e21d18f5c8c 100644 +--- a/gdb/aarch64-tdep.c ++++ b/gdb/aarch64-tdep.c +@@ -896,12 +896,15 @@ aarch64_analyze_prologue_test (void) + static CORE_ADDR + aarch64_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) + { +- CORE_ADDR func_addr, limit_pc; ++ CORE_ADDR func_addr, func_end_addr, limit_pc; + + /* See if we can determine the end of the prologue via the symbol + table. If so, then return either PC, or the PC after the + prologue, whichever is greater. */ +- if (find_pc_partial_function (pc, NULL, &func_addr, NULL)) ++ bool func_addr_found ++ = find_pc_partial_function (pc, NULL, &func_addr, &func_end_addr); ++ ++ if (func_addr_found) + { + CORE_ADDR post_prologue_pc + = skip_prologue_using_sal (gdbarch, func_addr); +@@ -921,6 +924,9 @@ aarch64_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) + if (limit_pc == 0) + limit_pc = pc + 128; /* Magic. */ + ++ limit_pc ++ = func_end_addr == 0? limit_pc : std::min (limit_pc, func_end_addr - 4); ++ + /* Try disassembling prologue. */ + return aarch64_analyze_prologue (gdbarch, pc, limit_pc, NULL); + } +diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c +index 58b9c5f4bd8..ecffb9223e1 100644 +--- a/gdb/arm-tdep.c ++++ b/gdb/arm-tdep.c +@@ -1768,12 +1768,18 @@ arm_skip_stack_protector(CORE_ADDR pc, struct gdbarch *gdbarch) + static CORE_ADDR + arm_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) + { +- CORE_ADDR func_addr, limit_pc; ++ CORE_ADDR func_addr, func_end_addr, limit_pc; + + /* See if we can determine the end of the prologue via the symbol table. + If so, then return either PC, or the PC after the prologue, whichever + is greater. */ +- if (find_pc_partial_function (pc, NULL, &func_addr, NULL)) ++ bool func_addr_found ++ = find_pc_partial_function (pc, NULL, &func_addr, &func_end_addr); ++ ++ /* Whether the function is thumb mode or not. */ ++ bool func_is_thumb = false; ++ ++ if (func_addr_found) + { + CORE_ADDR post_prologue_pc + = skip_prologue_using_sal (gdbarch, func_addr); +@@ -1810,7 +1816,8 @@ arm_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) + associate prologue code with the opening brace; so this + lets us skip the first line if we think it is the opening + brace. */ +- if (arm_pc_is_thumb (gdbarch, func_addr)) ++ func_is_thumb = arm_pc_is_thumb (gdbarch, func_addr); ++ if (func_is_thumb) + analyzed_limit = thumb_analyze_prologue (gdbarch, func_addr, + post_prologue_pc, NULL); + else +@@ -1836,6 +1843,14 @@ arm_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) + if (limit_pc == 0) + limit_pc = pc + 64; /* Magic. */ + ++ /* Set the correct adjustment based on whether the function is thumb mode or ++ not. We use it to get the address of the last instruction in the ++ function (as opposed to the first address of the next function). */ ++ CORE_ADDR adjustment = func_is_thumb? 2 : 4; ++ ++ limit_pc ++ = func_end_addr == 0? limit_pc : std::min (limit_pc, ++ func_end_addr - adjustment); + + /* Check if this is Thumb code. */ + if (arm_pc_is_thumb (gdbarch, pc)) +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-prologue-end-2.exp b/gdb/testsuite/gdb.dwarf2/dw2-prologue-end-2.exp +index 642b73fe2a1..da49902c13c 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-prologue-end-2.exp ++++ b/gdb/testsuite/gdb.dwarf2/dw2-prologue-end-2.exp +@@ -95,17 +95,17 @@ if { $break_addr == "" } { + return + } + +-# Get the "foo_label" address. ++# Get the "bar_label" address. + +-set foo_label_addr "" +-gdb_test_multiple "print /x &foo_label" "" { ++set bar_label_addr "" ++gdb_test_multiple "print /x &bar_label" "" { + -re -wrap "= ($hex)" { +- set foo_label_addr $expect_out(1,string) ++ set bar_label_addr $expect_out(1,string) + pass $gdb_test_name + } + } + +-if { $foo_label_addr == "" } { ++if { $bar_label_addr == "" } { + return + } + +@@ -117,4 +117,4 @@ gdb_test "print &foo_end == &bar_label" " = 1" + # Check that the breakpoint is set at the expected address. Regression test + # for PR30369. + +-gdb_assert { $break_addr == $foo_label_addr } ++gdb_assert { $break_addr < $bar_label_addr } +-- +2.35.3 + diff --git a/fixup-gdb-6.3-attach-see-vdso-test.patch b/fixup-gdb-6.3-attach-see-vdso-test.patch new file mode 100644 index 0000000..43ee239 --- /dev/null +++ b/fixup-gdb-6.3-attach-see-vdso-test.patch @@ -0,0 +1,30 @@ +From 19dc95258888a9e110ad54fa25a613611956a13f Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 13 Jun 2023 15:04:32 +0200 +Subject: [PATCH 5/6] fixup gdb-6.3-attach-see-vdso-test.patch + +--- + gdb/testsuite/gdb.base/attach-see-vdso.exp | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/gdb/testsuite/gdb.base/attach-see-vdso.exp b/gdb/testsuite/gdb.base/attach-see-vdso.exp +index 5457ec4129d..35c49731f0b 100644 +--- a/gdb/testsuite/gdb.base/attach-see-vdso.exp ++++ b/gdb/testsuite/gdb.base/attach-see-vdso.exp +@@ -34,10 +34,11 @@ set escapedbinfile [string_to_regexp [standard_output_file ${testfile}]] + # The kernel VDSO is used for the syscalls returns only on i386 (not x86_64). + # + if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-m32}] != "" } { +- gdb_suppress_entire_file "Testcase nonthraded compile failed, so all tests in this file will automatically fail." ++ unsupported "Testcase nonthreaded compile failed, so all tests in this file will automatically fail." ++ return + } + +-if [get_compiler_info ${binfile}] { ++if [get_compiler_info] { + return -1 + } + +-- +2.35.3 + diff --git a/fixup-gdb-6.3-gstack-20050411.patch b/fixup-gdb-6.3-gstack-20050411.patch new file mode 100644 index 0000000..427b668 --- /dev/null +++ b/fixup-gdb-6.3-gstack-20050411.patch @@ -0,0 +1,25 @@ +From 8c0ae8c3c6fa34f046131f76871db13bc392a440 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 13 Jun 2023 14:56:55 +0200 +Subject: [PATCH 4/6] fixup gdb-6.3-gstack-20050411.patch + +--- + gdb/testsuite/gdb.base/gstack.exp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.base/gstack.exp b/gdb/testsuite/gdb.base/gstack.exp +index 089407ec04a..a5dacd582ff 100644 +--- a/gdb/testsuite/gdb.base/gstack.exp ++++ b/gdb/testsuite/gdb.base/gstack.exp +@@ -52,7 +52,7 @@ gdb_expect { + # exiting the function. Still we could retry the gstack command if we fail. + + set test "spawn gstack" +-set command "sh -c GDB=$GDB\\ GDBARGS=-data-directory\\\\\\ $BUILD_DATA_DIRECTORY\\ sh\\ ${srcdir}/../gstack.sh\\ $pid\\;echo\\ GSTACK-END" ++set command "sh -c GDB=$GDB\\ GDBARGS=-data-directory\\\\\\ $GDB_DATA_DIRECTORY\\ sh\\ ${srcdir}/../gstack.sh\\ $pid\\;echo\\ GSTACK-END" + set res [remote_spawn host $command]; + if { $res < 0 || $res == "" } { + perror "Spawning $command failed." +-- +2.35.3 + diff --git a/fixup-gdb-bz634108-solib_address.patch b/fixup-gdb-bz634108-solib_address.patch new file mode 100644 index 0000000..a18ae59 --- /dev/null +++ b/fixup-gdb-bz634108-solib_address.patch @@ -0,0 +1,22 @@ +From 023314feb400836eb377a5bc9151850fcdd81b11 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 6 Jun 2023 09:43:36 +0200 +Subject: [PATCH 3/4] Fixup gdb-bz634108-solib_address.patch + +--- + gdb/testsuite/gdb.python/rh634108-solib_address.exp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.python/rh634108-solib_address.exp b/gdb/testsuite/gdb.python/rh634108-solib_address.exp +index 99e6aaba831..ebf00babc34 100644 +--- a/gdb/testsuite/gdb.python/rh634108-solib_address.exp ++++ b/gdb/testsuite/gdb.python/rh634108-solib_address.exp +@@ -21,4 +21,4 @@ gdb_start + # Skip all tests if Python scripting is not enabled. + if { [skip_python_tests] } { continue } + +-gdb_test "python print (gdb.solib_name(-1))" "None" "gdb.solib_name exists" ++gdb_test "python print (gdb.solib_name(0))" "None" "gdb.solib_name exists" +-- +2.35.3 + diff --git a/fixup-gdb-lineno-makeup-test.patch b/fixup-gdb-lineno-makeup-test.patch new file mode 100644 index 0000000..01c3b75 --- /dev/null +++ b/fixup-gdb-lineno-makeup-test.patch @@ -0,0 +1,26 @@ +From 266359a17e77a53d4ebaa4f3b15c2ae39e43fca0 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 13 Jun 2023 15:07:22 +0200 +Subject: [PATCH 6/6] fixup gdb-lineno-makeup-test.patch + +--- + gdb/testsuite/gdb.base/lineno-makeup.exp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.base/lineno-makeup.exp b/gdb/testsuite/gdb.base/lineno-makeup.exp +index 9e11d78bf9c..d31e063bdc2 100644 +--- a/gdb/testsuite/gdb.base/lineno-makeup.exp ++++ b/gdb/testsuite/gdb.base/lineno-makeup.exp +@@ -21,7 +21,8 @@ set binfuncfile [standard_output_file ${testfile}-func.bin] + set binfile [standard_output_file ${testfile}] + + if { [gdb_compile "${srcdir}/${subdir}/${srcfuncfile}" "${objfuncfile}" object {}] != "" } { +- gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." ++ unsupported "Testcase compile failed, so all tests in this file will automatically fail." ++ return + } + + set objcopy [catch "exec objcopy -O binary --only-section .text ${objfuncfile} ${binfuncfile}" output] +-- +2.35.3 + diff --git a/fixup-gdb-rhbz1261564-aarch64-hw-watchpoint-test.pat.patch b/fixup-gdb-rhbz1261564-aarch64-hw-watchpoint-test.pat.patch new file mode 100644 index 0000000..7ee17b2 --- /dev/null +++ b/fixup-gdb-rhbz1261564-aarch64-hw-watchpoint-test.pat.patch @@ -0,0 +1,43 @@ +From e452307ba07f5d798edad73631182e137265da7d Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 13 Jun 2023 17:58:42 +0200 +Subject: [PATCH 9/9] fixup gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch + +--- + .../rhbz1261564-aarch64-watchpoint.exp | 18 ++++++++++++++---- + 1 file changed, 14 insertions(+), 4 deletions(-) + +diff --git a/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.exp b/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.exp +index b1cf7115663..42ebc25cc49 100644 +--- a/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.exp ++++ b/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.exp +@@ -20,12 +20,22 @@ if { [prepare_for_testing rhbz1261564-aarch64-watchpoint.exp "rhbz1261564-aarch6 + if { ! [ runto main ] } then { return 0 } + + set test "rwatch aligned.var4" +-if [istarget "s390*-*-*"] { +- gdb_test $test {Target does not support this type of hardware watchpoint\.} +- untested "s390* does not support hw read watchpoint" ++ ++set supported 1 ++gdb_test_multiple $test "" { ++ -re -wrap "Hardware read watchpoint \[0-9\]+: aligned.var4" { ++ pass $gdb_test_name ++ } ++ -re -wrap "Target does not support this type of hardware watchpoint\\." { ++ set supported 0 ++ } ++} ++ ++if { !$supported } { ++ unsupported $test + return + } +-gdb_test $test "Hardware read watchpoint \[0-9\]+: aligned.var4" ++ + + proc checkvar { address } { + global gdb_prompt +-- +2.35.3 + diff --git a/fixup-gdb-rhbz1325795-framefilters-test.patch b/fixup-gdb-rhbz1325795-framefilters-test.patch deleted file mode 100644 index 5ce78c7..0000000 --- a/fixup-gdb-rhbz1325795-framefilters-test.patch +++ /dev/null @@ -1,19 +0,0 @@ -fixup-gdb-rhbz1325795-framefilters-test.patch - ---- - gdb/testsuite/gdb.python/py-framefilter-thread.exp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gdb/testsuite/gdb.python/py-framefilter-thread.exp b/gdb/testsuite/gdb.python/py-framefilter-thread.exp -index 71f97463372..156a4d7bbf3 100644 ---- a/gdb/testsuite/gdb.python/py-framefilter-thread.exp -+++ b/gdb/testsuite/gdb.python/py-framefilter-thread.exp -@@ -39,7 +39,7 @@ gdb_breakpoint [gdb_get_line_number "Backtrace end breakpoint"] - gdb_continue_to_breakpoint "Backtrace end breakpoint" - - # #2 0x00007ffff75f228d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113^M --gdb_test "bt no-filters" " in (\\.?_*clone|thread_start) \[^\r\n\]*" "bt no-filters" -+gdb_test "bt no-filters" " in (\\.?_*clone3?|thread_start) \[^\r\n\]*" "bt no-filters" - - # #2 0x00007ffff75f228d in 941595343737041 () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113^M - # vs. diff --git a/gdb-12.1.tar.bz2 b/gdb-12.1.tar.bz2 deleted file mode 100644 index f8450e4..0000000 --- a/gdb-12.1.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c8ad7cb193a9d7bad7966da1e7f25d57cc369e835416965719fbda266fb13a44 -size 29842337 diff --git a/gdb-13.2.tar.bz2 b/gdb-13.2.tar.bz2 new file mode 100644 index 0000000..2141f0c --- /dev/null +++ b/gdb-13.2.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1d110e9ebdf9b1ebef92382aba1258a377d0531d775a705c273870521ce0a8ac +size 31423251 diff --git a/gdb-6.3-bz140532-ppc-unwinding-test.patch b/gdb-6.3-bz140532-ppc-unwinding-test.patch deleted file mode 100644 index 714b62c..0000000 --- a/gdb-6.3-bz140532-ppc-unwinding-test.patch +++ /dev/null @@ -1,320 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-6.3-bz140532-ppc-unwinding-test.patch - -;; Update PPC unwinding patches to their upstream variants (BZ 140532). -;;=fedoratest - -diff --git a/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S -@@ -0,0 +1,78 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2007 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. */ -+ -+ .section ".text" -+ .align 2 -+ .globl func0 -+ .type func0, @function -+func0: -+ stwu 1,-16(1) -+ mflr 0 -+ stw 31,12(1) -+ stw 0,20(1) -+ mr 31,1 -+ bl abort -+ .size func0, .-func0 -+ .align 2 -+ .globl func1 -+ .type func1, @function -+func1: -+ stwu 1,-16(1) -+ mflr 0 -+/* 20 = BO = branch always -+ 31 = BI = CR bit (ignored) */ -+ bcl 20,31,.Lpie -+.Lpie: stw 31,12(1) -+ stw 0,20(1) -+ mr 31,1 -+ bl func0 -+ mr 0,3 -+ lis 9,var@ha -+ lwz 9,var@l(9) -+ add 0,0,9 -+ mr 3,0 -+ lwz 11,0(1) -+ lwz 0,4(11) -+ mtlr 0 -+ lwz 31,-4(11) -+ mr 1,11 -+ blr -+ .size func1, .-func1 -+ .section .note.GNU-stack,"",@progbits -+ .ident "GCC: (GNU) 3.4.6 20060404 (Red Hat 3.4.6-8)" -+ -+/* Original source file: -+ -+#include -+ -+extern volatile int var; -+ -+int func0 (void) __attribute__((__noinline__)); -+int func0 (void) -+{ -+ abort (); -+ return var; -+} -+ -+int func1 (void) __attribute__((__noinline__)); -+int func1 (void) -+{ -+ return func0 () + var; -+} -+ -+*/ -diff --git a/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm64.S b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm64.S -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm64.S -@@ -0,0 +1,98 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2007 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. */ -+ -+ .section ".toc","aw" -+ .section ".text" -+ .align 2 -+ .globl func0 -+ .section ".opd","aw" -+ .align 3 -+func0: -+ .quad .L.func0,.TOC.@tocbase -+ .previous -+ .type func0, @function -+.L.func0: -+ mflr 0 -+ std 31,-8(1) -+ std 0,16(1) -+ stdu 1,-128(1) -+ mr 31,1 -+ bl abort -+ nop -+ .long 0 -+ .byte 0,0,0,1,128,1,0,1 -+ .size func0,.-.L.func0 -+ .section ".toc","aw" -+.LC1: -+ .tc var[TC],var -+ .section ".text" -+ .align 2 -+ .globl func1 -+ .section ".opd","aw" -+ .align 3 -+func1: -+ .quad .L.func1,.TOC.@tocbase -+ .previous -+ .type func1, @function -+.L.func1: -+ mflr 0 -+/* 20 = BO = branch always -+ 31 = BI = CR bit (ignored) */ -+ bcl 20,31,.Lpie -+.Lpie: std 31,-8(1) -+ std 0,16(1) -+ stdu 1,-128(1) -+ mr 31,1 -+ bl func0 -+ mr 11,3 -+ ld 9,.LC1@toc(2) -+ lwz 0,0(9) -+ add 0,11,0 -+ extsw 0,0 -+ mr 3,0 -+ ld 1,0(1) -+ ld 0,16(1) -+ mtlr 0 -+ ld 31,-8(1) -+ blr -+ .long 0 -+ .byte 0,0,0,1,128,1,0,1 -+ .size func1,.-.L.func1 -+ .section .note.GNU-stack,"",@progbits -+ .ident "GCC: (GNU) 3.4.6 20060404 (Red Hat 3.4.6-8)" -+ -+/* Original source file: -+ -+#include -+ -+extern volatile int var; -+ -+int func0 (void) __attribute__((__noinline__)); -+int func0 (void) -+{ -+ abort (); -+ return var; -+} -+ -+int func1 (void) __attribute__((__noinline__)); -+int func1 (void) -+{ -+ return func0 () + var; -+} -+ -+*/ -diff --git a/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c -@@ -0,0 +1,29 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2007 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. */ -+ -+/* Force `-fpie' double jump bl->blrl. */ -+/* No longer used. */ -+volatile int var; -+ -+extern int func1 (void); -+ -+int main (void) -+{ -+ func1 (); -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp -@@ -0,0 +1,72 @@ -+# Copyright 2006, 2007 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 unwinding fixes of the PPC platform, specifically on the coping with BCL -+# jump of the PIE code. -+ -+if ![istarget "powerpc*-*-linux*"] then { -+ verbose "Skipping powerpc-linux prologue tests." -+ return -+} -+ -+set testfile "powerpc-bcl-prologue" -+set srcfile1 ${testfile}.c -+set flags "debug" -+if [istarget "powerpc-*"] then { -+ set srcfile2 ${testfile}-asm32.S -+ set flags "$flags additional_flags=-m32" -+} elseif [istarget "powerpc64-*"] then { -+ set srcfile2 ${testfile}-asm64.S -+ set flags "$flags additional_flags=-m64" -+} else { -+ fail "powerpc arch test" -+ return -+} -+set objfile2 [standard_output_file ${testfile}-asm.o] -+set binfile [standard_output_file ${testfile}] -+ -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile1} ${srcdir}/${subdir}/${srcfile2}" ${binfile} executable $flags] != ""} { -+ return -1 -+} -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+# We should stop in abort(3). -+ -+gdb_run_cmd -+ -+gdb_test_multiple {} "continue to abort()" { -+ -re ".*Program received signal SIGABRT,.*$gdb_prompt $" { -+ pass "continue to abort()" -+ } -+} -+ -+# Check backtrace: -+# #3 0x0804835f in func0 () -+# #4 0x0804836a in func1 () -+# #5 0x0804838c in main () -+# (gdb) -+# `\\.?' prefixes are needed for ppc64 without `debug' (another bug). -+ -+set test "matching unwind" -+gdb_test_multiple "backtrace" $test { -+ -re "\r\n#\[0-9\]\[^\r\n\]* in \\.?func0 \\(\[^\r\n\]*\r\n#\[0-9\]\[^\r\n\]* in \\.?func1 \\(\[^\r\n\]*\r\n#\[0-9\]\[^\r\n\]* in \\.?main \\(\[^\r\n\]*\r\n$gdb_prompt $" { -+ pass $test -+ } -+} -diff --git a/gdb/testsuite/gdb.arch/powerpc-prologue.exp b/gdb/testsuite/gdb.arch/powerpc-prologue.exp ---- a/gdb/testsuite/gdb.arch/powerpc-prologue.exp -+++ b/gdb/testsuite/gdb.arch/powerpc-prologue.exp -@@ -16,8 +16,9 @@ - # Test PowerPC prologue analyzer. - - # Do not run on AIX (where we won't be able to build the tests without --# some surgery) or on PowerPC64 (ditto, dot symbols). --if {[istarget *-*-aix*] || ![istarget "powerpc-*-*"]} then { -+# some surgery). PowerPC64 target would break due to dot symbols but we build -+# there PowerPC32 inferior. -+if {[istarget *-*-aix*] || ![istarget "powerpc*-*-*"]} then { - verbose "Skipping PowerPC prologue tests." - return - } diff --git a/gdb-6.3-focus-cmd-prev-test.patch b/gdb-6.3-focus-cmd-prev-test.patch deleted file mode 100644 index 8deaad6..0000000 --- a/gdb-6.3-focus-cmd-prev-test.patch +++ /dev/null @@ -1,53 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-6.3-focus-cmd-prev-test.patch - -;; Test a crash on `focus cmd', `focus prev' commands. -;;=fedoratest - -diff --git a/gdb/testsuite/gdb.base/focus-cmd-prev.exp b/gdb/testsuite/gdb.base/focus-cmd-prev.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/focus-cmd-prev.exp -@@ -0,0 +1,40 @@ -+# Copyright 2008 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. -+ -+if $tracelevel then { -+ strace $tracelevel -+} -+ -+gdb_exit -+gdb_start -+ -+# Do not use gdb_test or \r\n there since: -+# commit d7e747318f4d04af033f16325f9b6d74f67079ec -+# Eliminate make_cleanup_ui_file_delete / make ui_file a class hierarchy -+ -+set test "focus cmd" -+gdb_test_multiple $test $test { -+ -re "$gdb_prompt $" { -+ pass $test -+ } -+} -+ -+set test "focus prev" -+gdb_test_multiple $test $test { -+ -re "$gdb_prompt $" { -+ pass $test -+ } -+} diff --git a/gdb-6.3-gstack-20050411.patch b/gdb-6.3-gstack-20050411.patch index 6379177..5cc5263 100644 --- a/gdb-6.3-gstack-20050411.patch +++ b/gdb-6.3-gstack-20050411.patch @@ -16,7 +16,7 @@ Subject: gdb-6.3-gstack-20050411.patch diff --git a/gdb/Makefile.in b/gdb/Makefile.in --- a/gdb/Makefile.in +++ b/gdb/Makefile.in -@@ -1767,7 +1767,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force +@@ -2011,7 +2011,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force install: all @$(MAKE) $(FLAGS_TO_PASS) install-only @@ -25,7 +25,7 @@ diff --git a/gdb/Makefile.in b/gdb/Makefile.in transformed_name=`t='$(program_transform_name)'; \ echo gdb | sed -e "$$t"` ; \ if test "x$$transformed_name" = x; then \ -@@ -1816,7 +1816,25 @@ install-guile: +@@ -2061,7 +2061,25 @@ install-guile: install-python: $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(GDB_DATADIR)/python/gdb @@ -52,7 +52,7 @@ diff --git a/gdb/Makefile.in b/gdb/Makefile.in transformed_name=`t='$(program_transform_name)'; \ echo gdb | sed -e $$t` ; \ if test "x$$transformed_name" = x; then \ -@@ -1847,6 +1865,18 @@ uninstall: force $(CONFIG_UNINSTALL) +@@ -2092,6 +2110,18 @@ uninstall: force $(CONFIG_UNINSTALL) rm -f $(DESTDIR)$(bindir)/$$transformed_name @$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do diff --git a/gdb-6.3-inheritancetest-20050726.patch b/gdb-6.3-inheritancetest-20050726.patch deleted file mode 100644 index ef7aba2..0000000 --- a/gdb-6.3-inheritancetest-20050726.patch +++ /dev/null @@ -1,160 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Jeff Johnston -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-6.3-inheritancetest-20050726.patch - -;; Verify printing of inherited members test -;;=fedoratest - -2005-07-26 Jeff Johnston - - * gdb.cp/b146835.exp: New testcase. - * gdb.cp/b146835.cc: Ditto. - * gdb.cp/b146835b.cc: Ditto. - * gdb.cp/b146835.h: Ditto. - -diff --git a/gdb/testsuite/gdb.cp/b146835.cc b/gdb/testsuite/gdb.cp/b146835.cc -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/b146835.cc -@@ -0,0 +1,31 @@ -+#include "b146835.h" -+#include -+ -+class F : public C { -+ -+protected: -+ -+ virtual void funcA (unsigned long a, B *b); -+ virtual void funcB (E *e); -+ virtual void funcC (unsigned long x, bool y); -+ -+ char *s1, *s2; -+ bool b1; -+ int k; -+ -+public: -+ void foo() { -+ std::cout << "foo" << std::endl; -+ } -+}; -+ -+ -+void F::funcA (unsigned long a, B *b) {} -+void F::funcB (E *e) {} -+void F::funcC (unsigned long x, bool y) {} -+ -+int main() -+{ -+ F f; -+ f.foo(); -+} -diff --git a/gdb/testsuite/gdb.cp/b146835.exp b/gdb/testsuite/gdb.cp/b146835.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/b146835.exp -@@ -0,0 +1,47 @@ -+# This testcase is part of GDB, the GNU debugger. -+ -+# Copyright 2005 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. -+ -+# Check that GDB can properly print an inherited member variable -+# (Bugzilla 146835) -+ -+set testfile "b146835" -+set srcfile ${testfile}.cc -+set srcfile2 ${testfile}b.cc -+set binfile [standard_output_file ${testfile}] -+if {[gdb_compile "${srcdir}/${subdir}/${srcfile} ${srcdir}/${subdir}/${srcfile2}" "${binfile}" executable {debug c++}] != "" } { -+ return -1 -+} -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+# -+# Run to `main' where we begin our tests. -+# -+ -+if ![runto_main] then { -+ gdb_suppress_tests -+} -+ -+gdb_test "break 'F::foo()'" "" -+gdb_continue_to_breakpoint "First line foo" -+ -+# Verify that we can access the inherited member d -+gdb_test "p d" " = \\(D \\*\\) *0x0" "Verify inherited member d accessible" -diff --git a/gdb/testsuite/gdb.cp/b146835.h b/gdb/testsuite/gdb.cp/b146835.h -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/b146835.h -@@ -0,0 +1,36 @@ -+ -+class A { -+ -+protected: -+ -+ virtual void funcA (unsigned long a, class B *b) = 0; -+ virtual void funcB (class E *e) = 0; -+ virtual void funcC (unsigned long x, bool y) = 0; -+ -+ void funcD (class E *e, class D* d); -+ virtual void funcE (E *e, D *d); -+ virtual void funcF (unsigned long x, D *d); -+}; -+ -+ -+class C : public A { -+ -+protected: -+ -+ int x; -+ class K *k; -+ class H *h; -+ -+ D *d; -+ -+ class W *w; -+ class N *n; -+ class L *l; -+ unsigned long *r; -+ -+public: -+ -+ C(); -+ int z (char *s); -+ virtual ~C(); -+}; -diff --git a/gdb/testsuite/gdb.cp/b146835b.cc b/gdb/testsuite/gdb.cp/b146835b.cc -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/b146835b.cc -@@ -0,0 +1,11 @@ -+#include "b146835.h" -+ -+C::C() { d = 0; x = 3; } -+ -+int C::z (char *s) { return 0; } -+ -+C::~C() {} -+ -+void A::funcD (class E *e, class D *d) {} -+void A::funcE (E *e, D *d) {} -+void A::funcF (unsigned long x, D *d) {} diff --git a/gdb-6.3-test-dtorfix-20050121.patch b/gdb-6.3-test-dtorfix-20050121.patch deleted file mode 100644 index a3bcaf5..0000000 --- a/gdb-6.3-test-dtorfix-20050121.patch +++ /dev/null @@ -1,247 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-6.3-test-dtorfix-20050121.patch - -;; Test support of multiple destructors just like multiple constructors -;;=fedoratest - -diff --git a/gdb/testsuite/gdb.cp/constructortest.cc b/gdb/testsuite/gdb.cp/constructortest.cc -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/constructortest.cc -@@ -0,0 +1,99 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2005 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. */ -+ -+class A -+{ -+ public: -+ A(); -+ ~A(); -+ int k; -+ private: -+ int x; -+}; -+ -+class B: public A -+{ -+ public: -+ B(); -+ private: -+ int y; -+}; -+ -+/* C and D are for the $delete destructor. */ -+ -+class C -+{ -+ public: -+ C(); -+ virtual ~C(); -+ private: -+ int x; -+}; -+ -+class D: public C -+{ -+ public: -+ D(); -+ private: -+ int y; -+}; -+ -+int main(int argc, char *argv[]) -+{ -+ A* a = new A; -+ B* b = new B; -+ D* d = new D; -+ delete a; -+ delete b; -+ delete d; -+ return 0; -+} -+ -+A::A() /* Constructor A */ -+{ -+ x = 1; /* First line A */ -+ k = 4; /* Second line A */ -+} -+ -+A::~A() /* Destructor A */ -+{ -+ x = 3; /* First line ~A */ -+ k = 6; /* Second line ~A */ -+} -+ -+B::B() -+{ -+ y = 2; /* First line B */ -+ k = 5; -+} -+ -+C::C() /* Constructor C */ -+{ -+ x = 1; /* First line C */ -+} -+ -+C::~C() /* Destructor C */ -+{ -+ x = 3; /* First line ~C */ -+} -+ -+D::D() -+{ -+ y = 2; /* First line D */ -+} -diff --git a/gdb/testsuite/gdb.cp/constructortest.exp b/gdb/testsuite/gdb.cp/constructortest.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/constructortest.exp -@@ -0,0 +1,130 @@ -+# This testcase is part of GDB, the GNU debugger. -+ -+# Copyright 2005, 2007 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. -+ -+# Check that GDB can break at multiple forms of constructors. -+ -+set testfile "constructortest" -+set srcfile ${testfile}.cc -+set binfile [standard_output_file ${testfile}] -+# PIE is required for testing proper BREAKPOINT_RE_SET of the multiple-PC -+# breakpoints. -+if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++ "additional_flags=-fpie -pie"}] != "" } { -+ return -1 -+} -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+# -+# Run to `main' where we begin our tests. -+# -+ -+if ![runto_main] then { -+ gdb_suppress_tests -+} -+ -+# Break on the various forms of the A::A constructor. -+# " (2 locations)" is displayed depending on G++ version. -+gdb_test "break A\:\:A" "Breakpoint 2 at .*" "breaking on A::A" -+ -+# Verify that we break for the A constructor two times -+# Once for new A and once for new B -+gdb_continue_to_breakpoint "First line A" -+gdb_test "bt" "#0.*A.*#1.*main.*" "Verify in in-charge A::A" -+gdb_continue_to_breakpoint "First line A" -+gdb_test "bt" "#0.*A.*#1.*B.*#2.*main.*" "Verify in not-in-charge A::A" -+ -+# Now do the same for destructors -+gdb_test "break 'A::~A()'" "" -+ -+# Verify that we break for the A destructor two times -+# Once for delete a and once for delete b -+gdb_continue_to_breakpoint "First line ~A" -+gdb_test "bt" "#0.*~A.*#1.*main.*" "Verify in in-charge A::~A" -+gdb_continue_to_breakpoint "First line ~A" -+gdb_test "bt" "#0.*~A.*#1.*~B.*#2.*main.*" "Verify in not-in-charge A::~A" -+ -+ -+# Verify that we can break by line number in a constructor and find -+# both occurrences -+runto_main -+gdb_test "break 'A::A()'" "" "break in constructor A 2" -+gdb_continue_to_breakpoint "First line A" -+set second_line [gdb_get_line_number "Second line A"] -+# " (2 locations)" is displayed depending on G++ version. -+gdb_test "break $second_line" "Breakpoint .*, line $second_line\\..*" "break by line in constructor" -+gdb_continue_to_breakpoint "Second line A" -+gdb_test "bt" "#0.*A.*#1.*main.*" "Verify in in-charge A::A second line" -+gdb_continue_to_breakpoint "Second line A" -+gdb_test "bt" "#0.*A.*#1.*B.*#2.*main.*" "Verify in not-in-charge A::A second line" -+ -+# Verify that we can break by line number in a destructor and find -+# both occurrences -+gdb_test "break 'A::~A()'" "" "break in constructor ~A 2" -+gdb_continue_to_breakpoint "First line ~A" -+set second_line_dtor [gdb_get_line_number "Second line ~A"] -+# " (2 locations)" is displayed depending on G++ version. -+gdb_test "break $second_line_dtor" "Breakpoint .*, line $second_line_dtor\\..*" "break by line in destructor" -+gdb_continue_to_breakpoint "Second line ~A" -+gdb_test "bt" "#0.*A.*#1.*main.*" "Verify in in-charge A::~A second line" -+# FIXME: Analyse this case better. -+gdb_continue_to_breakpoint "Second line ~A" -+gdb_test "bt" "#0.*A.*#1.*main.*" "Verify in A::~A second line #2" -+gdb_continue_to_breakpoint "Second line ~A" -+gdb_test "bt" "#0.*A.*#1.*B.*#2.*main.*" "Verify in not-in-charge A::~A second line" -+ -+ -+# Test now the $delete destructors. -+ -+gdb_load ${binfile} -+runto_main -+ -+set first_line_dtor [gdb_get_line_number "First line ~C"] -+set define_line_dtor [gdb_get_line_number "Destructor C"] -+# Break on the various forms of the C::~C destructor -+# " ([23] locations)" is displayed depending on G++ version. -+gdb_test "break C\:\:~C" "Breakpoint .*: C::~C\\. \\(2 locations\\)" "breaking on C::~C" -+gdb_continue_to_breakpoint "First line ~C" -+ -+# Verify that we can break by line number in a destructor and find -+# the $delete occurence -+ -+gdb_load ${binfile} -+delete_breakpoints -+ -+# " (3 locations)" is displayed depending on G++ version. -+gdb_test "break $first_line_dtor" "Breakpoint .*, line $first_line_dtor\\..*" "break by line in destructor" -+ -+# Run to `main' where we begin our tests. -+# Set the breakpoints first to test PIE multiple-PC BREAKPOINT_RE_SET. -+# RUNTO_MAIN or RUNTO MAIN are not usable here as it runs DELETE_BREAKPOINTS. -+ -+if ![gdb_breakpoint main] { -+ gdb_suppress_tests -+} -+gdb_run_cmd -+set test "running to main" -+gdb_test_multiple "" $test { -+ -re "Breakpoint \[0-9\]*, main .*$gdb_prompt $" { -+ pass $test -+ } -+} -+ -+gdb_continue_to_breakpoint "First line ~C" diff --git a/gdb-6.3-test-movedir-20050125.patch b/gdb-6.3-test-movedir-20050125.patch deleted file mode 100644 index 1c894c8..0000000 --- a/gdb-6.3-test-movedir-20050125.patch +++ /dev/null @@ -1,101 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Elena Zannoni -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-6.3-test-movedir-20050125.patch - -;; Fix to support executable moving -;;=fedoratest - -2005-01-25 Elena Zannoni - - * gdb.base/move-dir.exp: New test. - * gdb.base/move-dir.c: Ditto. - * gdb.base/move-dir.h: Ditto. - -diff --git a/gdb/testsuite/gdb.base/move-dir.c b/gdb/testsuite/gdb.base/move-dir.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/move-dir.c -@@ -0,0 +1,9 @@ -+#include -+#include -+#include "move-dir.h" -+ -+int main() { -+ const char* hw = "hello world."; -+ printf ("%s\n", hw);; -+ other(); -+} -diff --git a/gdb/testsuite/gdb.base/move-dir.exp b/gdb/testsuite/gdb.base/move-dir.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/move-dir.exp -@@ -0,0 +1,57 @@ -+# Copyright 2005 -+# 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. -+ -+set testfile "move-dir" -+set srcfile ${testfile}.c -+set incfile ${testfile}.h -+set binfile [standard_output_file ${testfile}] -+ -+set testdir [standard_output_file incdir] -+ -+remote_exec build "mkdir $testdir" -+remote_exec build "cp ${srcdir}/${subdir}/${srcfile} [standard_output_file ${srcfile}]" -+remote_exec build "cp ${srcdir}/${subdir}/${incfile} [standard_output_file ${incfile}]" -+ -+set additional_flags "additional_flags=-I${subdir}/incdir" -+ -+if { [gdb_compile [standard_output_file ${srcfile}] "${binfile}" executable [list debug $additional_flags]] != "" } { -+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." -+} -+ -+# Create and source the file that provides information about the compiler -+# used to compile the test case. -+ -+if [get_compiler_info ${binfile}] { -+ return -1; -+} -+ -+ -+set oldtimeout $timeout -+set timeout [expr "$timeout + 60"] -+ -+# Start with a fresh gdb. -+ -+gdb_exit -+gdb_start -+gdb_test "cd ../.." "" "" -+gdb_load ${binfile} -+gdb_test "list main" ".*hw.*other.*" "found main" -+gdb_test "list other" ".*ostring.*" "found include file" -+ -+ -+set timeout $oldtimeout -+return 0 -diff --git a/gdb/testsuite/gdb.base/move-dir.h b/gdb/testsuite/gdb.base/move-dir.h -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/move-dir.h -@@ -0,0 +1,6 @@ -+#include -+ -+void other() { -+ const char* ostring = "other"; -+ printf ("%s\n", ostring);; -+} diff --git a/gdb-6.3-threaded-watchpoints2-20050225.patch b/gdb-6.3-threaded-watchpoints2-20050225.patch deleted file mode 100644 index 7f02ba7..0000000 --- a/gdb-6.3-threaded-watchpoints2-20050225.patch +++ /dev/null @@ -1,253 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Jeff Johnston -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-6.3-threaded-watchpoints2-20050225.patch - -;; Test sibling threads to set threaded watchpoints for x86 and x86-64 -;;=fedoratest - -2005-02-28 Jeff Johnston - - * config/i386/nm-linux.h: Change dr register routines to - accept a ptid_t first argument. Change all calling macros - to default the inferior_ptid for the first argument. - (i386_linux_insert_watchpoint): New prototype. - (i386_linux_remove_watchpoint, i386_linux_insert_hw_breakpoint): Ditto. - (i386_linux_remove_hw_breakpoint): Ditto. - (target_insert_watchpoint, target_remove_watchpoint): Undef and - override. - (target_insert_hw_breakpoint, target_remove_hw_breakpoint): Ditto. - * config/i386/nm-linux64.h: Ditto except add amd64 versions of - the watchpoint/hw-breakpoint insert/remove routines. - * i386-nat.c: Include "inferior.h" to define inferior_ptid. - * i386-linux-nat.c: Change all dr get/set routines to accept - ptid_t as first argument and to use this argument to determine - the tid for PTRACE. - (i386_linux_set_debug_regs_for_thread): New function. - (i386_linux_sync_debug_registers_callback): Ditto. - (i386_linux_sync_debug_registers_across_threads): Ditto. - (i386_linux_insert_watchpoint, i386_linux_remove_watchpoint): Ditto. - (i386_linux_hw_breakpoint, i386_linux_remove_hw_breakpoint): Ditto. - (i386_linux_new_thread): Ditto. - (_initialize_i386_linux_nat): Ditto. - * amd64-linux-nat.c: Change all dr get/set routines to accept - ptid_t as first argument and to use this argument to determine - the tid for PTRACE. - (amd64_linux_set_debug_regs_for_thread): New function. - (amd64_linux_sync_debug_registers_callback): Ditto. - (amd64_linux_sync_debug_registers_across_threads): Ditto. - (amd64_linux_insert_watchpoint, amd64_linux_remove_watchpoint): Ditto. - (amd64_linux_hw_breakpoint, amd64_linux_remove_hw_breakpoint): Ditto. - (amd64_linux_new_thread): Ditto. - (_initialize_amd64_linux_nat): Register linux new thread observer. - * testsuite/gdb.threads/watchthreads-threaded.c: New test case. - * testsuite/gdb.threads/watchthreads-threaded.exp: Ditto. - -[ With recent upstream GDB (6.8) reduced only to the testcase. ] - -[ It was called watchthreads2.{exp,c} before but it conflicted with FSF GDB new - testcase of the same name. ] - -FIXME: The testcase does not expects multiple watchpoints hits per one stop. - -diff --git a/gdb/testsuite/gdb.threads/watchthreads-threaded.c b/gdb/testsuite/gdb.threads/watchthreads-threaded.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.threads/watchthreads-threaded.c -@@ -0,0 +1,65 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2002, 2003, 2004, 2005 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. -+ -+ This file is copied from schedlock.c. */ -+ -+#include -+#include -+#include -+#include -+ -+void *thread_function(void *arg); /* Pointer to function executed by each thread */ -+ -+#define NUM 5 -+ -+unsigned int args[NUM+1]; -+ -+int main() { -+ int res; -+ pthread_t threads[NUM]; -+ void *thread_result; -+ long i; -+ -+ for (i = 0; i < NUM; i++) -+ { -+ args[i] = 1; /* Init value. */ -+ res = pthread_create(&threads[i], -+ NULL, -+ thread_function, -+ (void *) i); -+ } -+ -+ args[i] = 1; -+ thread_function ((void *) i); -+ -+ exit(EXIT_SUCCESS); -+} -+ -+void *thread_function(void *arg) { -+ int my_number = (long) arg; -+ int *myp = (int *) &args[my_number]; -+ -+ /* Don't run forever. Run just short of it :) */ -+ while (*myp > 0) -+ { -+ (*myp) ++; usleep (1); /* Loop increment. */ -+ } -+ -+ pthread_exit(NULL); -+} -diff --git a/gdb/testsuite/gdb.threads/watchthreads-threaded.exp b/gdb/testsuite/gdb.threads/watchthreads-threaded.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.threads/watchthreads-threaded.exp -@@ -0,0 +1,126 @@ -+# This testcase is part of GDB, the GNU debugger. -+ -+# Copyright 2005 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. -+ -+# Check that GDB can support multiple watchpoints across threads. -+ -+# This test verifies that a watchpoint is detected in the proper thread -+# so the test is only meaningful on a system with hardware watchpoints. -+if [target_info exists gdb,no_hardware_watchpoints] { -+ return 0; -+} -+ -+set testfile "watchthreads-threaded" -+set srcfile ${testfile}.c -+set binfile [standard_output_file ${testfile}] -+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}"]] != "" } { -+ return -1 -+} -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+gdb_test "set can-use-hw-watchpoints 1" "" "" -+ -+# -+# Run to `main' where we begin our tests. -+# -+ -+if ![runto_main] then { -+ gdb_suppress_tests -+} -+ -+set args_2 0 -+set args_3 0 -+ -+gdb_breakpoint "thread_function" -+gdb_continue_to_breakpoint "thread_function" -+gdb_test "disable 2" "" -+ -+gdb_test_multiple "p args\[2\]" "get initial args2" { -+ -re "\\\$\[0-9\]* = (.*)$gdb_prompt $" { -+ set init_args_2 $expect_out(1,string) -+ pass "get initial args2" -+ } -+} -+ -+gdb_test_multiple "p args\[3\]" "get initial args3" { -+ -re "\\\$\[0-9\]* = (.*)$gdb_prompt $" { -+ set init_args_3 $expect_out(1,string) -+ pass "get initial args3" -+ } -+} -+ -+set args_2 $init_args_2 -+set args_3 $init_args_3 -+ -+# Watch values that will be modified by distinct threads. -+gdb_test "watch args\[2\]" "Hardware watchpoint 3: args\\\[2\\\]" -+gdb_test "watch args\[3\]" "Hardware watchpoint 4: args\\\[3\\\]" -+ -+set init_line [expr [gdb_get_line_number "Init value"]+1] -+set inc_line [gdb_get_line_number "Loop increment"] -+ -+# Loop and continue to allow both watchpoints to be triggered. -+for {set i 0} {$i < 30} {incr i} { -+ set test_flag 0 -+ gdb_test_multiple "continue" "threaded watch loop" { -+ -re "Hardware watchpoint 3: args\\\[2\\\].*Old value = 0.*New value = 1.*main \\\(\\\) at .*watchthreads-threaded.c:$init_line.*$gdb_prompt $" -+ { set args_2 1; set test_flag 1 } -+ -re "Hardware watchpoint 4: args\\\[3\\\].*Old value = 0.*New value = 1.*main \\\(\\\) at .*watchthreads-threaded.c:$init_line.*$gdb_prompt $" -+ { set args_3 1; set test_flag 1 } -+ -re "Hardware watchpoint 3: args\\\[2\\\].*Old value = $args_2.*New value = [expr $args_2+1].*thread_function \\\(arg=0x2\\\) at .*watchthreads-threaded.c:$inc_line.*$gdb_prompt $" -+ { set args_2 [expr $args_2+1]; set test_flag 1 } -+ -re "Hardware watchpoint 4: args\\\[3\\\].*Old value = $args_3.*New value = [expr $args_3+1].*thread_function \\\(arg=0x3\\\) at .*watchthreads-threaded.c:$inc_line.*$gdb_prompt $" -+ { set args_3 [expr $args_3+1]; set test_flag 1 } -+ } -+ # If we fail above, don't bother continuing loop -+ if { $test_flag == 0 } { -+ set i 30; -+ } -+} -+ -+# Print success message if loop succeeded. -+if { $test_flag == 1 } { -+ pass "threaded watch loop" -+} -+ -+# Verify that we hit first watchpoint in child thread. -+set message "watchpoint on args\[2\] hit in thread" -+if { $args_2 > 1 } { -+ pass $message -+} else { -+ fail $message -+} -+ -+# Verify that we hit second watchpoint in child thread. -+set message "watchpoint on args\[3\] hit in thread" -+if { $args_3 > 1 } { -+ pass $message -+} else { -+ fail $message -+} -+ -+# Verify that all watchpoint hits are accounted for. -+set message "combination of threaded watchpoints = 30 + initial values" -+if { [expr $args_2+$args_3] == [expr [expr 30+$init_args_2]+$init_args_3] } { -+ pass $message -+} else { -+ fail $message -+} diff --git a/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch b/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch index f5da0e9..e5ad521 100644 --- a/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch +++ b/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch @@ -44,7 +44,7 @@ glibc-debuginfo-2.7-2.x86_64: /usr/lib/debug/lib64/libc.so.6.debug: diff --git a/gdb/printcmd.c b/gdb/printcmd.c --- a/gdb/printcmd.c +++ b/gdb/printcmd.c -@@ -1301,6 +1301,10 @@ process_print_command_args (const char *args, value_print_options *print_opts, +@@ -1300,6 +1300,10 @@ process_print_command_args (const char *args, value_print_options *print_opts, if (exp != nullptr && *exp) { diff --git a/gdb-6.6-buildid-locate-rpm-scl.patch b/gdb-6.6-buildid-locate-rpm-scl.patch deleted file mode 100644 index 5591809..0000000 --- a/gdb-6.6-buildid-locate-rpm-scl.patch +++ /dev/null @@ -1,42 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-6.6-buildid-locate-rpm-scl.patch - -;; [SCL] Skip deprecated .gdb_index warning for Red Hat built files (BZ 953585). -;;=push+jan - -warning: Skipping deprecated .gdb_index section -https://bugzilla.redhat.com/show_bug.cgi?id=953585 - -diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c ---- a/gdb/dwarf2/read.c -+++ b/gdb/dwarf2/read.c -@@ -2797,6 +2797,16 @@ read_gdb_index_from_buffer (const char *filename, - "set use-deprecated-index-sections on". */ - if (version < 6 && !deprecated_ok) - { -+#ifdef GDB_INDEX_VERIFY_VENDOR -+ extern int rpm_verify_vendor (const char *filename); -+ -+ /* Red Hat Developer Toolset exception. */ -+ if (rpm_verify_vendor (filename)) -+ {} -+ else -+ { -+ -+#endif - static int warning_printed = 0; - if (!warning_printed) - { -@@ -2808,6 +2818,10 @@ to use the section anyway."), - warning_printed = 1; - } - return 0; -+#ifdef GDB_INDEX_VERIFY_VENDOR -+ -+ } -+#endif - } - /* Version 7 indices generated by gold refer to the CU for a symbol instead - of the TU (for symbols coming from TUs), diff --git a/gdb-6.6-buildid-locate-rpm-suse.patch b/gdb-6.6-buildid-locate-rpm-suse.patch index 84c02f7..d745c0a 100644 --- a/gdb-6.6-buildid-locate-rpm-suse.patch +++ b/gdb-6.6-buildid-locate-rpm-suse.patch @@ -1,8 +1,17 @@ -Index: gdb-9.1/gdb/build-id.c -=================================================================== ---- gdb-9.1.orig/gdb/build-id.c -+++ gdb-9.1/gdb/build-id.c -@@ -861,19 +861,17 @@ missing_rpm_enlist_1 (const char *filena +From 444f438fe775a9480b93dc7d63418e0e169b4fbd Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Fri, 21 Apr 2023 09:08:03 +0200 +Subject: [PATCH 1/5] gdb-6.6-buildid-locate-rpm-suse.patch + +--- + gdb/build-id.c | 71 +++++++++----------------------------------------- + 1 file changed, 13 insertions(+), 58 deletions(-) + +diff --git a/gdb/build-id.c b/gdb/build-id.c +index 86dfc8409b5..29aa10d8225 100644 +--- a/gdb/build-id.c ++++ b/gdb/build-id.c +@@ -863,10 +863,8 @@ missing_rpm_enlist_1 (const char *filename, int verify_vendor) #endif { Header h; @@ -14,11 +23,10 @@ Index: gdb-9.1/gdb/build-id.c rpmdbMatchIterator mi_debuginfo; h = rpmdbNextIterator_p (mi); - if (h == NULL) - break; +@@ -875,7 +873,9 @@ missing_rpm_enlist_1 (const char *filename, int verify_vendor) + + /* Verify the debuginfo file is not already installed. */ -- /* Verify the debuginfo file is not already installed. */ -- - debuginfo = headerFormat_p (h, "%{sourcerpm}-debuginfo.%{arch}", + /* The allocated memory gets utilized below for MISSING_RPM_HASH. */ + debuginfo = headerFormat_p (h, @@ -26,7 +34,7 @@ Index: gdb-9.1/gdb/build-id.c &err); if (!debuginfo) { -@@ -881,60 +879,19 @@ missing_rpm_enlist_1 (const char *filena +@@ -883,60 +883,19 @@ missing_rpm_enlist_1 (const char *filename, int verify_vendor) err); continue; } @@ -65,7 +73,7 @@ Index: gdb-9.1/gdb/build-id.c + /* Verify the debuginfo file is not already installed. */ /* RPMDBI_PACKAGES requires keylen == sizeof (int). */ /* RPMDBI_LABEL is an interface for NVR-based dbiFindByLabel(). */ - mi_debuginfo = rpmtsInitIterator_p (ts, (rpmTag) RPMDBI_LABEL, debuginfo, 0); + mi_debuginfo = rpmtsInitIterator_p (ts, (rpmDbiTagVal) RPMDBI_LABEL, debuginfo, 0); - xfree (debuginfo); if (mi_debuginfo) { @@ -89,23 +97,23 @@ Index: gdb-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 -@@ -1076,10 +1033,7 @@ missing_rpm_list_print (void) +@@ -1085,10 +1044,7 @@ missing_rpm_list_print (void) missing_rpm_list_entries = 0; - printf_unfiltered (_("Missing separate debuginfos, use: %s"), + gdb_printf (_("Missing separate debuginfos, use: %s"), -#ifdef DNF_DEBUGINFO_INSTALL - "dnf " -#endif - "debuginfo-install"); -+ "zypper install"); ++ "zypper install"); for (const char *el : array) { - puts_unfiltered (" "); -@@ -1287,13 +1241,12 @@ debug_print_missing (const char *binary, - fprintf_unfiltered (gdb_stdlog, - _("Missing separate debuginfo for %s\n"), binary); + gdb_printf (" %s", el); +@@ -1295,13 +1251,12 @@ debug_print_missing (const char *binary, const char *debug) + gdb_printf (gdb_stdlog, + _("Missing separate debuginfo for %s\n"), binary); if (debug != NULL) -- fprintf_unfiltered (gdb_stdlog, _("Try: %s %s\n"), +- gdb_printf (gdb_stdlog, _("Try: %s %s\n"), -#ifdef DNF_DEBUGINFO_INSTALL - "dnf" -#else @@ -114,10 +122,15 @@ Index: gdb-9.1/gdb/build-id.c - " --enablerepo='*debug*' install", debug); + { + const char *p = strrchr (debug, '/'); -+ fprintf_unfiltered (gdb_stdlog, _("Try: %s%.2s%.38s\"\n"), -+ "zypper install -C \"debuginfo(build-id)=", -+ p - 2, p + 1); ++ gdb_printf (gdb_stdlog, _("Try: %s%.2s%.38s\"\n"), ++ "zypper install -C \"debuginfo(build-id)=", ++ p - 2, p + 1); + } } } + +base-commit: 91ac179279557e27e6a149cbb78e4052a348f109 +-- +2.35.3 + diff --git a/gdb-6.6-buildid-locate-rpm.patch b/gdb-6.6-buildid-locate-rpm.patch index 1a82b8e..9e70b28 100644 --- a/gdb-6.6-buildid-locate-rpm.patch +++ b/gdb-6.6-buildid-locate-rpm.patch @@ -1,6 +1,6 @@ From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 +From: Kevin Buettner +Date: Wed, 22 Feb 2023 22:30:40 -0700 Subject: gdb-6.6-buildid-locate-rpm.patch ;;=push+jan @@ -232,6 +232,40 @@ diff --git a/gdb/aclocal.m4 b/gdb/aclocal.m4 # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2017 Free Software Foundation, Inc. +diff --git a/gdb/build-id.c b/gdb/build-id.c +--- a/gdb/build-id.c ++++ b/gdb/build-id.c +@@ -771,10 +771,10 @@ missing_rpm_enlist_1 (const char *filename, int verify_vendor) + static rpmts (*rpmtsCreate_p) (void); + extern rpmts rpmtsFree(rpmts ts); + static rpmts (*rpmtsFree_p) (rpmts ts); +- extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag, ++ extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmDbiTagVal rpmtag, + const void * keyp, size_t keylen); + static rpmdbMatchIterator (*rpmtsInitIterator_p) (const rpmts ts, +- rpmTag rpmtag, ++ rpmDbiTagVal rpmtag, + const void *keyp, + size_t keylen); + #else /* !DLOPEN_LIBRPM */ +@@ -829,7 +829,7 @@ missing_rpm_enlist_1 (const char *filename, int verify_vendor) + && (rpmdbNextIterator_p = (Header (*) (rpmdbMatchIterator mi)) dlsym (h, "rpmdbNextIterator")) + && (rpmtsCreate_p = (rpmts (*) (void)) dlsym (h, "rpmtsCreate")) + && (rpmtsFree_p = (rpmts (*) (rpmts ts)) dlsym (h, "rpmtsFree")) +- && (rpmtsInitIterator_p = (rpmdbMatchIterator (*) (const rpmts ts, rpmTag rpmtag, const void *keyp, size_t keylen)) dlsym (h, "rpmtsInitIterator")))) ++ && (rpmtsInitIterator_p = (rpmdbMatchIterator (*) (const rpmts ts, rpmDbiTagVal rpmtag, const void *keyp, size_t keylen)) dlsym (h, "rpmtsInitIterator")))) + { + warning (_("Opened library \"%s\" is incompatible (%s), " + "missing debuginfos notifications will not be displayed"), +@@ -917,7 +917,7 @@ missing_rpm_enlist_1 (const char *filename, int verify_vendor) + + /* RPMDBI_PACKAGES requires keylen == sizeof (int). */ + /* RPMDBI_LABEL is an interface for NVR-based dbiFindByLabel(). */ +- mi_debuginfo = rpmtsInitIterator_p (ts, (rpmTag) RPMDBI_LABEL, debuginfo, 0); ++ mi_debuginfo = rpmtsInitIterator_p (ts, (rpmDbiTagVal) RPMDBI_LABEL, debuginfo, 0); + xfree (debuginfo); + if (mi_debuginfo) + { diff --git a/gdb/config.in b/gdb/config.in --- a/gdb/config.in +++ b/gdb/config.in @@ -258,7 +292,7 @@ diff --git a/gdb/config.in b/gdb/config.in diff --git a/gdb/configure b/gdb/configure --- a/gdb/configure +++ b/gdb/configure -@@ -775,6 +775,11 @@ TARGET_OBS +@@ -783,6 +783,11 @@ TARGET_OBS ENABLE_BFD_64_BIT_FALSE ENABLE_BFD_64_BIT_TRUE subdirs @@ -270,7 +304,7 @@ diff --git a/gdb/configure b/gdb/configure GDB_DATADIR DEBUGDIR MAKEINFO_EXTRA_FLAGS -@@ -880,6 +885,7 @@ with_gdb_datadir +@@ -912,6 +917,7 @@ with_gdb_datadir with_relocated_sources with_auto_load_dir with_auto_load_safe_path @@ -278,7 +312,7 @@ diff --git a/gdb/configure b/gdb/configure enable_targets enable_64_bit_bfd enable_gdbmi -@@ -959,6 +965,8 @@ PKG_CONFIG_PATH +@@ -992,6 +998,8 @@ PKG_CONFIG_PATH PKG_CONFIG_LIBDIR DEBUGINFOD_CFLAGS DEBUGINFOD_LIBS @@ -286,8 +320,8 @@ diff --git a/gdb/configure b/gdb/configure +RPM_LIBS YACC YFLAGS - XMKMF' -@@ -1635,6 +1643,8 @@ Optional Packages: + ZSTD_CFLAGS +@@ -1678,6 +1686,8 @@ Optional Packages: do not restrict auto-loaded files locations --with-debuginfod Enable debuginfo lookups with debuginfod (auto/yes/no) @@ -296,7 +330,7 @@ diff --git a/gdb/configure b/gdb/configure --with-libunwind-ia64 use libunwind frame unwinding for ia64 targets --with-curses use the curses library instead of the termcap library -@@ -1715,6 +1725,8 @@ Some influential environment variables: +@@ -1761,6 +1771,8 @@ Some influential environment variables: C compiler flags for DEBUGINFOD, overriding pkg-config DEBUGINFOD_LIBS linker flags for DEBUGINFOD, overriding pkg-config @@ -305,7 +339,7 @@ diff --git a/gdb/configure b/gdb/configure YACC The `Yet Another Compiler Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. -@@ -6634,6 +6646,494 @@ _ACEOF +@@ -17848,6 +17860,494 @@ _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_auto_load_safe_path" >&5 $as_echo "$with_auto_load_safe_path" >&6; } @@ -485,7 +519,7 @@ diff --git a/gdb/configure b/gdb/configure +extern Header rpmdbNextIterator(rpmdbMatchIterator mi); +extern rpmts rpmtsCreate(void); +extern rpmts rpmtsFree(rpmts ts); -+extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag, ++extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmDbiTagVal rpmtag, + const void * keyp, size_t keylen); + +int @@ -747,7 +781,7 @@ diff --git a/gdb/configure b/gdb/configure +extern Header rpmdbNextIterator(rpmdbMatchIterator mi); +extern rpmts rpmtsCreate(void); +extern rpmts rpmtsFree(rpmts ts); -+extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag, ++extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmDbiTagVal rpmtag, + const void * keyp, size_t keylen); + +int @@ -803,7 +837,7 @@ diff --git a/gdb/configure b/gdb/configure diff --git a/gdb/configure.ac b/gdb/configure.ac --- a/gdb/configure.ac +++ b/gdb/configure.ac -@@ -153,6 +153,199 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escape_dir, +@@ -160,6 +160,199 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escape_dir, [Directories safe to hold auto-loaded files.]) AC_MSG_RESULT([$with_auto_load_safe_path]) @@ -947,7 +981,7 @@ diff --git a/gdb/configure.ac b/gdb/configure.ac +extern Header rpmdbNextIterator(rpmdbMatchIterator mi); +extern rpmts rpmtsCreate(void); +extern rpmts rpmtsFree(rpmts ts); -+extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag, ++extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmDbiTagVal rpmtag, + const void * keyp, size_t keylen); + ]]), [ + LIBRPM_COMPAT=true @@ -1006,15 +1040,15 @@ diff --git a/gdb/configure.ac b/gdb/configure.ac diff --git a/gdb/event-top.c b/gdb/event-top.c --- a/gdb/event-top.c +++ b/gdb/event-top.c -@@ -42,6 +42,7 @@ - #include "gdbsupport/gdb-sigmask.h" +@@ -43,6 +43,7 @@ #include "async-event.h" #include "bt-utils.h" + #include "pager.h" +#include "symfile.h" /* readline include files. */ #include "readline/readline.h" -@@ -374,6 +375,8 @@ display_gdb_prompt (const char *new_prompt) +@@ -391,6 +392,8 @@ display_gdb_prompt (const char *new_prompt) /* Reset the nesting depth used when trace-commands is set. */ reset_command_nest_depth (); @@ -1023,7 +1057,7 @@ diff --git a/gdb/event-top.c b/gdb/event-top.c /* Do not call the python hook on an explicit prompt change as passed to this function, as this forms a secondary/local prompt, IE, displayed but not set. */ -@@ -800,7 +803,10 @@ command_line_handler (gdb::unique_xmalloc_ptr &&rl) +@@ -852,7 +855,10 @@ command_line_handler (gdb::unique_xmalloc_ptr &&rl) command_handler (cmd); if (ui->prompt_state != PROMPTED) @@ -1038,7 +1072,7 @@ diff --git a/gdb/event-top.c b/gdb/event-top.c diff --git a/gdb/symfile.h b/gdb/symfile.h --- a/gdb/symfile.h +++ b/gdb/symfile.h -@@ -342,6 +342,7 @@ extern void generic_load (const char *args, int from_tty); +@@ -352,6 +352,7 @@ extern void generic_load (const char *args, int from_tty); /* build-id support. */ extern struct bfd_build_id *build_id_addr_get (CORE_ADDR addr); extern void debug_print_missing (const char *binary, const char *debug); diff --git a/gdb-6.6-buildid-locate-solib-missing-ids.patch b/gdb-6.6-buildid-locate-solib-missing-ids.patch index f357444..35254aa 100644 --- a/gdb-6.6-buildid-locate-solib-missing-ids.patch +++ b/gdb-6.6-buildid-locate-solib-missing-ids.patch @@ -14,7 +14,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1339862 diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c -@@ -1250,14 +1250,28 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm, +@@ -1321,14 +1321,28 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm, } { @@ -45,7 +45,7 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c if (build_id != NULL) { char *name, *build_id_filename; -@@ -1272,23 +1286,7 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm, +@@ -1343,23 +1357,7 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm, xfree (name); } else diff --git a/gdb-6.6-buildid-locate.patch b/gdb-6.6-buildid-locate.patch index 8b516a8..7d5cc16 100644 --- a/gdb-6.6-buildid-locate.patch +++ b/gdb-6.6-buildid-locate.patch @@ -21,7 +21,7 @@ diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h diff --git a/bfd/libbfd.h b/bfd/libbfd.h --- a/bfd/libbfd.h +++ b/bfd/libbfd.h -@@ -120,7 +120,7 @@ static inline char * +@@ -121,7 +121,7 @@ static inline char * bfd_strdup (const char *str) { size_t len = strlen (str) + 1; @@ -59,8 +59,8 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c +show_build_id_verbose (struct ui_file *file, int from_tty, + struct cmd_list_element *c, const char *value) +{ -+ fprintf_filtered (file, _("Verbosity level of the build-id locator is %s.\n"), -+ value); ++ gdb_printf (file, _("Verbosity level of the build-id locator is %s.\n"), ++ value); +} +/* Locate NT_GNU_BUILD_ID and return its matching debug filename. + FIXME: NOTE decoding should be unified with the BFD core notes decoding. */ @@ -517,9 +517,9 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c + if (separate_debug_file_debug) { -- fprintf_unfiltered (gdb_stdlog, _(" Trying %s..."), link.c_str ()); +- gdb_printf (gdb_stdlog, _(" Trying %s..."), link.c_str ()); - gdb_flush (gdb_stdlog); -+ fprintf_unfiltered (gdb_stdlog, _(" Trying %s..."), orig_link.c_str ()); ++ gdb_printf (gdb_stdlog, _(" Trying %s..."), orig_link.c_str ()); + gdb_flush (gdb_stdout); } @@ -539,8 +539,8 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c - if (filename == NULL) - { - if (separate_debug_file_debug) -- fprintf_unfiltered (gdb_stdlog, -- _(" no, unable to compute real path\n")); +- gdb_printf (gdb_stdlog, +- _(" no, unable to compute real path\n")); + if (seqno > 0) + { + /* There can be multiple build-id symlinks pointing to real files @@ -559,7 +559,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c - if (debug_bfd == NULL) - { - if (separate_debug_file_debug) -- fprintf_unfiltered (gdb_stdlog, _(" no, unable to open.\n")); +- gdb_printf (gdb_stdlog, _(" no, unable to open.\n")); + struct stat statbuf_trash; + + /* `access' automatically dereferences LINK. */ @@ -583,7 +583,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c + if (filename == NULL) + { + if (separate_debug_file_debug) -+ fprintf_unfiltered (gdb_stdlog, ++ gdb_printf (gdb_stdlog, + _(" no, unable to compute real path\n")); + + continue; @@ -595,7 +595,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c + if (debug_bfd == NULL) + { + if (separate_debug_file_debug) -+ fprintf_unfiltered (gdb_stdlog, _(" no, unable to open.\n")); ++ gdb_printf (gdb_stdlog, _(" no, unable to open.\n")); - return {}; + continue; @@ -604,8 +604,8 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c + if (!build_id_verify (debug_bfd.get(), build_id_len, build_id)) + { + if (separate_debug_file_debug) -+ fprintf_unfiltered (gdb_stdlog, -+ _(" no, build-id does not match.\n")); ++ gdb_printf (gdb_stdlog, ++ _(" no, build-id does not match.\n")); + + continue; + } @@ -620,8 +620,8 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c + if (ret_bfd != NULL) { if (separate_debug_file_debug) -- fprintf_unfiltered (gdb_stdlog, _(" no, build-id does not match.\n")); -+ fprintf_unfiltered (gdb_stdlog, _(" yes!\n")); +- gdb_printf (gdb_stdlog, _(" no, build-id does not match.\n")); ++ gdb_printf (gdb_stdlog, _(" yes!\n")); + } + else + { @@ -646,7 +646,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c } - if (separate_debug_file_debug) -- fprintf_unfiltered (gdb_stdlog, _(" yes!\n")); +- gdb_printf (gdb_stdlog, _(" yes!\n")); + if (link_return != NULL) + { + if (ret_bfd != NULL) @@ -694,17 +694,16 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c if (debug_bfd != NULL) return debug_bfd; -@@ -174,7 +678,8 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id, +@@ -174,7 +678,7 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id, if (!gdb_sysroot.empty ()) { link = gdb_sysroot + link; - debug_bfd = build_id_to_debug_bfd_1 (link, build_id_len, build_id); -+ debug_bfd = build_id_to_debug_bfd_1 (link, build_id_len, build_id, -+ link_return); ++ debug_bfd = build_id_to_debug_bfd_1 (link, build_id_len, build_id, NULL); if (debug_bfd != NULL) return debug_bfd; } -@@ -183,30 +688,649 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id, +@@ -183,30 +687,655 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id, return {}; } @@ -1095,20 +1094,26 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c + debug_flush_missing -> missing_rpm_list_print ... + + For this reason, we make sure MISSING_RPM_LIST_ENTRIES is zero -+ *before* calling any print function. */ ++ *before* calling any print function. ++ ++ Note: kevinb/2023-02-22: The code below used to call ++ puts_unfiltered() and printf_unfiltered(), but calls to these ++ functions have been replaced by calls to gdb_printf(). The call ++ chain shown above (probably) used to be the case at one time and ++ hopefully something similar is still the case now that ++ gdb_printf() is being used instead. */ + missing_rpm_list_entries = 0; + -+ printf_unfiltered (_("Missing separate debuginfos, use: %s"), ++ gdb_printf (_("Missing separate debuginfos, use: %s"), +#ifdef DNF_DEBUGINFO_INSTALL + "dnf " +#endif + "debuginfo-install"); + for (const char *el : array) + { -+ puts_unfiltered (" "); -+ puts_unfiltered (el); ++ gdb_printf (" %s", el); + } -+ puts_unfiltered ("\n"); ++ gdb_printf ("\n"); + + while (missing_rpm_list != NULL) + { @@ -1307,10 +1312,10 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c + /* We do not collect and flush these messages as each such message + already requires its own separate lines. */ + -+ fprintf_unfiltered (gdb_stdlog, -+ _("Missing separate debuginfo for %s\n"), binary); ++ gdb_printf (gdb_stdlog, ++ _("Missing separate debuginfo for %s\n"), binary); + if (debug != NULL) -+ fprintf_unfiltered (gdb_stdlog, _("Try: %s %s\n"), ++ gdb_printf (gdb_stdlog, _("Try: %s %s\n"), +#ifdef DNF_DEBUGINFO_INSTALL + "dnf" +#else @@ -1352,17 +1357,17 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c { const struct bfd_build_id *build_id; -- build_id = build_id_bfd_get (objfile->obfd); +- build_id = build_id_bfd_get (objfile->obfd.get ()); + if (build_id_filename_return) + *build_id_filename_return = NULL; + -+ build_id = build_id_bfd_shdr_get (objfile->obfd); ++ build_id = build_id_bfd_shdr_get (objfile->obfd.get ()); if (build_id != NULL) { if (separate_debug_file_debug) -@@ -214,8 +1338,21 @@ find_separate_debug_file_by_buildid (struct objfile *objfile) - _("\nLooking for separate debug info (build-id) for " - "%s\n"), objfile_name (objfile)); +@@ -214,8 +1343,21 @@ find_separate_debug_file_by_buildid (struct objfile *objfile) + _("\nLooking for separate debug info (build-id) for " + "%s\n"), objfile_name (objfile)); + char *build_id_filename_cstr = NULL; gdb_bfd_ref_ptr abfd (build_id_to_debug_bfd (build_id->size, @@ -1383,7 +1388,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c /* Prevent looping on a stripped .debug file. */ if (abfd != NULL && filename_cmp (bfd_get_filename (abfd.get ()), -@@ -228,3 +1365,22 @@ find_separate_debug_file_by_buildid (struct objfile *objfile) +@@ -228,3 +1370,22 @@ find_separate_debug_file_by_buildid (struct objfile *objfile) return std::string (); } @@ -1456,7 +1461,7 @@ diff --git a/gdb/build-id.h b/gdb/build-id.h diff --git a/gdb/coffread.c b/gdb/coffread.c --- a/gdb/coffread.c +++ b/gdb/coffread.c -@@ -710,7 +710,8 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) +@@ -734,7 +734,8 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) /* Try to add separate debug file if no symbols table found. */ if (!objfile->has_partial_symbols ()) { @@ -1480,7 +1485,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c #include "inferior.h" #include "infrun.h" #include "symtab.h" -@@ -356,6 +360,8 @@ add_to_thread_list (asection *asect, asection *reg_sect) +@@ -391,6 +395,8 @@ add_to_thread_list (asection *asect, asection *reg_sect) switch_to_thread (thr); /* Yes, make it current. */ } @@ -1489,7 +1494,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c /* Issue a message saying we have no core to debug, if FROM_TTY. */ static void -@@ -392,19 +398,26 @@ core_file_command (const char *filename, int from_tty) +@@ -427,12 +433,14 @@ core_file_command (const char *filename, int from_tty) static void locate_exec_from_corefile_build_id (bfd *abfd, int from_tty) { @@ -1504,8 +1509,9 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c + = build_id_to_exec_bfd (build_id->size, build_id->data, + &build_id_filename); - if (execbfd != nullptr) + if (execbfd == nullptr) { +@@ -460,7 +468,12 @@ locate_exec_from_corefile_build_id (bfd *abfd, int from_tty) exec_file_attach (bfd_get_filename (execbfd.get ()), from_tty); symbol_file_add_main (bfd_get_filename (execbfd.get ()), symfile_add_flag (from_tty ? SYMFILE_VERBOSE : 0)); @@ -1518,7 +1524,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c } /* See gdbcore.h. */ -@@ -1209,4 +1222,11 @@ _initialize_corelow () +@@ -1325,4 +1338,11 @@ _initialize_corelow () maintenance_print_core_file_backed_mappings, _("Print core file's file-backed mappings."), &maintenanceprintlist); @@ -1533,7 +1539,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo -@@ -21524,6 +21524,27 @@ information files. +@@ -22037,6 +22037,27 @@ information files. @end table @@ -1564,16 +1570,16 @@ diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo diff --git a/gdb/dwarf2/index-cache.c b/gdb/dwarf2/index-cache.c --- a/gdb/dwarf2/index-cache.c +++ b/gdb/dwarf2/index-cache.c -@@ -97,7 +97,7 @@ index_cache::store (dwarf2_per_objfile *per_objfile) +@@ -101,7 +101,7 @@ index_cache::store (dwarf2_per_objfile *per_objfile) return; /* Get build id of objfile. */ -- const bfd_build_id *build_id = build_id_bfd_get (obj->obfd); -+ const bfd_build_id *build_id = build_id_bfd_shdr_get (obj->obfd); +- const bfd_build_id *build_id = build_id_bfd_get (obj->obfd.get ()); ++ const bfd_build_id *build_id = build_id_bfd_shdr_get (obj->obfd.get ()); if (build_id == nullptr) { index_cache_debug ("objfile %s has no build id", -@@ -114,7 +114,8 @@ index_cache::store (dwarf2_per_objfile *per_objfile) +@@ -118,7 +118,8 @@ index_cache::store (dwarf2_per_objfile *per_objfile) if (dwz != nullptr) { @@ -1586,16 +1592,16 @@ diff --git a/gdb/dwarf2/index-cache.c b/gdb/dwarf2/index-cache.c diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c -@@ -5476,7 +5476,7 @@ get_gdb_index_contents_from_section (objfile *obj, T *section_owner) +@@ -5328,7 +5328,7 @@ get_gdb_index_contents_from_section (objfile *obj, T *section_owner) static gdb::array_view get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_bfd *dwarf2_per_bfd) { -- const bfd_build_id *build_id = build_id_bfd_get (obj->obfd); -+ const bfd_build_id *build_id = build_id_bfd_shdr_get (obj->obfd); +- const bfd_build_id *build_id = build_id_bfd_get (obj->obfd.get ()); ++ const bfd_build_id *build_id = build_id_bfd_shdr_get (obj->obfd.get ()); if (build_id == nullptr) return {}; -@@ -5489,7 +5489,7 @@ get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_bfd *dwarf2_per_bfd) +@@ -5341,7 +5341,7 @@ get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_bfd *dwarf2_per_bfd) static gdb::array_view get_gdb_index_contents_from_cache_dwz (objfile *obj, dwz_file *dwz) { @@ -1607,7 +1613,7 @@ diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c diff --git a/gdb/elfread.c b/gdb/elfread.c --- a/gdb/elfread.c +++ b/gdb/elfread.c -@@ -1270,7 +1270,9 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) +@@ -1213,7 +1213,9 @@ elf_symfile_read_dwarf2 (struct objfile *objfile, && objfile->separate_debug_objfile == NULL && objfile->separate_debug_objfile_backlink == NULL) { @@ -1618,21 +1624,22 @@ diff --git a/gdb/elfread.c b/gdb/elfread.c if (debugfile.empty ()) debugfile = find_separate_debug_file_by_debuglink (objfile); -@@ -1285,7 +1287,7 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) - else +@@ -1229,7 +1231,7 @@ elf_symfile_read_dwarf2 (struct objfile *objfile, { has_dwarf2 = false; -- const struct bfd_build_id *build_id = build_id_bfd_get (objfile->obfd); -+ const struct bfd_build_id *build_id = build_id_bfd_shdr_get (objfile->obfd); + const struct bfd_build_id *build_id +- = build_id_bfd_get (objfile->obfd.get ()); ++ = build_id_bfd_shdr_get (objfile->obfd.get ()); + const char *filename = bfd_get_filename (objfile->obfd.get ()); if (build_id != nullptr) - { -@@ -1310,6 +1312,10 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) +@@ -1256,6 +1258,11 @@ elf_symfile_read_dwarf2 (struct objfile *objfile, has_dwarf2 = true; } } + /* Check if any separate debug info has been extracted out. */ -+ else if (bfd_get_section_by_name (objfile->obfd, ".gnu_debuglink") ++ else if (bfd_get_section_by_name (objfile->obfd.get (), ++ ".gnu_debuglink") + != NULL) + debug_print_missing (objfile_name (objfile), build_id_filename.get ()); } @@ -1641,7 +1648,7 @@ diff --git a/gdb/elfread.c b/gdb/elfread.c diff --git a/gdb/exec.c b/gdb/exec.c --- a/gdb/exec.c +++ b/gdb/exec.c -@@ -238,7 +238,7 @@ validate_exec_file (int from_tty) +@@ -237,7 +237,7 @@ validate_exec_file (int from_tty) current_exec_file = get_exec_file (0); const bfd_build_id *exec_file_build_id @@ -1650,7 +1657,7 @@ diff --git a/gdb/exec.c b/gdb/exec.c if (exec_file_build_id != nullptr) { /* Prepend the target prefix, to force gdb_bfd_open to open the -@@ -251,7 +251,7 @@ validate_exec_file (int from_tty) +@@ -250,7 +250,7 @@ validate_exec_file (int from_tty) if (abfd != nullptr) { const bfd_build_id *target_exec_file_build_id @@ -1662,7 +1669,7 @@ diff --git a/gdb/exec.c b/gdb/exec.c diff --git a/gdb/objfiles.h b/gdb/objfiles.h --- a/gdb/objfiles.h +++ b/gdb/objfiles.h -@@ -769,6 +769,10 @@ struct objfile +@@ -786,6 +786,10 @@ struct objfile bool skip_jit_symbol_lookup = false; }; @@ -1676,24 +1683,24 @@ diff --git a/gdb/objfiles.h b/gdb/objfiles.h diff --git a/gdb/python/py-objfile.c b/gdb/python/py-objfile.c --- a/gdb/python/py-objfile.c +++ b/gdb/python/py-objfile.c -@@ -132,7 +132,7 @@ objfpy_get_build_id (PyObject *self, void *closure) +@@ -158,7 +158,7 @@ objfpy_get_build_id (PyObject *self, void *closure) try { -- build_id = build_id_bfd_get (objfile->obfd); -+ build_id = build_id_bfd_shdr_get (objfile->obfd); +- build_id = build_id_bfd_get (objfile->obfd.get ()); ++ build_id = build_id_bfd_shdr_get (objfile->obfd.get ()); } catch (const gdb_exception &except) { -@@ -600,7 +600,7 @@ objfpy_lookup_objfile_by_build_id (const char *build_id) - /* Don't return separate debug files. */ - if (objfile->separate_debug_objfile_backlink != NULL) - continue; -- obfd_build_id = build_id_bfd_get (objfile->obfd); -+ obfd_build_id = build_id_bfd_shdr_get (objfile->obfd); - if (obfd_build_id == NULL) - continue; - if (objfpy_build_id_matches (obfd_build_id, build_id)) +@@ -629,7 +629,7 @@ gdbpy_lookup_objfile (PyObject *self, PyObject *args, PyObject *kw) + if (obfd == nullptr) + return 0; + +- const bfd_build_id *obfd_build_id = build_id_bfd_get (obfd); ++ const bfd_build_id *obfd_build_id = build_id_bfd_shdr_get (obfd); + if (obfd_build_id == nullptr) + return 0; + diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -1703,9 +1710,9 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c #include "probe.h" +#include "build-id.h" - static struct link_map_offsets *svr4_fetch_link_map_offsets (void); - static int svr4_have_link_map_offsets (void); -@@ -1248,9 +1249,51 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm, + #include + +@@ -1319,9 +1320,51 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm, continue; } @@ -1763,19 +1770,19 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c diff --git a/gdb/source.c b/gdb/source.c --- a/gdb/source.c +++ b/gdb/source.c -@@ -1199,7 +1199,7 @@ open_source_file (struct symtab *s) - srcpath += s->filename; +@@ -1196,7 +1196,7 @@ open_source_file (struct symtab *s) } -- const struct bfd_build_id *build_id = build_id_bfd_get (ofp->obfd); -+ const struct bfd_build_id *build_id = build_id_bfd_shdr_get (ofp->obfd); + const struct bfd_build_id *build_id +- = build_id_bfd_get (ofp->obfd.get ()); ++ = build_id_bfd_shdr_get (ofp->obfd.get ()); /* Query debuginfod for the source file. */ if (build_id != nullptr && !srcpath.empty ()) diff --git a/gdb/symfile.h b/gdb/symfile.h --- a/gdb/symfile.h +++ b/gdb/symfile.h -@@ -332,12 +332,18 @@ bool expand_symtabs_matching +@@ -342,12 +342,18 @@ bool expand_symtabs_matching void map_symbol_filenames (gdb::function_view fun, bool need_fullname); @@ -1797,7 +1804,7 @@ diff --git a/gdb/symfile.h b/gdb/symfile.h diff --git a/gdb/testsuite/gdb.base/corefile.exp b/gdb/testsuite/gdb.base/corefile.exp --- a/gdb/testsuite/gdb.base/corefile.exp +++ b/gdb/testsuite/gdb.base/corefile.exp -@@ -343,3 +343,33 @@ gdb_test_multiple "core-file $corefile" $test { +@@ -349,3 +349,33 @@ gdb_test_multiple "core-file $corefile" $test { pass $test } } @@ -1858,17 +1865,17 @@ diff --git a/gdb/testsuite/gdb.base/new-ui-pending-input.exp b/gdb/testsuite/gdb diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp -@@ -141,7 +141,8 @@ if ![info exists INTERNAL_GDBFLAGS] { +@@ -217,7 +217,8 @@ if ![info exists INTERNAL_GDBFLAGS] { + "-nw" \ "-nx" \ - "-data-directory $BUILD_DATA_DIRECTORY" \ {-iex "set height 0"} \ - {-iex "set width 0"}]] + {-iex "set width 0"} \ + {-iex "set build-id-verbose 0"}]] - } - # The variable gdb_prompt is a regexp which matches the gdb prompt. -@@ -2200,6 +2201,17 @@ proc default_gdb_start { } { + set INTERNAL_GDBFLAGS [append_gdb_data_directory_option $INTERNAL_GDBFLAGS] + } +@@ -2349,6 +2350,17 @@ proc default_gdb_start { } { } } @@ -1889,7 +1896,7 @@ diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp --- a/gdb/testsuite/lib/mi-support.exp +++ b/gdb/testsuite/lib/mi-support.exp -@@ -322,6 +322,16 @@ proc default_mi_gdb_start { args } { +@@ -330,6 +330,16 @@ proc default_mi_gdb_start { { flags {} } } { warning "Couldn't set the width to 0." } } diff --git a/gdb-6.6-bz230000-power6-disassembly-test.patch b/gdb-6.6-bz230000-power6-disassembly-test.patch deleted file mode 100644 index 5b7ba1d..0000000 --- a/gdb-6.6-bz230000-power6-disassembly-test.patch +++ /dev/null @@ -1,94 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-6.6-bz230000-power6-disassembly-test.patch - -;; Testcase for PPC Power6/DFP instructions disassembly (BZ 230000). -;;=fedoratest - -https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=230000 - -The original testcase - https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=230000#c1 -requires too recent GCC. - -diff --git a/gdb/testsuite/gdb.arch/powerpc-power6.exp b/gdb/testsuite/gdb.arch/powerpc-power6.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/powerpc-power6.exp -@@ -0,0 +1,54 @@ -+# Copyright 2007 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 PowerPC Power6 instructions disassembly. -+ -+if {![istarget "powerpc*-*-*"]} then { -+ verbose "Skipping PowerPC Power6 instructions disassembly." -+ return -+} -+ -+set testfile "powerpc-power6" -+set srcfile ${testfile}.s -+set objfile [standard_output_file ${testfile}.o] -+ -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {debug}] != "" } { -+ untested "PowerPC prologue tests" -+ return -1 -+} -+ -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${objfile} -+ -+# Disassemble the function. -+ -+gdb_test "disass func" ":\tblr\r\n.*" "Basic disassembly" -+ -+gdb_test "disass func" ":\tdcbzl *r8,r9\r\n.*" "Power5 disassembly dcbzl" -+gdb_test "disass func" ":\tfrsqrtes *f10,f11\r\n.*" "Power5 disassembly frsqrtes" -+gdb_test "disass func" ":\tdadd *f1,f2,f1\r\n.*" "Power6 disassembly dadd" -+gdb_test "disass func" ":\tdaddq *f0,f2,f0\r\n.*" "Power6 disassembly daddq" -+gdb_test "disass func" ":\tdsub *f1,f2,f1\r\n.*" "Power6 disassembly dsub" -+gdb_test "disass func" ":\tdsubq *f0,f2,f0\r\n.*" "Power6 disassembly dsubq" -+gdb_test "disass func" ":\tdmul *f1,f2,f1\r\n.*" "Power6 disassembly dmul" -+gdb_test "disass func" ":\tdmulq *f0,f2,f0\r\n.*" "Power6 disassembly dmulq" -+gdb_test "disass func" ":\tddiv *f1,f2,f1\r\n.*" "Power6 disassembly ddiv" -+gdb_test "disass func" ":\tddivq *f0,f2,f0\r\n.*" "Power6 disassembly ddivq" -+gdb_test "disass func" ":\tdcmpu *cr1,f2,f1\r\n.*" "Power6 disassembly dcmpu" -+gdb_test "disass func" ":\tdcmpuq *cr1,f2,f0\r\n.*" "Power6 disassembly dcmpuq" -diff --git a/gdb/testsuite/gdb.arch/powerpc-power6.s b/gdb/testsuite/gdb.arch/powerpc-power6.s -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/powerpc-power6.s -@@ -0,0 +1,16 @@ -+ .text -+ .globl func -+func: -+ blr -+ .long 0x7c284fec /* dcbzl r8,r9 */ -+ .long 0xed405834 /* frsqrtes f10,f11 */ -+ .long 0xec220804 /* dadd f1,f2,f1 */ -+ .long 0xfc020004 /* daddq f0,f2,f0 */ -+ .long 0xec220c04 /* dsub f1,f2,f1 */ -+ .long 0xfc020404 /* dsubq f0,f2,f0 */ -+ .long 0xec220844 /* dmul f1,f2,f1 */ -+ .long 0xfc020044 /* dmulq f0,f2,f0 */ -+ .long 0xec220c44 /* ddiv f1,f2,f1 */ -+ .long 0xfc020444 /* ddivq f0,f2,f0 */ -+ .long 0xec820d04 /* dcmpu cr1,f2,f1 */ -+ .long 0xfc820504 /* dcmpuq cr1,f2,f0 */ diff --git a/gdb-6.7-testsuite-stable-results.patch b/gdb-6.7-testsuite-stable-results.patch index e4370c4..5a74c1b 100644 --- a/gdb-6.7-testsuite-stable-results.patch +++ b/gdb-6.7-testsuite-stable-results.patch @@ -72,7 +72,7 @@ diff --git a/gdb/testsuite/gdb.base/fileio.exp b/gdb/testsuite/gdb.base/fileio.e } if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ -@@ -47,7 +47,8 @@ set dir2 [standard_output_file dir2.fileio.test] +@@ -40,7 +40,8 @@ set dir2 [standard_output_file dir2.fileio.test] if {[file exists $dir2] && ![file writable $dir2]} { system "chmod +w $dir2" } @@ -82,7 +82,7 @@ diff --git a/gdb/testsuite/gdb.base/fileio.exp b/gdb/testsuite/gdb.base/fileio.e set oldtimeout $timeout set timeout [expr "$timeout + 60"] -@@ -89,7 +90,7 @@ gdb_test continue \ +@@ -81,7 +82,7 @@ gdb_test continue \ gdb_test "continue" ".*" "" @@ -91,7 +91,7 @@ diff --git a/gdb/testsuite/gdb.base/fileio.exp b/gdb/testsuite/gdb.base/fileio.e gdb_test continue \ "Continuing\\..*open 5:.*EACCES$stop_msg" \ -@@ -276,9 +277,7 @@ gdb_test continue \ +@@ -268,9 +269,7 @@ gdb_test continue \ gdb_exit # Make dir2 writable again so rm -rf of a build tree Just Works. diff --git a/gdb-add-gdb-syscalls-makefile.patch b/gdb-add-gdb-syscalls-makefile.patch deleted file mode 100644 index a070ccb..0000000 --- a/gdb-add-gdb-syscalls-makefile.patch +++ /dev/null @@ -1,374 +0,0 @@ -[gdb] Add gdb/syscalls/Makefile - -Add a Makefile in gdb/syscalls that can be used to translate -gdb/syscalls/*.xml.in into gdb/syscalls/*.xml. - -Calling make reveals that bfin-linux.xml is missing, so add it. - -Tested on x86_64-linux. - ---- - gdb/syscalls/Makefile | 25 ++++ - gdb/syscalls/bfin-linux.xml | 323 ++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 348 insertions(+) - -diff --git a/gdb/syscalls/Makefile b/gdb/syscalls/Makefile -new file mode 100644 -index 00000000000..f9550f5a44d ---- /dev/null -+++ b/gdb/syscalls/Makefile -@@ -0,0 +1,25 @@ -+# Copyright (C) 2022 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 . -+ -+# Generate .xml files from .xml.in files. -+ -+FILES=$(shell ls *.xml.in | grep -v linux-defaults.xml.in | sed 's/\.in//') -+ -+all: -+ for f in $(FILES); do \ -+ xsltproc --output $$f apply-defaults.xsl $$f.in; \ -+ done -diff --git a/gdb/syscalls/bfin-linux.xml b/gdb/syscalls/bfin-linux.xml -new file mode 100644 -index 00000000000..e73923f8631 ---- /dev/null -+++ b/gdb/syscalls/bfin-linux.xml -@@ -0,0 +1,323 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ diff --git a/gdb-add-support-for-readline-8.2.patch b/gdb-add-support-for-readline-8.2.patch deleted file mode 100644 index e87c714..0000000 --- a/gdb-add-support-for-readline-8.2.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 1add37b567a7dee39d99f37b37802034c3fce9c4 Mon Sep 17 00:00:00 2001 -From: Andreas Schwab -Date: Sun, 20 Mar 2022 14:01:54 +0100 -Subject: [PATCH] Add support for readline 8.2 - -In readline 8.2 the type of rl_completer_word_break_characters changed to -include const. ---- - gdb/completer.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/gdb/completer.c b/gdb/completer.c -index d3900ae2014..a51c16ac7f8 100644 ---- a/gdb/completer.c -+++ b/gdb/completer.c -@@ -36,7 +36,7 @@ - calling a hook instead so we eliminate the CLI dependency. */ - #include "gdbcmd.h" - --/* Needed for rl_completer_word_break_characters() and for -+/* Needed for rl_completer_word_break_characters and for - rl_filename_completion_function. */ - #include "readline/readline.h" - -@@ -2011,7 +2011,7 @@ gdb_completion_word_break_characters_throw () - rl_basic_quote_characters = NULL; - } - -- return rl_completer_word_break_characters; -+ return (char *) rl_completer_word_break_characters; - } - - char * --- -2.31.1 - diff --git a/gdb-binutils29988-read_indexed_address.patch b/gdb-binutils29988-read_indexed_address.patch new file mode 100644 index 0000000..bd80776 --- /dev/null +++ b/gdb-binutils29988-read_indexed_address.patch @@ -0,0 +1,24 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Nick Clifton +Date: Wed, 11 Jan 2023 12:13:46 +0000 +Subject: gdb-binutils29988-read_indexed_address.patch + +;; Backport "Fix a potential illegal memory access in the BFD library..." +;; (Nick Clifton, binutils/29988) + + PR 29988 + * dwarf2.c (read_indexed_address): Fix check for an out of range + offset. + +diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c +--- a/bfd/dwarf2.c ++++ b/bfd/dwarf2.c +@@ -1412,7 +1412,7 @@ read_indexed_address (uint64_t idx, struct comp_unit *unit) + offset += unit->dwarf_addr_offset; + if (offset < unit->dwarf_addr_offset + || offset > file->dwarf_addr_size +- || file->dwarf_addr_size - offset < unit->offset_size) ++ || file->dwarf_addr_size - offset < unit->addr_size) + return 0; + + info_ptr = file->dwarf_addr_buffer + offset; diff --git a/gdb-bz601887-dwarf4-rh-test.patch b/gdb-bz601887-dwarf4-rh-test.patch deleted file mode 100644 index db30310..0000000 --- a/gdb-bz601887-dwarf4-rh-test.patch +++ /dev/null @@ -1,254 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-bz601887-dwarf4-rh-test.patch - -;; Backport DWARF-4 support (BZ 601887, Tom Tromey). -;;=fedoratest - -diff --git a/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.S b/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.S -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.S -@@ -0,0 +1,167 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2010 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 . */ -+ -+ .file "rh-dwarf4-x86_64.c" -+ .section .debug_abbrev,"",@progbits -+.Ldebug_abbrev0: -+ .section .debug_info,"",@progbits -+.Ldebug_info0: -+ .section .debug_line,"",@progbits -+.Ldebug_line0: -+ .text -+.Ltext0: -+.globl main -+ .type main, @function -+main: -+.LFB0: -+ .file 1 "gdb.dwarf2/rh-dwarf4-x86_64.c" -+ # gdb.dwarf2/rh-dwarf4-x86_64.c:20 -+ .loc 1 20 0 -+ .cfi_startproc -+ # basic block 2 -+ pushq %rbp -+ .cfi_def_cfa_offset 16 -+ movq %rsp, %rbp -+ .cfi_offset 6, -16 -+ .cfi_def_cfa_register 6 -+ # gdb.dwarf2/rh-dwarf4-x86_64.c:21 -+ .loc 1 21 0 -+ movl $0, %eax -+ # gdb.dwarf2/rh-dwarf4-x86_64.c:22 -+ .loc 1 22 0 -+ leave -+ .cfi_def_cfa 7, 8 -+ ret -+ .cfi_endproc -+.LFE0: -+ .size main, .-main -+.Letext0: -+ .section .debug_info -+ .long 0x4e # Length of Compilation Unit Info -+ .value 0x4 # DWARF version number -+ .long .Ldebug_abbrev0 # Offset Into Abbrev. Section -+ .byte 0x8 # Pointer Size (in bytes) -+ .uleb128 0x1 # (DIE (0xb) DW_TAG_compile_unit) -+ .long .LASF0 # DW_AT_producer: "GNU C 4.4.4 20100503 (Red Hat 4.4.4-2)" -+ .byte 0x1 # DW_AT_language -+ .long .LASF1 # DW_AT_name: "gdb.dwarf2/rh-dwarf4-x86_64.c" -+ .long .LASF2 # DW_AT_comp_dir -+ .quad .Ltext0 # DW_AT_low_pc -+ .quad .Letext0 # DW_AT_high_pc -+ .long .Ldebug_line0 # DW_AT_stmt_list -+ .uleb128 0x2 # (DIE (0x2d) DW_TAG_subprogram) -+ # DW_AT_external -+ .long .LASF3 # DW_AT_name: "main" -+ .byte 0x1 # DW_AT_decl_file (gdb.dwarf2/rh-dwarf4-x86_64.c) -+ .byte 0x13 # DW_AT_decl_line -+ # DW_AT_prototyped -+ .long 0x4a # DW_AT_type -+ .quad .LFB0 # DW_AT_low_pc -+ .quad .LFE0 # DW_AT_high_pc -+ .uleb128 0x1 # DW_AT_frame_base -+ .byte 0x9c # DW_OP_call_frame_cfa -+ .uleb128 0x3 # (DIE (0x4a) DW_TAG_base_type) -+ .byte 0x4 # DW_AT_byte_size -+ .byte 0x5 # DW_AT_encoding -+ .ascii "int\0" # DW_AT_name -+ .byte 0x0 # end of children of DIE 0xb -+ .section .debug_abbrev -+ .uleb128 0x1 # (abbrev code) -+ .uleb128 0x11 # (TAG: DW_TAG_compile_unit) -+ .byte 0x1 # DW_children_yes -+ .uleb128 0x25 # (DW_AT_producer) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x13 # (DW_AT_language) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x1b # (DW_AT_comp_dir) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x11 # (DW_AT_low_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x12 # (DW_AT_high_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x10 # (DW_AT_stmt_list) -+ .uleb128 0x17 # (DW_FORM_sec_offset) -+ .byte 0x0 -+ .byte 0x0 -+ .uleb128 0x2 # (abbrev code) -+ .uleb128 0x2e # (TAG: DW_TAG_subprogram) -+ .byte 0x0 # DW_children_no -+ .uleb128 0x3f # (DW_AT_external) -+ .uleb128 0x19 # (DW_FORM_flag_present) -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x3a # (DW_AT_decl_file) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3b # (DW_AT_decl_line) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x27 # (DW_AT_prototyped) -+ .uleb128 0x19 # (DW_FORM_flag_present) -+ .uleb128 0x49 # (DW_AT_type) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .uleb128 0x11 # (DW_AT_low_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x12 # (DW_AT_high_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x40 # (DW_AT_frame_base) -+ .uleb128 0x18 # (DW_FORM_exprloc) -+ .byte 0x0 -+ .byte 0x0 -+ .uleb128 0x3 # (abbrev code) -+ .uleb128 0x24 # (TAG: DW_TAG_base_type) -+ .byte 0x0 # DW_children_no -+ .uleb128 0xb # (DW_AT_byte_size) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3e # (DW_AT_encoding) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0x8 # (DW_FORM_string) -+ .byte 0x0 -+ .byte 0x0 -+ .byte 0x0 -+ .section .debug_pubnames,"",@progbits -+ .long 0x17 # Length of Public Names Info -+ .value 0x2 # DWARF Version -+ .long .Ldebug_info0 # Offset of Compilation Unit Info -+ .long 0x52 # Compilation Unit Length -+ .long 0x2d # DIE offset -+ .ascii "main\0" # external name -+ .long 0x0 -+ .section .debug_aranges,"",@progbits -+ .long 0x2c # Length of Address Ranges Info -+ .value 0x2 # DWARF Version -+ .long .Ldebug_info0 # Offset of Compilation Unit Info -+ .byte 0x8 # Size of Address -+ .byte 0x0 # Size of Segment Descriptor -+ .value 0x0 # Pad to 16 byte boundary -+ .value 0x0 -+ .quad .Ltext0 # Address -+ .quad .Letext0-.Ltext0 # Length -+ .quad 0x0 -+ .quad 0x0 -+ .section .debug_str,"MS",@progbits,1 -+.LASF2: -+ .string "." -+.LASF0: -+ .string "GNU C 4.4.4 20100503 (Red Hat 4.4.4-2)" -+.LASF1: -+ .string "gdb.dwarf2/rh-dwarf4-x86_64.c" -+.LASF3: -+ .string "main" -+ .ident "GCC: (GNU) 4.4.4 20100503 (Red Hat 4.4.4-2)" -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.c b/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.c -@@ -0,0 +1,22 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2010 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 . */ -+ -+int -+main (void) -+{ -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.exp b/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.exp -@@ -0,0 +1,42 @@ -+# Copyright 2010 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 . -+ -+# This test can only be run on targets which support DWARF-2 and use gas. -+# For now pick a sampling of likely targets. -+if {![istarget *-*-linux*] -+ && ![istarget *-*-gnu*] -+ && ![istarget *-*-elf*] -+ && ![istarget *-*-openbsd*] -+ && ![istarget arm-*-eabi*] -+ && ![istarget powerpc-*-eabi*]} { -+ return 0 -+} -+ -+if {![istarget x86_64-*]} { -+ return 0 -+} -+ -+set testfile "rh-dwarf4-x86_64" -+set srcfile ${testfile}.S -+set executable ${testfile}.x -+set binfile [standard_output_file ${executable}] -+ -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {}] != "" } { -+ return -1 -+} -+ -+clean_restart $executable -+ -+gdb_test "ptype main" {type = int \(void\)} diff --git a/gdb-ccache-workaround.patch b/gdb-ccache-workaround.patch index 8fc9c41..0c697b1 100644 --- a/gdb-ccache-workaround.patch +++ b/gdb-ccache-workaround.patch @@ -9,9 +9,9 @@ Subject: gdb-ccache-workaround.patch diff --git a/gdb/testsuite/gdb.base/macscp.exp b/gdb/testsuite/gdb.base/macscp.exp --- a/gdb/testsuite/gdb.base/macscp.exp +++ b/gdb/testsuite/gdb.base/macscp.exp -@@ -27,6 +27,14 @@ if { [test_compiler_info "gcc-*"] } { - lappend options additional_flags=-fdebug-macro - } +@@ -20,6 +20,14 @@ set objfile [standard_output_file ${testfile}.o] + + set options {debug macros additional_flags=-DFROM_COMMANDLINE=ARG} +# Workaround ccache making lineno non-zero for command-line definitions. +if {[find_gcc] == "gcc" && [file executable "/usr/bin/gcc"]} { diff --git a/gdb-cli-handle-pending-c-after-rl_callback_read_char.patch b/gdb-cli-handle-pending-c-after-rl_callback_read_char.patch new file mode 100644 index 0000000..44cc320 --- /dev/null +++ b/gdb-cli-handle-pending-c-after-rl_callback_read_char.patch @@ -0,0 +1,69 @@ +From 3f5ef7bf512c7565279832bad3d5c743e9d8ae4b Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Wed, 24 May 2023 10:53:02 +0200 +Subject: [PATCH 1/4] [gdb/cli] Handle pending ^C after rl_callback_read_char + for readline 7 + +In commit faf01aee1d0 ("[gdb] Handle pending ^C after rl_callback_read_char") +we handled a problem (described in detail in that commit) for readline >= 8 +using public readline functions rl_pending_signal and rl_check_signals. + +For readline 7 (note that we require at least readline 7 so there's no need to +worry about readline 6), there was no fix though, because rl_check_signals was +not available. + +Fix this by instead using the private readline function _rl_signal_handler. + +There is precedent for using private readline variables and functions, but +it's something we want to get rid of (PR build/10723). Nevertheless, I think +we can allow this specific instance because it's not used when building +against readline >= 8. + +[ In the meanwhile, a fix was committed in the devel branch of the readline +repo, contained in commit 8d0c439 ("rollup of changes since readline-8.2"), +first proposed here ( +https://lists.gnu.org/archive/html/bug-readline/2022-10/msg00008.html ). ] + +Tested on x86_64-linux, against system readline 7.0 on openSUSE Leap 15.4. + +PR cli/27813 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=27813 +--- + gdb/event-top.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/gdb/event-top.c b/gdb/event-top.c +index 9181e4bdcff..399582698c1 100644 +--- a/gdb/event-top.c ++++ b/gdb/event-top.c +@@ -134,6 +134,9 @@ static struct async_signal_handler *async_sigterm_token; + character is processed. */ + void (*after_char_processing_hook) (void); + ++#if RL_VERSION_MAJOR == 7 ++EXTERN_C void _rl_signal_handler (int); ++#endif + + /* Wrapper function for calling into the readline library. This takes + care of a couple things: +@@ -200,8 +203,14 @@ gdb_rl_callback_read_char_wrapper_noexcept () noexcept + pending signal. I'm not sure if that's possible, but it seems + better to handle the scenario than to assert. */ + rl_check_signals (); ++#elif RL_VERSION_MAJOR == 7 ++ /* Unfortunately, rl_check_signals is not available. Use private ++ function _rl_signal_handler instead. */ ++ ++ while (rl_pending_signal () != 0) ++ _rl_signal_handler (rl_pending_signal ()); + #else +- /* Unfortunately, rl_check_signals is not available. */ ++#error "Readline major version >= 7 expected" + #endif + if (after_char_processing_hook) + (*after_char_processing_hook) (); + +base-commit: 7f7fcd7031430953f41b284069d1ed0cf3c8734a +-- +2.35.3 + diff --git a/gdb-core-open-vdso-warning.patch b/gdb-core-open-vdso-warning.patch index 257250c..31fb92a 100644 --- a/gdb-core-open-vdso-warning.patch +++ b/gdb-core-open-vdso-warning.patch @@ -25,9 +25,9 @@ diff --git a/gdb/testsuite/gdb.base/solib-symbol.exp b/gdb/testsuite/gdb.base/so set bin_flags [list debug shlib=${binfile_lib}] +set executable ${testfile} - if [get_compiler_info] { - return -1 -@@ -70,8 +71,26 @@ gdb_test "br foo2" \ + if { [gdb_compile_shlib ${srcfile_lib} ${binfile_lib} $lib_flags] != "" + || [gdb_compile ${srcfile} ${binfile} executable $bin_flags] != "" } { +@@ -66,8 +67,26 @@ gdb_test "br foo2" \ "Breakpoint.*: foo2. .2 locations..*" \ "foo2 in mdlib" diff --git a/gdb-disable-commit-resumed-in-target_kill.patch b/gdb-disable-commit-resumed-in-target_kill.patch deleted file mode 100644 index 3da6c67..0000000 --- a/gdb-disable-commit-resumed-in-target_kill.patch +++ /dev/null @@ -1,272 +0,0 @@ -gdb: disable commit resumed in target_kill - -New in this version: - - - Better comment in target_kill - - Uncomment line in test to avoid hanging when exiting, when testing on - native-extended-gdbserver - -PR 28275 shows that doing a sequence of: - - - Run inferior in background (run &) - - kill that inferior - - Run again - -We get into this assertion: - - /home/smarchi/src/binutils-gdb/gdb/target.c:2590: internal-error: target_wait: Assertion `!proc_target->commit_resumed_state' failed. - - #0 internal_error_loc (file=0x5606b344e740 "/home/smarchi/src/binutils-gdb/gdb/target.c", line=2590, fmt=0x5606b344d6a0 "%s: Assertion `%s' failed.") at /home/smarchi/src/binutils-gdb/gdbsupport/errors.cc:54 - #1 0x00005606b6296475 in target_wait (ptid=..., status=0x7fffb9390630, options=...) at /home/smarchi/src/binutils-gdb/gdb/target.c:2590 - #2 0x00005606b5767a98 in startup_inferior (proc_target=0x5606bfccb2a0 , pid=3884857, ntraps=1, last_waitstatus=0x0, last_ptid=0x0) at /home/smarchi/src/binutils-gdb/gdb/nat/fork-inferior.c:482 - #3 0x00005606b4e6c9c5 in gdb_startup_inferior (pid=3884857, num_traps=1) at /home/smarchi/src/binutils-gdb/gdb/fork-child.c:132 - #4 0x00005606b50f14a5 in inf_ptrace_target::create_inferior (this=0x5606bfccb2a0 , exec_file=0x604000039f50 "/home/smarchi/build/binutils-gdb/gdb/test", allargs="", env=0x61500000a580, from_tty=1) - at /home/smarchi/src/binutils-gdb/gdb/inf-ptrace.c:105 - #5 0x00005606b53b6d23 in linux_nat_target::create_inferior (this=0x5606bfccb2a0 , exec_file=0x604000039f50 "/home/smarchi/build/binutils-gdb/gdb/test", allargs="", env=0x61500000a580, from_tty=1) - at /home/smarchi/src/binutils-gdb/gdb/linux-nat.c:978 - #6 0x00005606b512b79b in run_command_1 (args=0x0, from_tty=1, run_how=RUN_NORMAL) at /home/smarchi/src/binutils-gdb/gdb/infcmd.c:468 - #7 0x00005606b512c236 in run_command (args=0x0, from_tty=1) at /home/smarchi/src/binutils-gdb/gdb/infcmd.c:526 - -When running the kill command, commit_resumed_state for the -process_stratum_target (linux-nat, here) is true. After the kill, when -there are no more threads, commit_resumed_state is still true, as -nothing touches this flag during the kill operation. During the -subsequent run command, run_command_1 does: - - scoped_disable_commit_resumed disable_commit_resumed ("running"); - -We would think that this would clear the commit_resumed_state flag of -our native target, but that's not the case, because -scoped_disable_commit_resumed iterates on non-exited inferiors in order -to find active process targets. And after the kill, the inferior is -exited, and the native target was unpushed from it anyway. So -scoped_disable_commit_resumed doesn't touch the commit_resumed_state -flag of the native target, it stays true. When reaching target_wait, in -startup_inferior (to consume the initial expect stop events while the -inferior is starting up and working its way through the shell), -commit_resumed_state is true, breaking the contract saying that -commit_resumed_state is always false when calling the targets' wait -method. - -(note: to be correct, I think that startup_inferior should toggle -commit_resumed between the target_wait and target_resume calls, but I'll -ignore that for now) - -I can see multiple ways to fix this. In the end, we need -commit_resumed_state to be cleared by the time we get to that -target_wait. It could be done at the end of the kill command, or at the -beginning of the run command. - -To keep things in a coherent state, I'd like to make it so that after -the kill command, when the target is left with no threads, its -commit_resumed_state flag is left to false. This way, we can keep -working with the assumption that a target with no threads (and therefore -no running threads) has commit_resumed_state == false. - -Do this by adding a scoped_disable_commit_resumed in target_kill. It -clears the target's commit_resumed_state on entry, and leaves it false -if the target does not have any resumed thread on exit. That means, -even if the target has another inferior with stopped threads, -commit_resumed_state will be left to false, which makes sense. - -Add a test that tries to cover various combinations of actions done -while an inferior is running (and therefore while commit_resumed_state -is true on the process target). - -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28275 -Change-Id: I8e6fe6dc1f475055921520e58cab68024039a1e9 -Approved-By: Andrew Burgess - ---- - gdb/target.c | 9 ++ - .../gdb.base/run-control-while-bg-execution.c | 33 ++++++ - .../gdb.base/run-control-while-bg-execution.exp | 122 +++++++++++++++++++++ - 3 files changed, 164 insertions(+) - -diff --git a/gdb/target.c b/gdb/target.c -index 0c86b571e1c..0eae5307785 100644 ---- a/gdb/target.c -+++ b/gdb/target.c -@@ -908,6 +908,15 @@ add_deprecated_target_alias (const target_info &tinfo, const char *alias) - void - target_kill (void) - { -+ -+ /* If the commit_resume_state of the to-be-killed-inferior's process stratum -+ is true, and this inferior is the last live inferior with resumed threads -+ of that target, then we want to leave commit_resume_state to false, as the -+ target won't have any resumed threads anymore. We achieve this with -+ this scoped_disable_commit_resumed. On construction, it will set the flag -+ to false. On destruction, it will only set it to true if there are resumed -+ threads left. */ -+ scoped_disable_commit_resumed disable ("killing"); - current_inferior ()->top_target ()->kill (); - } - -diff --git a/gdb/testsuite/gdb.base/run-control-while-bg-execution.c b/gdb/testsuite/gdb.base/run-control-while-bg-execution.c -new file mode 100644 -index 00000000000..8092fadc8b9 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/run-control-while-bg-execution.c -@@ -0,0 +1,33 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2020-2022 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 . */ -+ // -+#include -+ -+static pid_t mypid = -1; -+ -+static void -+after_getpid (void) -+{ -+} -+ -+int -+main (void) -+{ -+ mypid = getpid (); -+ after_getpid (); -+ sleep (30); -+} -diff --git a/gdb/testsuite/gdb.base/run-control-while-bg-execution.exp b/gdb/testsuite/gdb.base/run-control-while-bg-execution.exp -new file mode 100644 -index 00000000000..5b4834f0b32 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/run-control-while-bg-execution.exp -@@ -0,0 +1,122 @@ -+# Copyright 2022 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 . -+ -+# This test aims at testing various operations after getting rid of an inferior -+# that was running in background, or while we have an inferior running in -+# background. The original intent was to expose cases where the commit-resumed -+# state of the process stratum target was not reset properly after killing an -+# inferior running in background, which would be a problem when trying to run -+# again. The test was expanded to test various combinations of -+# run-control-related actions done with an inferior running in background. -+ -+if {[use_gdb_stub]} { -+ unsupported "test requires running" -+ return -+} -+ -+standard_testfile -+ -+if {[build_executable "failed to prepare" $testfile $srcfile]} { -+ return -+} -+ -+# Run one variation of the test: -+# -+# 1. Start an inferior in the background with "run &" -+# 2. Do action 1 -+# 3. Do action 2 -+# -+# Action 1 indicates what to do with the inferior running in background: -+# -+# - kill: kill it -+# - detach: detach it -+# - add: add a new inferior and switch to it, leave the inferior running in -+# background alone -+# - none: do nothing, leave the inferior running in background alone -+# -+# Action 2 indicates what to do after that: -+# -+# - start: use the start command -+# - run: use the run command -+# - attach: start a process outside of GDB and attach it -+proc do_test { action1 action2 } { -+ save_vars { ::GDBFLAGS } { -+ append ::GDBFLAGS " -ex \"maintenance set target-non-stop on\"" -+ clean_restart $::binfile -+ } -+ -+ # Ensure we are at least after the getpid call, should we need it. -+ if { ![runto "after_getpid"] } { -+ return -+ } -+ -+ # Some commands below ask for confirmation. Turn that off for simplicity. -+ gdb_test "set confirm off" -+ gdb_test_multiple "continue &" "" { -+ -re ".*\r\n$::gdb_prompt " { -+ pass $gdb_test_name -+ } -+ } -+ -+ if { $action1 == "kill" } { -+ gdb_test "kill" "Inferior 1 .* killed.*" -+ } elseif { $action1 == "detach" } { -+ set child_pid [get_integer_valueof "mypid" -1] -+ if { $child_pid == -1 } { -+ fail "failed to extract child pid" -+ return -+ } -+ -+ gdb_test "detach" "Inferior 1 .* detached.*" "detach from first instance" -+ -+ # Kill the detached process, to avoid hanging when exiting GDBserver, -+ # when testing with the native-extended-gdbserver board. -+ remote_exec target "kill $child_pid" -+ } elseif { $action1 == "add" } { -+ gdb_test "add-inferior -exec $::binfile" \ -+ "Added inferior 2 on connection 1.*" "add-inferior" -+ gdb_test "inferior 2" "Switching to inferior 2 .*" -+ } elseif { $action1 == "none" } { -+ -+ } else { -+ error "invalid action 1" -+ } -+ -+ if { $action2 == "start" } { -+ gdb_test "start" "Temporary breakpoint $::decimal\(?:\.$::decimal\)?, main .*" -+ } elseif { $action2 == "run" } { -+ gdb_test "break main" "Breakpoint $::decimal at $::hex.*" -+ gdb_test "run" "Breakpoint $::decimal\(?:\.$::decimal\)?, main .*" -+ } elseif { $action2 == "attach" } { -+ set test_spawn_id [spawn_wait_for_attach $::binfile] -+ set test_pid [spawn_id_get_pid $test_spawn_id] -+ -+ if { [gdb_attach $test_pid] } { -+ gdb_test "detach" "Inferior $::decimal .* detached.*" \ -+ "detach from second instance" -+ } -+ -+ # Detach and kill this inferior so we don't leave it around. -+ kill_wait_spawned_process $test_spawn_id -+ } else { -+ error "invalid action 2" -+ } -+} -+ -+foreach_with_prefix action1 { kill detach add none } { -+ foreach_with_prefix action2 { start run attach } { -+ do_test $action1 $action2 -+ } -+} diff --git a/gdb-fedora-libncursesw.patch b/gdb-fedora-libncursesw.patch index 00f4b96..038ff84 100644 --- a/gdb-fedora-libncursesw.patch +++ b/gdb-fedora-libncursesw.patch @@ -12,7 +12,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1270534 diff --git a/gdb/configure b/gdb/configure --- a/gdb/configure +++ b/gdb/configure -@@ -9567,6 +9567,7 @@ if test x"$prefer_curses" = xyes; then +@@ -20915,6 +20915,7 @@ if test x"$prefer_curses" = xyes; then # search /usr/local/include, if ncurses is installed in /usr/local. A # default installation of ncurses on alpha*-dec-osf* will lead to such # a situation. @@ -20,7 +20,7 @@ diff --git a/gdb/configure b/gdb/configure { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing waddstr" >&5 $as_echo_n "checking for library containing waddstr... " >&6; } if ${ac_cv_search_waddstr+:} false; then : -@@ -9591,7 +9592,7 @@ return waddstr (); +@@ -20939,7 +20940,7 @@ return waddstr (); return 0; } _ACEOF @@ -29,7 +29,7 @@ diff --git a/gdb/configure b/gdb/configure if test -z "$ac_lib"; then ac_res="none required" else -@@ -9665,6 +9666,7 @@ case $host_os in +@@ -21013,6 +21014,7 @@ case $host_os in esac # These are the libraries checked by Readline. @@ -37,7 +37,7 @@ diff --git a/gdb/configure b/gdb/configure { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tgetent" >&5 $as_echo_n "checking for library containing tgetent... " >&6; } if ${ac_cv_search_tgetent+:} false; then : -@@ -9689,7 +9691,7 @@ return tgetent (); +@@ -21037,7 +21039,7 @@ return tgetent (); return 0; } _ACEOF @@ -49,7 +49,7 @@ diff --git a/gdb/configure b/gdb/configure diff --git a/gdb/configure.ac b/gdb/configure.ac --- a/gdb/configure.ac +++ b/gdb/configure.ac -@@ -713,7 +713,8 @@ if test x"$prefer_curses" = xyes; then +@@ -704,7 +704,8 @@ if test x"$prefer_curses" = xyes; then # search /usr/local/include, if ncurses is installed in /usr/local. A # default installation of ncurses on alpha*-dec-osf* will lead to such # a situation. @@ -59,7 +59,7 @@ diff --git a/gdb/configure.ac b/gdb/configure.ac if test "$ac_cv_search_waddstr" != no; then curses_found=yes -@@ -755,7 +756,8 @@ case $host_os in +@@ -746,7 +747,8 @@ case $host_os in esac # These are the libraries checked by Readline. diff --git a/gdb-fix-assert-in-handle_jit_event.patch b/gdb-fix-assert-in-handle_jit_event.patch deleted file mode 100644 index d59dd5a..0000000 --- a/gdb-fix-assert-in-handle_jit_event.patch +++ /dev/null @@ -1,46 +0,0 @@ -[gdb] Fix assert in handle_jit_event - -With the cc-with-tweaks.sh patch submitted here ( -https://sourceware.org/pipermail/gdb-patches/2022-October/192586.html ) we run -with: -... -$ export STRIP_ARGS_STRIP_DEBUG=--strip-all -$ make check RUNTESTFLAGS="gdb.base/jit-reader.exp \ - --target_board cc-with-gnu-debuglink" -... -into the following assert: -... -(gdb) run ^M -Starting program: jit-reader ^M -gdb/jit.c:1247: internal-error: jit_event_handler: \ - Assertion `jiter->jiter_data != nullptr' failed.^M -... - -Fix this by handling the -jit_bp_sym.objfile->separate_debug_objfile_backlink != nullptr case in -handle_jit_event. - -Tested on x86_64-linux. - -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29277 - ---- - gdb/breakpoint.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c -index b046adf08f9..34f35135dfe 100644 ---- a/gdb/breakpoint.c -+++ b/gdb/breakpoint.c -@@ -5566,7 +5566,10 @@ handle_jit_event (CORE_ADDR address) - function needs to be updated too. */ - bound_minimal_symbol jit_bp_sym = lookup_minimal_symbol_by_pc (address); - gdb_assert (jit_bp_sym.objfile != nullptr); -- jit_event_handler (gdbarch, jit_bp_sym.objfile); -+ objfile *objfile = jit_bp_sym.objfile; -+ if (objfile->separate_debug_objfile_backlink) -+ objfile = objfile->separate_debug_objfile_backlink; -+ jit_event_handler (gdbarch, objfile); - - target_terminal::inferior (); - } diff --git a/gdb-fix-assert-when-quitting-gdb-while-a-thread-is-stepping.patch b/gdb-fix-assert-when-quitting-gdb-while-a-thread-is-stepping.patch deleted file mode 100644 index 7034bb1..0000000 --- a/gdb-fix-assert-when-quitting-gdb-while-a-thread-is-stepping.patch +++ /dev/null @@ -1,174 +0,0 @@ -gdb: fix assert when quitting GDB while a thread is stepping - -This commit addresses one of the issues identified in PR gdb/28275. - -Bug gdb/28275 identifies a number of situations in which this assert: - - Assertion `!proc_target->commit_resumed_state' failed. - -could be triggered. There's actually a number of similar places where -this assert is found in GDB, the two of interest in gdb/28275 are in -target_wait and target_stop. - -In one of the comments: - - https://sourceware.org/bugzilla/show_bug.cgi?id=28275#c1 - -steps to trigger the assertion within target_stop were identified when -using a modified version of the gdb.threads/detach-step-over.exp test -script. - -In the gdb.threads/detach-step-over.exp test, we attach to a -multi-threaded inferior, and continue the inferior in asynchronous -(background) mode. Each thread is continuously hitting a conditional -breakpoint where the condition is always false. While the inferior is -running we detach. The goal is that we detach while GDB is performing a -step-over for the conditional breakpoint in at least one thread. - -While detaching, if a step-over is in progress, then GDB has to -complete the step over before we can detach. This involves calling -target_stop and target_wait (see prepare_for_detach). - -As far as gdb/28275 is concerned, the interesting part here, is the -the process_stratum_target::commit_resumed_state variable must be -false when target_stop and target_wait are called. - -This is currently ensured because, in detach_command (infrun.c), we -create an instance of scoped_disable_commit_resumed, this ensures that -when target_detach is called, ::commit_resumed_state will be false. - -The modification to the test that I propose here, and which exposed -the bug, is that, instead of using "detach" to detach from the -inferior, we instead use "quit". Quitting GDB after attaching to an -inferior will cause GDB to first detach, and then exit. - -When we quit GDB we end up calling target_detach via a different code -path, the stack looks like: - - #0 target_detach - #1 kill_or_detach - #2 quit_force - #3 quit_command - -Along this path there is no scoped_disable_commit_resumed created. -::commit_resumed_state can be true when we reach prepare_for_detach, -which calls target_wait and target_stop, so the assertion will trigger. - -In this commit, I propose fixing this by adding the creation of a -scoped_disable_commit_resumed into target_detach. This will ensure -that ::commit_resumed_state is false when calling prepare_for_detach -from within target_detach. - -I did consider placing the scoped_disable_commit_resumed in -prepare_for_detach, however, placing it in target_detach ensures that -the target's commit_resumed_state flag is left to false if the detached -inferior was the last one for that target. It's the same rationale as -for patch "gdb: disable commit resumed in target_kill" that comes later -in this series, but for detach instead of kill. - -detach_command still includes a scoped_disable_commit_resumed too, but I -think it is still relevant to cover the resumption at the end of the -function. - -Co-Authored-By: Simon Marchi -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28275 -Change-Id: Ie128f7aba6ef0e018859275eca372e6ea738e96f - ---- - gdb/target.c | 5 +++ - gdb/testsuite/gdb.threads/detach-step-over.exp | 52 ++++++++++++++++++++++++++ - 2 files changed, 57 insertions(+) - -diff --git a/gdb/target.c b/gdb/target.c -index 1ee051b520a..0c86b571e1c 100644 ---- a/gdb/target.c -+++ b/gdb/target.c -@@ -2558,6 +2558,9 @@ target_preopen (int from_tty) - void - target_detach (inferior *inf, int from_tty) - { -+ /* Thread's don't need to be resumed until the end of this function. */ -+ scoped_disable_commit_resumed disable_commit_resumed ("detaching"); -+ - /* After we have detached, we will clear the register cache for this inferior - by calling registers_changed_ptid. We must save the pid_ptid before - detaching, as the target detach method will clear inf->pid. */ -@@ -2588,6 +2591,8 @@ target_detach (inferior *inf, int from_tty) - inferior_ptid matches save_pid_ptid, but in our case, it does not - call it, as inferior_ptid has been reset. */ - reinit_frame_cache (); -+ -+ disable_commit_resumed.reset_and_commit (); - } - - void -diff --git a/gdb/testsuite/gdb.threads/detach-step-over.exp b/gdb/testsuite/gdb.threads/detach-step-over.exp -index ad9b08f549e..d2cb52423d9 100644 ---- a/gdb/testsuite/gdb.threads/detach-step-over.exp -+++ b/gdb/testsuite/gdb.threads/detach-step-over.exp -@@ -284,6 +284,56 @@ proc_with_prefix test_detach_command {condition_eval target_non_stop non_stop di - kill_wait_spawned_process $test_spawn_id - } - -+# Similar to the proc above, but this time, instead of detaching using -+# the 'detach' command, we quit GDB, this will also trigger a detach, but -+# through a slightly different path, which can expose different bugs. -+proc_with_prefix test_detach_quit {condition_eval target_non_stop \ -+ non_stop displaced} { -+ # If debugging with target remote, check whether the all-stop variant -+ # of the RSP is being used. If so, we can't run the background tests. -+ if {!$non_stop -+ && [target_info exists gdb_protocol] -+ && ([target_info gdb_protocol] == "remote" -+ || [target_info gdb_protocol] == "extended-remote")} { -+ start_gdb_for_test $condition_eval $target_non_stop \ -+ $non_stop $displaced -+ -+ gdb_test_multiple "maint show target-non-stop" "" { -+ -wrap -re "(is|currently) on.*" { -+ } -+ -wrap -re "(is|currently) off.*" { -+ return -+ } -+ } -+ } -+ -+ set test_spawn_id [spawn_wait_for_attach $::binfile] -+ set testpid [spawn_id_get_pid $test_spawn_id] -+ -+ set attempts 3 -+ for {set attempt 1} { $attempt <= $attempts } { incr attempt } { -+ with_test_prefix "iter $attempt" { -+ -+ start_gdb_for_test $condition_eval $target_non_stop \ -+ $non_stop $displaced -+ -+ if {![prepare_test_iter $testpid $non_stop \ -+ $attempt $attempts "$::decimal"]} { -+ kill_wait_spawned_process $test_spawn_id -+ return -+ } -+ -+ gdb_test_multiple "with confirm off -- quit" "" { -+ eof { -+ pass $gdb_test_name -+ } -+ } -+ } -+ } -+ -+ kill_wait_spawned_process $test_spawn_id -+} -+ - # The test program exits after a while, in case GDB crashes. Make it - # wait at least as long as we may wait before declaring a time out - # failure. -@@ -331,6 +381,8 @@ foreach_with_prefix breakpoint-condition-evaluation {"host" "target"} { - foreach_with_prefix displaced {"off" "auto"} { - test_detach_command ${breakpoint-condition-evaluation} \ - ${target-non-stop} ${non-stop} ${displaced} -+ test_detach_quit ${breakpoint-condition-evaluation} \ -+ ${target-non-stop} ${non-stop} ${displaced} - } - } - } diff --git a/gdb-fix-for-gdb.base-eof-exit.exp-test-failures.patch b/gdb-fix-for-gdb.base-eof-exit.exp-test-failures.patch deleted file mode 100644 index 9d2ff1f..0000000 --- a/gdb-fix-for-gdb.base-eof-exit.exp-test-failures.patch +++ /dev/null @@ -1,64 +0,0 @@ -gdb: fix for gdb.base/eof-exit.exp test failures - -This fix relates to PR gdb/29032, this makes the test more stable by -ensuring that the Ctrl-D is only sent once the prompt has been -displayed. This issue was also discussed on the mailing list here: - - https://sourceware.org/pipermail/gdb-patches/2022-April/187670.html - -The problem identified in the bug report is that sometimes the Ctrl-D -(that the test sends to GDB) arrives while GDB is processing a -command. When this happens the Ctrl-D is handled differently than if -the Ctrl-D is sent while GDB is waiting for input at a prompt. - -The original intent of the test was that the Ctrl-D be sent while GDB -was waiting at a prompt, and that is the case the occurs most often, -but, when the Ctrl-D arrives during command processing, then GDB will -ignore the Ctrl-D, and the test will fail. - -This commit ensures the Ctrl-D is always sent while GDB is waiting at -a prompt, which makes this test stable. - -But, that still leaves an open question, what should happen when the -Ctrl-D arrives while GDB is processing a command? This commit doesn't -attempt to answer that question, which is while bug PR gdb/29032 will -not be closed once this commit is merged. - -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29032 - ---- - gdb/testsuite/gdb.base/eof-exit.exp | 18 ++++++++++++++++++ - 1 file changed, 18 insertions(+) - -diff --git a/gdb/testsuite/gdb.base/eof-exit.exp b/gdb/testsuite/gdb.base/eof-exit.exp -index d604d029974..53a3b56dce8 100644 ---- a/gdb/testsuite/gdb.base/eof-exit.exp -+++ b/gdb/testsuite/gdb.base/eof-exit.exp -@@ -25,9 +25,27 @@ proc run_test {} { - # - # Send a newline character, which will cause GDB to redisplay the - # prompt. -+ # -+ # We then consume the newline characters, and then make use of -+ # expect's -notransfer option to ensure that the prompt has been -+ # displayed, but to leave the prompt in expect's internal buffer. -+ # This is important as the following test wants to check how GDB -+ # displays the 'quit' message relative to the prompt, this is much -+ # easier to do if the prompt is still in expect's buffers. -+ # -+ # The other special thing we do here is avoid printing a 'PASS' -+ # result. The reason for this is so that the GDB output in the -+ # log file will match what a user should see, this makes it much -+ # easier to debug issues. Obviously we could print a 'PASS' here -+ # as the text printed by expect is not considered part of GDB's -+ # output, so the pattern matching will work just fine... but, the -+ # log file becomes much harder to read. - send_gdb "\n" - gdb_test_multiple "" "discard newline" { - -re "^\r\n" { -+ exp_continue -+ } -+ -notransfer -re "^\[^\n\]*$::gdb_prompt $" { - } - } - diff --git a/gdb-fix-selftest-fails-with-gdb-build-with-O2-flto.patch b/gdb-fix-selftest-fails-with-gdb-build-with-O2-flto.patch deleted file mode 100644 index 52b25ca..0000000 --- a/gdb-fix-selftest-fails-with-gdb-build-with-O2-flto.patch +++ /dev/null @@ -1,35 +0,0 @@ -Fix selftest FAILs with gdb build with -O2 -flto - -diff --git a/gdb/complaints.h b/gdb/complaints.h -index 6ad056d257..cac09ff573 100644 ---- a/gdb/complaints.h -+++ b/gdb/complaints.h -@@ -42,9 +42,10 @@ extern int stop_whining; - while (0) - - /* Clear out / initialize all complaint counters that have ever been -- incremented. */ -+ incremented. Prevent inlining this function for the benefit of GDB's -+ selftests in the testsuite. */ - --extern void clear_complaints (); -+extern void clear_complaints () __attribute__((noinline)); - - - #endif /* !defined (COMPLAINTS_H) */ -diff --git a/gdb/main.c b/gdb/main.c -index 19bbb92388..9d35f9baa8 100644 ---- a/gdb/main.c -+++ b/gdb/main.c -@@ -1235,6 +1235,11 @@ captured_main_1 (struct captured_main_args *context) - } - } - -+/* Prevent inlining this function for the benefit of GDB's selftests in the -+ testsuite. */ -+ -+static void captured_main (void *data) __attribute__((noinline)); -+ - static void - captured_main (void *data) - { diff --git a/gdb-fortran-frame-string.patch b/gdb-fortran-frame-string.patch deleted file mode 100644 index 0cbd5e7..0000000 --- a/gdb-fortran-frame-string.patch +++ /dev/null @@ -1,104 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-fortran-frame-string.patch - -;; Display Fortran strings in backtraces. -;;=fedoratest - -http://sourceware.org/ml/gdb-patches/2014-07/msg00709.html - -Hi, - -for Fortran it fixes displaying normal strings also in frames/backtraces: - -(gdb) frame --> - -The patch is simple and I do not see why it should not be this way. - -For C/C++ TYPE_CODE_STRING is not used. I am not aware of Pascal but that -language is currently not really much supported in GDB anyway. - -This was a part of my archer/jankratochvil/vla branch but it is not a part of -the Intel VLA patchset as it in fact is completely unrelated to "VLA". - -No regressions on {x86_64,x86_64-m32,i686}-fedora22pre-linux-gnu. - -Thanks, -Jan - -diff --git a/gdb/testsuite/gdb.fortran/fortran-frame-string.exp b/gdb/testsuite/gdb.fortran/fortran-frame-string.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.fortran/fortran-frame-string.exp -@@ -0,0 +1,36 @@ -+# Copyright 2014 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. -+ -+standard_testfile .f90 -+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug f90}] } { -+ return -1 -+} -+ -+if ![runto MAIN__] then { -+ perror "couldn't run to breakpoint MAIN__" -+ continue -+} -+ -+gdb_breakpoint [gdb_get_line_number "s = s"] -+gdb_continue_to_breakpoint "s = s" -+ -+gdb_test "ptype s" {type = character\*3} -+gdb_test "p s" " = 'foo'" -+ -+# Fix rejected upstream: -+# https://sourceware.org/ml/gdb-patches/2014-07/msg00768.html -+setup_kfail "rejected" *-*-* -+gdb_test "frame" { \(s='foo', .*} -diff --git a/gdb/testsuite/gdb.fortran/fortran-frame-string.f90 b/gdb/testsuite/gdb.fortran/fortran-frame-string.f90 -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.fortran/fortran-frame-string.f90 -@@ -0,0 +1,28 @@ -+! Copyright 2014 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. -+! -+! Ihis file is the Fortran source file for dynamic.exp. -+! Original file written by Jakub Jelinek . -+! Modified for the GDB testcase by Jan Kratochvil . -+ -+ subroutine f(s) -+ character*3 s -+ s = s -+ end -+ -+ program main -+ call f ('foo') -+ end diff --git a/gdb-gcore-bash.patch b/gdb-gcore-bash.patch index 0d6019e..724b5ea 100644 --- a/gdb-gcore-bash.patch +++ b/gdb-gcore-bash.patch @@ -6,5 +6,5 @@ index b9770ea415..3149f6e1fe 100644 -#!/usr/bin/env bash +#!/bin/bash - # Copyright (C) 2003-2022 Free Software Foundation, Inc. + # Copyright (C) 2003-2023 Free Software Foundation, Inc. diff --git a/gdb-handle-pending-c-after-rl_callback_read_char.patch b/gdb-handle-pending-c-after-rl_callback_read_char.patch deleted file mode 100644 index 84f6682..0000000 --- a/gdb-handle-pending-c-after-rl_callback_read_char.patch +++ /dev/null @@ -1,65 +0,0 @@ -[gdb] Handle pending ^C after rl_callback_read_char - -In completion tests in various test-cases, we've been running into these -"clearing input line" timeouts: -... -(gdb) $cmd^GPASS: gdb.gdb/unittest.exp: tab complete "$cmd" -FAIL: gdb.gdb/unittest.exp: tab complete "$cmd" (clearing input line) (timeout) -... -where $cmd == "maintenance selftest name_that_does_not_exist". - -AFAIU, the following scenario happens: -- expect sends "$cmd\t" -- gdb detects the stdin event, and calls rl_callback_read_char until it - comes to handle \t -- readline interprets the \t as completion, tries to complete, fails to do so, - outputs a bell (^G) -- expect sees the bell, and proceeds to send ^C -- readline is still in the call to rl_callback_read_char, and stores the - signal in _rl_caught_signal -- readline returns from the call to rl_callback_read_char, without having - handled _rl_caught_signal -- gdb goes to wait for the next event -- expect times out waiting for "Quit", the expected reaction for ^C - -Fix this by handling pending signals after each call to rl_callback_read_char. - -The fix is only available for readline 8.x, if --with-system-readline provides -an older version, then the fix is disabled due to missing function -rl_check_signals. - -Tested on x86_64-linux. - -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=27813 - ---- - gdb/event-top.c | 16 ++++++++++++++++ - 1 file changed, 16 insertions(+) - -diff --git a/gdb/event-top.c b/gdb/event-top.c -index 96df89e0901..c7aa9e7d06a 100644 ---- a/gdb/event-top.c -+++ b/gdb/event-top.c -@@ -186,6 +186,22 @@ gdb_rl_callback_read_char_wrapper_noexcept () noexcept - TRY_SJLJ - { - rl_callback_read_char (); -+#if RL_VERSION_MAJOR >= 8 -+ /* It can happen that readline (while in rl_callback_read_char) -+ received a signal, but didn't handle it yet. Make sure it's handled -+ now. If we don't do that we run into two related problems: -+ - we have to wait for another event triggering -+ rl_callback_read_char before the signal is handled -+ - there's no guarantee that the signal will be processed before the -+ event. */ -+ while (rl_pending_signal () != 0) -+ /* Do this in a while loop, in case rl_check_signals also leaves a -+ pending signal. I'm not sure if that's possible, but it seems -+ better to handle the scenario than to assert. */ -+ rl_check_signals (); -+#else -+ /* Unfortunately, rl_check_signals is not available. */ -+#endif - if (after_char_processing_hook) - (*after_char_processing_hook) (); - } diff --git a/gdb-improved-eof-handling-when-using-readline-7.patch b/gdb-improved-eof-handling-when-using-readline-7.patch deleted file mode 100644 index 8790c00..0000000 --- a/gdb-improved-eof-handling-when-using-readline-7.patch +++ /dev/null @@ -1,85 +0,0 @@ -gdb: improved EOF handling when using readline 7 - -In this commit: - - commit a6b413d24ccc5d76179bab866834e11fd6fec294 - Date: Fri Mar 11 14:44:03 2022 +0000 - - gdb: work around prompt corruption caused by bracketed-paste-mode - -a change was made to GDB to work around bug PR gdb/28833. The -consequence of this work around is that, when bracketed paste mode is -enabled in readline, and GDB is quit by sending EOF, then the output -will look like this: - - (gdb) - quit - -The ideal output, which is what we get when bracketed paste mode is -off, is this: - - (gdb) quit - -The reason we need to make this change is explained in the original -commit referenced above. What isn't mentioned in the above commit, is -that the change that motivated this work around was only added in -readline 8, older versions of readline don't require the change. - -In later commits in this series I will add a fix to GDB's in-tree copy -of readline (this fix is back-ported from upstream readline), and then -I will change GDB so that, when using the (patched) in-tree readline, -we can have the ideal output in all cases. - -However, GDB can be built against the system readline. When this is -done, and the system readline is version 8, then we will still have to -use the work around (two line) style output. - -But, if GDB is built against the system readline, and the system -readline is an older version 7 readline, then there's no reason why we -can't have the ideal output, after all, readline 7 doesn't include the -change that we need to work around. - -This commit changes GDB so that, when using readline 7 we get the -ideal output in all cases. This change is trivial (a simple check -against the readline version number) so I think this should be fine to -include. - -For testing this commit, you need to configure GDB including the -'--with-system-readline' flag, and build GDB on a system that uses -readline 7, for example 'Ubuntu 18.04'. Then run the test -'gdb.base/eof-exit.exp', you should expect everything to PASS. - -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28833 - ---- - gdb/event-top.c | 3 ++- - gdb/testsuite/gdb.base/eof-exit.exp | 2 +- - 2 files changed, 3 insertions(+), 2 deletions(-) - -diff --git a/gdb/event-top.c b/gdb/event-top.c -index c1a95a4b748..7ddb3e8aee6 100644 ---- a/gdb/event-top.c -+++ b/gdb/event-top.c -@@ -783,7 +783,8 @@ command_line_handler (gdb::unique_xmalloc_ptr &&rl) - we first print '\n' to move to the next line, and then print the - quit. This isn't ideal, but avoids corrupting the prompt. */ - const char *value = rl_variable_value ("enable-bracketed-paste"); -- if (value != nullptr && strcmp (value, "on") == 0) -+ if (value != nullptr && strcmp (value, "on") == 0 -+ && ((rl_readline_version >> 8) & 0xff) > 0x07) - printf_unfiltered ("\n"); - printf_unfiltered ("quit\n"); - execute_command ("quit", 1); -diff --git a/gdb/testsuite/gdb.base/eof-exit.exp b/gdb/testsuite/gdb.base/eof-exit.exp -index c88aced9f35..e04c38bf8d7 100644 ---- a/gdb/testsuite/gdb.base/eof-exit.exp -+++ b/gdb/testsuite/gdb.base/eof-exit.exp -@@ -67,7 +67,7 @@ proc run_test {} { - # line after the 'quit', this catches that case. - fail $gdb_test_name - } -- -re "$::gdb_prompt quit\[^\n\]*\r\n\[^\n\]*$" { -+ -re "$::gdb_prompt \[^\n\r\]*quit\[^\n\]*\r\n\[^\n\]*$" { - pass $gdb_test_name - } - eof { diff --git a/gdb-linux_perf-bundle.patch b/gdb-linux_perf-bundle.patch index 7cbe96e..c87d27e 100644 --- a/gdb-linux_perf-bundle.patch +++ b/gdb-linux_perf-bundle.patch @@ -213,7 +213,7 @@ diff --git a/gdb/nat/linux-btrace.h b/gdb/nat/linux-btrace.h diff --git a/gdbsupport/common.m4 b/gdbsupport/common.m4 --- a/gdbsupport/common.m4 +++ b/gdbsupport/common.m4 -@@ -156,7 +156,7 @@ AC_DEFUN([GDB_AC_COMMON], [ +@@ -166,7 +166,7 @@ AC_DEFUN([GDB_AC_COMMON], [ AC_PREPROC_IFELSE([AC_LANG_SOURCE([[ #include #ifndef PERF_ATTR_SIZE_VER5 diff --git a/gdb-physname-pr11734-test.patch b/gdb-physname-pr11734-test.patch deleted file mode 100644 index 96dba56..0000000 --- a/gdb-physname-pr11734-test.patch +++ /dev/null @@ -1,229 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-physname-pr11734-test.patch - -;; Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz). -;;=fedoratest - -http://sourceware.org/ml/gdb-patches/2010-12/msg00263.html - -diff --git a/gdb/testsuite/gdb.cp/pr11734-1.cc b/gdb/testsuite/gdb.cp/pr11734-1.cc -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/pr11734-1.cc -@@ -0,0 +1,29 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2010 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 . -+ -+ Please email any bugs, comments, and/or additions to this file to: -+ bug-gdb@gnu.org */ -+ -+#include "pr11734.h" -+ -+int -+main () -+{ -+ pr11734 *p = new pr11734; -+ p->foo (); -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.cp/pr11734-2.cc b/gdb/testsuite/gdb.cp/pr11734-2.cc -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/pr11734-2.cc -@@ -0,0 +1,26 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2010 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 . -+ -+ Please email any bugs, comments, and/or additions to this file to: -+ bug-gdb@gnu.org */ -+ -+#include "pr11734.h" -+ -+void -+pr11734::foo(void) -+{ -+} -diff --git a/gdb/testsuite/gdb.cp/pr11734-3.cc b/gdb/testsuite/gdb.cp/pr11734-3.cc -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/pr11734-3.cc -@@ -0,0 +1,26 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2010 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 . -+ -+ Please email any bugs, comments, and/or additions to this file to: -+ bug-gdb@gnu.org */ -+ -+#include "pr11734.h" -+ -+void -+pr11734::foo (int a) -+{ -+} -diff --git a/gdb/testsuite/gdb.cp/pr11734-4.cc b/gdb/testsuite/gdb.cp/pr11734-4.cc -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/pr11734-4.cc -@@ -0,0 +1,26 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2010 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 . -+ -+ Please email any bugs, comments, and/or additions to this file to: -+ bug-gdb@gnu.org */ -+ -+#include "pr11734.h" -+ -+void -+pr11734::foo (char *a) -+{ -+} -diff --git a/gdb/testsuite/gdb.cp/pr11734.exp b/gdb/testsuite/gdb.cp/pr11734.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/pr11734.exp -@@ -0,0 +1,55 @@ -+# Copyright 2010 Free Software Foundation, Inc. -+# -+# Contributed by Red Hat, originally written by Keith Seitz. -+# -+# 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 . -+ -+# This file is part of the gdb testsuite. -+ -+if { [skip_cplus_tests] } { continue } -+ -+set testfile "pr11734" -+set class $testfile -+ -+set srcfiles {} -+for {set i 1} {$i < 5} {incr i} { -+ lappend srcfiles $testfile-$i.cc -+} -+ -+prepare_for_testing pr11734 $testfile $srcfiles {c++ debug} -+ -+if {![runto_main]} { -+ perror "couldn't run to breakpoint" -+ continue -+} -+ -+# An array holding the overload types for the method pr11734::foo. The -+# first element is the overloaded method parameter. The second element -+# is the expected source file number, e.g. "pr11734-?.cc". -+array set tests { -+ "char*" 4 -+ "int" 3 -+ "" 2 -+} -+ -+# Test each overload instance twice: once quoted, once unquoted -+foreach ovld [array names tests] { -+ set method "${class}::foo\($ovld\)" -+ set result "Breakpoint (\[0-9\]).*file .*/$class-$tests($ovld).*" -+ gdb_test "break $method" $result -+ gdb_test "break '$method'" $result -+} -+ -+gdb_exit -+return 0 -diff --git a/gdb/testsuite/gdb.cp/pr11734.h b/gdb/testsuite/gdb.cp/pr11734.h -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/pr11734.h -@@ -0,0 +1,27 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2010 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 . -+ -+ Please email any bugs, comments, and/or additions to this file to: -+ bug-gdb@gnu.org */ -+ -+class pr11734 -+{ -+ public: -+ void foo (); -+ void foo (int); -+ void foo (char *); -+}; diff --git a/gdb-physname-pr12273-test.patch b/gdb-physname-pr12273-test.patch deleted file mode 100644 index e03abf1..0000000 --- a/gdb-physname-pr12273-test.patch +++ /dev/null @@ -1,103 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-physname-pr12273-test.patch - -;; Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz). -;;=fedoratest - -http://sourceware.org/ml/gdb-patches/2010-12/msg00264.html - -diff --git a/gdb/testsuite/gdb.cp/pr12273.cc b/gdb/testsuite/gdb.cp/pr12273.cc -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/pr12273.cc -@@ -0,0 +1,37 @@ -+/* This test case is part of GDB, the GNU debugger. -+ -+ Copyright 2010 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 . */ -+ -+template -+class GDB -+{ -+ public: -+ static int simple (void) { return 0; } -+ static int harder (T a) { return 1; } -+ template -+ static X even_harder (T a) { return static_cast (a); } -+ int operator == (GDB const& other) -+ { return 1; } -+}; -+ -+int main(int argc, char **argv) -+{ -+ GDB a, b; -+ if (a == b) -+ return GDB::harder('a') + GDB::harder(3) -+ + GDB::even_harder ('a'); -+ return GDB::simple (); -+} -diff --git a/gdb/testsuite/gdb.cp/pr12273.exp b/gdb/testsuite/gdb.cp/pr12273.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/pr12273.exp -@@ -0,0 +1,46 @@ -+# Copyright 2010 Free Software Foundation, Inc. -+# -+# Contributed by Red Hat, originally written by Keith Seitz. -+# -+# 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 . -+ -+# This file is part of the gdb testsuite. -+ -+if {[skip_cplus_tests]} { continue } -+ -+set testfile "pr12273" -+# Do NOT compile with debug flag. -+prepare_for_testing pr12273 $testfile $testfile.cc {c++} -+ -+gdb_test_no_output "set language c++" -+ -+# A list of minimal symbol names to check. -+# Note that GDB::even_harder(char) is quoted and includes -+# the return type. This is necessary because this is the demangled name -+# of the minimal symbol. -+set min_syms [list \ -+ "GDB::operator ==" \ -+ "GDB::operator==(GDB const&)" \ -+ "GDB::harder(char)" \ -+ "GDB::harder(int)" \ -+ {"int GDB::even_harder(char)"} \ -+ "GDB::simple()"] -+ -+foreach sym $min_syms { -+ if {[gdb_breakpoint $sym]} { -+ pass "setting breakpoint at $sym" -+ } -+} -+ -+gdb_exit diff --git a/gdb-ppc-power7-test.patch b/gdb-ppc-power7-test.patch deleted file mode 100644 index 2869eea..0000000 --- a/gdb-ppc-power7-test.patch +++ /dev/null @@ -1,303 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-ppc-power7-test.patch - -;; Test power7 ppc disassembly. -;;=fedoratest - -diff --git a/gdb/testsuite/gdb.arch/powerpc-power7rh.exp b/gdb/testsuite/gdb.arch/powerpc-power7rh.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/powerpc-power7rh.exp -@@ -0,0 +1,178 @@ -+# 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 PowerPC Power7 instructions disassembly. -+ -+if {![istarget "powerpc*-*-*"]} then { -+ verbose "Skipping PowerPC Power7 instructions disassembly." -+ return -+} -+ -+set testfile "powerpc-power7rh" -+set srcfile ${testfile}.s -+set objfile [standard_output_file ${testfile}.o] -+ -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {debug}] != "" } { -+ untested "PowerPC Power7 instructions disassembly" -+ return -1 -+} -+ -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${objfile} -+ -+ -+# Disassemble the function. -+ -+set test "disass func" -+gdb_test_multiple $test $test { -+ -re "\r\nDump of assembler code for function func:(\r\n.*\r\n)End of assembler dump.\r\n$gdb_prompt $" { -+ set func $expect_out(1,string) -+ pass $test -+ } -+} -+ -+proc instr_to_patt {offset instr} { -+ # 0x0000000000000018 : stxvd2x vs43,r4,r5 -+ return ".*\r\n\[ \t\]*[string map {0x 0x0*} $offset] <(func)?\\+?\[0-9\]*>:\[ \t\]*[string map [list { } "\[ \t\]+" . {\.}] $instr]\[ \t\]*\r\n.*" -+} -+ -+# KFAIL strings would not exist if -Many would print the same as -Mpower7. -+# That means the power7 form should be the preferred one. -+# http://sourceware.org/ml/gdb-patches/2009-03/threads.html#00020 -+ -+proc func_check {offset instr {kfail ""}} { -+ global func -+ -+ set test "Found $offset: $instr" -+ if [regexp -nocase -line [instr_to_patt $offset $instr] $func] { -+ pass $test -+ } elseif {$kfail != "" && [regexp -nocase -line [instr_to_patt $offset $kfail] $func]} { -+ kfail gdb/NNNN $test -+ } else { -+ fail $test -+ } -+} -+ -+func_check 0x0 "lxvd2x vs3,r4,r5" -+# [PATCH] Remove support for POWER7 VSX load/store with update instructions -+# http://sourceware.org/ml/binutils/2009-09/msg00680.html -+# http://sourceware.org/ml/binutils-cvs/2009-09/msg00331.html -+func_check 0x4 "lxvb16x vs3,r4,r5" -+func_check 0x8 "lxvd2x vs43,r4,r5" -+func_check 0xc "lxvb16x vs43,r4,r5" -+func_check 0x10 "stxvd2x vs3,r4,r5" -+func_check 0x14 "stxvb16x vs3,r4,r5" -+func_check 0x18 "stxvd2x vs43,r4,r5" -+func_check 0x1c "stxvb16x vs43,r4,r5" -+func_check 0x20 "xxmrghd vs3,vs4,vs5" -+func_check 0x24 "xxmrghd vs43,vs44,vs45" -+func_check 0x28 "xxmrgld vs3,vs4,vs5" -+func_check 0x2c "xxmrgld vs43,vs44,vs45" -+func_check 0x30 "xxmrghd vs3,vs4,vs5" -+func_check 0x34 "xxmrghd vs43,vs44,vs45" -+func_check 0x38 "xxmrgld vs3,vs4,vs5" -+func_check 0x3c "xxmrgld vs43,vs44,vs45" -+func_check 0x40 "xxpermdi vs3,vs4,vs5,1" -+func_check 0x44 "xxpermdi vs43,vs44,vs45,1" -+func_check 0x48 "xxpermdi vs3,vs4,vs5,2" -+func_check 0x4c "xxpermdi vs43,vs44,vs45,2" -+func_check 0x50 "xvmovdp vs3,vs4" -+func_check 0x54 "xvmovdp vs43,vs44" -+func_check 0x58 "xvmovdp vs3,vs4" -+func_check 0x5c "xvmovdp vs43,vs44" -+func_check 0x60 "xvcpsgndp vs3,vs4,vs5" -+func_check 0x64 "xvcpsgndp vs43,vs44,vs45" -+func_check 0x68 "wait" -+func_check 0x6c "wait" -+func_check 0x70 "waitrsv" -+func_check 0x74 "waitrsv" -+func_check 0x78 "waitimpl" -+func_check 0x7c "waitimpl" -+func_check 0x80 "doze" -+func_check 0x84 "nap" -+func_check 0x88 "sleep" -+func_check 0x8c "rvwinkle" -+func_check 0x90 "prtyw r3,r4" -+func_check 0x94 "prtyd r13,r14" -+func_check 0x98 "mfcfar r10" "mfspr r10,28" -+func_check 0x9c "mtcfar r11" "mtspr 28,r11" -+func_check 0xa0 "cmpb r3,r4,r5" -+func_check 0xa4 "lwzcix r10,r11,r12" -+func_check 0xa8 "dadd f16,f17,f18" -+func_check 0xac "daddq f20,f22,f24" -+func_check 0xb0 "dss 3" -+func_check 0xb4 "dssall" -+func_check 0xb8 "dst r5,r4,1" -+func_check 0xbc "dstt r8,r7,0" -+func_check 0xc0 "dstst r5,r6,3" -+func_check 0xc4 "dststt r4,r5,2" -+func_check 0xc8 "divwe r10,r11,r12" -+func_check 0xcc "divwe. r11,r12,r13" -+func_check 0xd0 "divweo r12,r13,r14" -+func_check 0xd4 "divweo. r13,r14,r15" -+func_check 0xd8 "divweu r10,r11,r12" -+func_check 0xdc "divweu. r11,r12,r13" -+func_check 0xe0 "divweuo r12,r13,r14" -+func_check 0xe4 "divweuo. r13,r14,r15" -+func_check 0xe8 "bpermd r7,r17,r27" -+func_check 0xec "popcntw r10,r20" -+func_check 0xf0 "popcntd r10,r20" -+func_check 0xf4 "ldbrx r20,r21,r22" -+func_check 0xf8 "stdbrx r20,r21,r22" -+func_check 0xfc "lfiwzx f10,0,r10" -+func_check 0x100 "lfiwzx f10,r9,r10" -+func_check 0x104 "fcfids f4,f5" -+func_check 0x108 "fcfids. f4,f5" -+func_check 0x10c "fcfidus f4,f5" -+func_check 0x110 "fcfidus. f4,f5" -+func_check 0x114 "fctiwu f4,f5" -+func_check 0x118 "fctiwu. f4,f5" -+func_check 0x11c "fctiwuz f4,f5" -+func_check 0x120 "fctiwuz. f4,f5" -+func_check 0x124 "fctidu f4,f5" -+func_check 0x128 "fctidu. f4,f5" -+func_check 0x12c "fctiduz f4,f5" -+func_check 0x130 "fctiduz. f4,f5" -+func_check 0x134 "fcfidu f4,f5" -+func_check 0x138 "fcfidu. f4,f5" -+func_check 0x13c "ftdiv cr0,f10,f11" -+func_check 0x140 "ftdiv cr7,f10,f11" -+func_check 0x144 "ftsqrt cr0,f10" -+func_check 0x148 "ftsqrt cr7,f10" -+func_check 0x14c "dcbtt r8,r9" "dcbt 16,r8,r9" -+func_check 0x150 "dcbtstt r8,r9" "dcbtst 16,r8,r9" -+func_check 0x154 "dcffix f10,f12" -+func_check 0x158 "dcffix. f20,f22" -+func_check 0x15c "lbarx r10,r11,r12" -+func_check 0x160 "lbarx r10,r11,r12" -+func_check 0x164 "lbarx r10,r11,r12,1" -+func_check 0x168 "lharx r20,r21,r22" -+func_check 0x16c "lharx r20,r21,r22" -+func_check 0x170 "lharx r20,r21,r22,1" -+func_check 0x174 "stbcx. r10,r11,r12" -+func_check 0x178 "sthcx. r10,r11,r12" -+func_check 0x17c "fre f14,f15" -+func_check 0x180 "fre. f14,f15" -+func_check 0x184 "fres f14,f15" -+func_check 0x188 "fres. f14,f15" -+func_check 0x18c "frsqrte f14,f15" -+func_check 0x190 "frsqrte. f14,f15" -+func_check 0x194 "frsqrtes f14,f15" -+func_check 0x198 "frsqrtes. f14,f15" -+func_check 0x19c "isel r2,r3,r4,28" -diff --git a/gdb/testsuite/gdb.arch/powerpc-power7rh.s b/gdb/testsuite/gdb.arch/powerpc-power7rh.s -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/powerpc-power7rh.s -@@ -0,0 +1,107 @@ -+ .text -+ .globl func -+func: -+ .long 0x7c642e98 /* 0: lxvd2x vs3,r4,r5 */ -+ .long 0x7c642ed8 /* 4: lxvd2ux vs3,r4,r5 */ -+ .long 0x7d642e99 /* 8: lxvd2x vs43,r4,r5 */ -+ .long 0x7d642ed9 /* c: lxvd2ux vs43,r4,r5 */ -+ .long 0x7c642f98 /* 10: stxvd2x vs3,r4,r5 */ -+ .long 0x7c642fd8 /* 14: stxvd2ux vs3,r4,r5 */ -+ .long 0x7d642f99 /* 18: stxvd2x vs43,r4,r5 */ -+ .long 0x7d642fd9 /* 1c: stxvd2ux vs43,r4,r5 */ -+ .long 0xf0642850 /* 20: xxmrghd vs3,vs4,vs5 */ -+ .long 0xf16c6857 /* 24: xxmrghd vs43,vs44,vs45 */ -+ .long 0xf0642b50 /* 28: xxmrgld vs3,vs4,vs5 */ -+ .long 0xf16c6b57 /* 2c: xxmrgld vs43,vs44,vs45 */ -+ .long 0xf0642850 /* 30: xxmrghd vs3,vs4,vs5 */ -+ .long 0xf16c6857 /* 34: xxmrghd vs43,vs44,vs45 */ -+ .long 0xf0642b50 /* 38: xxmrgld vs3,vs4,vs5 */ -+ .long 0xf16c6b57 /* 3c: xxmrgld vs43,vs44,vs45 */ -+ .long 0xf0642950 /* 40: xxpermdi vs3,vs4,vs5,1 */ -+ .long 0xf16c6957 /* 44: xxpermdi vs43,vs44,vs45,1 */ -+ .long 0xf0642a50 /* 48: xxpermdi vs3,vs4,vs5,2 */ -+ .long 0xf16c6a57 /* 4c: xxpermdi vs43,vs44,vs45,2 */ -+ .long 0xf0642780 /* 50: xvmovdp vs3,vs4 */ -+ .long 0xf16c6787 /* 54: xvmovdp vs43,vs44 */ -+ .long 0xf0642780 /* 58: xvmovdp vs3,vs4 */ -+ .long 0xf16c6787 /* 5c: xvmovdp vs43,vs44 */ -+ .long 0xf0642f80 /* 60: xvcpsgndp vs3,vs4,vs5 */ -+ .long 0xf16c6f87 /* 64: xvcpsgndp vs43,vs44,vs45 */ -+ .long 0x7c00007c /* 68: wait */ -+ .long 0x7c00007c /* 6c: wait */ -+ .long 0x7c20007c /* 70: waitrsv */ -+ .long 0x7c20007c /* 74: waitrsv */ -+ .long 0x7c40007c /* 78: waitimpl */ -+ .long 0x7c40007c /* 7c: waitimpl */ -+ .long 0x4c000324 /* 80: doze */ -+ .long 0x4c000364 /* 84: nap */ -+ .long 0x4c0003a4 /* 88: sleep */ -+ .long 0x4c0003e4 /* 8c: rvwinkle */ -+ .long 0x7c830134 /* 90: prtyw r3,r4 */ -+ .long 0x7dcd0174 /* 94: prtyd r13,r14 */ -+ .long 0x7d5c02a6 /* 98: mfcfar r10 */ -+ .long 0x7d7c03a6 /* 9c: mtcfar r11 */ -+ .long 0x7c832bf8 /* a0: cmpb r3,r4,r5 */ -+ .long 0x7d4b662a /* a4: lwzcix r10,r11,r12 */ -+ .long 0xee119004 /* a8: dadd f16,f17,f18 */ -+ .long 0xfe96c004 /* ac: daddq f20,f22,f24 */ -+ .long 0x7c60066c /* b0: dss 3 */ -+ .long 0x7e00066c /* b4: dssall */ -+ .long 0x7c2522ac /* b8: dst r5,r4,1 */ -+ .long 0x7e083aac /* bc: dstt r8,r7,0 */ -+ .long 0x7c6532ec /* c0: dstst r5,r6,3 */ -+ .long 0x7e442aec /* c4: dststt r4,r5,2 */ -+ .long 0x7d4b6356 /* c8: divwe r10,r11,r12 */ -+ .long 0x7d6c6b57 /* cc: divwe. r11,r12,r13 */ -+ .long 0x7d8d7756 /* d0: divweo r12,r13,r14 */ -+ .long 0x7dae7f57 /* d4: divweo. r13,r14,r15 */ -+ .long 0x7d4b6316 /* d8: divweu r10,r11,r12 */ -+ .long 0x7d6c6b17 /* dc: divweu. r11,r12,r13 */ -+ .long 0x7d8d7716 /* e0: divweuo r12,r13,r14 */ -+ .long 0x7dae7f17 /* e4: divweuo. r13,r14,r15 */ -+ .long 0x7e27d9f8 /* e8: bpermd r7,r17,r27 */ -+ .long 0x7e8a02f4 /* ec: popcntw r10,r20 */ -+ .long 0x7e8a03f4 /* f0: popcntd r10,r20 */ -+ .long 0x7e95b428 /* f4: ldbrx r20,r21,r22 */ -+ .long 0x7e95b528 /* f8: stdbrx r20,r21,r22 */ -+ .long 0x7d4056ee /* fc: lfiwzx f10,0,r10 */ -+ .long 0x7d4956ee /* 100: lfiwzx f10,r9,r10 */ -+ .long 0xec802e9c /* 104: fcfids f4,f5 */ -+ .long 0xec802e9d /* 108: fcfids. f4,f5 */ -+ .long 0xec802f9c /* 10c: fcfidus f4,f5 */ -+ .long 0xec802f9d /* 110: fcfidus. f4,f5 */ -+ .long 0xfc80291c /* 114: fctiwu f4,f5 */ -+ .long 0xfc80291d /* 118: fctiwu. f4,f5 */ -+ .long 0xfc80291e /* 11c: fctiwuz f4,f5 */ -+ .long 0xfc80291f /* 120: fctiwuz. f4,f5 */ -+ .long 0xfc802f5c /* 124: fctidu f4,f5 */ -+ .long 0xfc802f5d /* 128: fctidu. f4,f5 */ -+ .long 0xfc802f5e /* 12c: fctiduz f4,f5 */ -+ .long 0xfc802f5f /* 130: fctiduz. f4,f5 */ -+ .long 0xfc802f9c /* 134: fcfidu f4,f5 */ -+ .long 0xfc802f9d /* 138: fcfidu. f4,f5 */ -+ .long 0xfc0a5900 /* 13c: ftdiv cr0,f10,f11 */ -+ .long 0xff8a5900 /* 140: ftdiv cr7,f10,f11 */ -+ .long 0xfc005140 /* 144: ftsqrt cr0,f10 */ -+ .long 0xff805140 /* 148: ftsqrt cr7,f10 */ -+ .long 0x7e084a2c /* 14c: dcbtt r8,r9 */ -+ .long 0x7e0849ec /* 150: dcbtstt r8,r9 */ -+ .long 0xed406644 /* 154: dcffix f10,f12 */ -+ .long 0xee80b645 /* 158: dcffix. f20,f22 */ -+ .long 0x7d4b6068 /* 15c: lbarx r10,r11,r12 */ -+ .long 0x7d4b6068 /* 160: lbarx r10,r11,r12 */ -+ .long 0x7d4b6069 /* 164: lbarx r10,r11,r12,1 */ -+ .long 0x7e95b0e8 /* 168: lharx r20,r21,r22 */ -+ .long 0x7e95b0e8 /* 16c: lharx r20,r21,r22 */ -+ .long 0x7e95b0e9 /* 170: lharx r20,r21,r22,1 */ -+ .long 0x7d4b656d /* 174: stbcx. r10,r11,r12 */ -+ .long 0x7d4b65ad /* 178: sthcx. r10,r11,r12 */ -+ .long 0xfdc07830 /* 17c: fre f14,f15 */ -+ .long 0xfdc07831 /* 180: fre. f14,f15 */ -+ .long 0xedc07830 /* 184: fres f14,f15 */ -+ .long 0xedc07831 /* 188: fres. f14,f15 */ -+ .long 0xfdc07834 /* 18c: frsqrte f14,f15 */ -+ .long 0xfdc07835 /* 190: frsqrte. f14,f15 */ -+ .long 0xedc07834 /* 194: frsqrtes f14,f15 */ -+ .long 0xedc07835 /* 198: frsqrtes. f14,f15 */ -+ .long 0x7c43271e /* 19c: isel r2,r3,r4,28 */ diff --git a/gdb-record-handle-statx-system-call.patch b/gdb-record-handle-statx-system-call.patch deleted file mode 100644 index 648095e..0000000 --- a/gdb-record-handle-statx-system-call.patch +++ /dev/null @@ -1,71 +0,0 @@ -[gdb/record] Handle statx system call - -When running test-case gdb.reverse/fstatat-reverse.exp with target board -unix/-m32 on openSUSE Tumbleweed, I run into: -... -(gdb) PASS: gdb.reverse/fstatat-reverse.exp: set breakpoint at marker2 -continue^M -Continuing.^M -Process record and replay target doesn't support syscall number 383^M -Process record: failed to record execution log.^M -^M -Program stopped.^M -0xf7fc5555 in __kernel_vsyscall ()^M -(gdb) FAIL: gdb.reverse/fstatat-reverse.exp: continue to breakpoint: marker2 -... - -The problems is that while with native we're trying to record these syscalls -(showing strace output): -... -openat(AT_FDCWD, "/", O_RDONLY|O_PATH) = 3 -newfstatat(3, ".", {st_mode=S_IFDIR|0755, st_size=146, ...}, 0) = 0 -... -with unix/-m32 we have instead: -... -openat(AT_FDCWD, "/", O_RDONLY|O_PATH) = 3 -statx(3, ".", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_BASIC_STATS, \ - {stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=STATX_ATTR_MOUNT_ROOT, \ - stx_mode=S_IFDIR|0755, stx_size=146, ...}) = 0 -... -and statx is not supported. - -Fix this by adding support for recording syscall statx. - -Tested on x86_64-linux. - -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28461 - ---- - gdb/linux-record.c | 6 ++++++ - gdb/linux-record.h | 1 + - 2 files changed, 7 insertions(+) - -diff --git a/gdb/linux-record.c b/gdb/linux-record.c -index 0a84bad6983..0af1ef2a9e0 100644 ---- a/gdb/linux-record.c -+++ b/gdb/linux-record.c -@@ -1046,6 +1046,12 @@ Do you want to stop the program?"), - return -1; - break; - -+ case gdb_sys_statx: -+ regcache_raw_read_unsigned (regcache, tdep->arg5, &tmpulongest); -+ if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest, 256)) -+ return -1; -+ break; -+ - case gdb_sys_uname: - if (record_mem_at_reg (regcache, tdep->arg1, - tdep->size_old_utsname)) -diff --git a/gdb/linux-record.h b/gdb/linux-record.h -index 07f0c5a2604..219c67f888d 100644 ---- a/gdb/linux-record.h -+++ b/gdb/linux-record.h -@@ -510,6 +510,7 @@ enum gdb_syscall { - gdb_sys_dup3 = 330, - gdb_sys_pipe2 = 331, - gdb_sys_inotify_init1 = 332, -+ gdb_sys_statx = 383, - gdb_sys_socket = 500, - gdb_sys_connect = 501, - gdb_sys_accept = 502, diff --git a/gdb-rhbz1156192-recursive-dlopen-test.patch b/gdb-rhbz1156192-recursive-dlopen-test.patch deleted file mode 100644 index 9855b7a..0000000 --- a/gdb-rhbz1156192-recursive-dlopen-test.patch +++ /dev/null @@ -1,371 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1156192-recursive-dlopen-test.patch - -;; Testcase for '[SAP] Recursive dlopen causes SAP HANA installer to -;; crash.' (RH BZ 1156192). -;;=fedoratest - -diff --git a/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libbar.c b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libbar.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libbar.c -@@ -0,0 +1,30 @@ -+/* Testcase for recursive dlopen calls. -+ -+ Copyright (C) 2014 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 . */ -+ -+/* This test was copied from glibc's testcase called -+ and related files. */ -+ -+#include -+#include -+ -+void -+bar (void) -+{ -+ printf ("Called bar.\n"); -+} -diff --git a/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libfoo.c b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libfoo.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libfoo.c -@@ -0,0 +1,30 @@ -+/* Testcase for recursive dlopen calls. -+ -+ Copyright (C) 2014 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 . */ -+ -+/* This test was copied from glibc's testcase called -+ and related files. */ -+ -+#include -+#include -+ -+void -+foo (void) -+{ -+ printf ("Called foo.\n"); -+} -diff --git a/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.c b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.c -@@ -0,0 +1,125 @@ -+/* Testcase for recursive dlopen calls. -+ -+ Copyright (C) 2014 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 . */ -+ -+/* This test was copied from glibc's testcase called -+ and related files. */ -+ -+#include -+#include -+#include -+#include -+ -+#define DSO "gdb-rhbz1156192-recursive-dlopen-libfoo.so" -+#define FUNC "foo" -+ -+#define DSO1 "gdb-rhbz1156192-recursive-dlopen-libbar.so" -+#define FUNC1 "bar" -+ -+/* Prototype for my hook. */ -+void *custom_malloc_hook (size_t, const void *); -+ -+/* Pointer to old malloc hooks. */ -+void *(*old_malloc_hook) (size_t, const void *); -+ -+/* Call function func_name in DSO dso_name via dlopen. */ -+void -+call_func (const char *dso_name, const char *func_name) -+{ -+ int ret; -+ void *dso; -+ void (*func) (void); -+ char *err; -+ -+ /* Open the DSO. */ -+ dso = dlopen (dso_name, RTLD_NOW|RTLD_GLOBAL); -+ if (dso == NULL) -+ { -+ err = dlerror (); -+ fprintf (stderr, "%s\n", err); -+ exit (1); -+ } -+ /* Clear any errors. */ -+ dlerror (); -+ -+ /* Lookup func. */ -+ *(void **) (&func) = dlsym (dso, func_name); -+ if (func == NULL) -+ { -+ err = dlerror (); -+ if (err != NULL) -+ { -+ fprintf (stderr, "%s\n", err); -+ exit (1); -+ } -+ } -+ /* Call func twice. */ -+ (*func) (); -+ -+ /* Close the library and look for errors too. */ -+ ret = dlclose (dso); -+ if (ret != 0) -+ { -+ err = dlerror (); -+ fprintf (stderr, "%s\n", err); -+ exit (1); -+ } -+ -+} -+ -+/* Empty hook that does nothing. */ -+void * -+custom_malloc_hook (size_t size, const void *caller) -+{ -+ void *result; -+ /* Restore old hooks. */ -+ __malloc_hook = old_malloc_hook; -+ /* First call a function in another library via dlopen. */ -+ call_func (DSO1, FUNC1); -+ /* Called recursively. */ -+ result = malloc (size); -+ /* Restore new hooks. */ -+ old_malloc_hook = __malloc_hook; -+ __malloc_hook = custom_malloc_hook; -+ return result; -+} -+ -+int -+main (void) -+{ -+ -+ /* Save old hook. */ -+ old_malloc_hook = __malloc_hook; -+ /* Install new hook. */ -+ __malloc_hook = custom_malloc_hook; -+ -+ /* Attempt to dlopen a shared library. This dlopen will -+ trigger an access to the ld.so.cache, and that in turn -+ will require a malloc to duplicate data in the cache. -+ The malloc will call our malloc hook which calls dlopen -+ recursively, and upon return of this dlopen the non-ref -+ counted ld.so.cache mapping will be unmapped. We will -+ return to the original dlopen and crash trying to access -+ dlopened data. */ -+ call_func (DSO, FUNC); -+ -+ /* Restore old hook. */ -+ __malloc_hook = old_malloc_hook; -+ -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.exp b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.exp -@@ -0,0 +1,157 @@ -+# Copyright 2014 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 . -+ -+if {[skip_shlib_tests]} { -+ untested "skipping shlib tests" -+ return 0 -+} elseif {[use_gdb_stub]} { -+ untested "skipping tests because of stub" -+ return 0 -+} -+ -+# Library foo -+set libname1 "gdb-rhbz1156192-recursive-dlopen-libfoo" -+set srcfile_lib1 ${srcdir}/${subdir}/${libname1}.c -+set binfile_lib1 [standard_output_file ${libname1}.so] -+# Library bar -+set libname2 "gdb-rhbz1156192-recursive-dlopen-libbar" -+set srcfile_lib2 ${srcdir}/${subdir}/${libname2}.c -+set binfile_lib2 [standard_output_file ${libname2}.so] -+ -+set testfile "gdb-rhbz1156192-recursive-dlopen" -+set srcfile ${testfile}.c -+set executable ${testfile} -+set binfile [standard_output_file ${executable}] -+ -+if { [gdb_compile_shlib ${srcfile_lib1} ${binfile_lib1} \ -+ { debug "additional_flags=-fPIC" }] != "" } { -+ untested "Could not compile ${binfile_lib1}" -+ return -1 -+} -+ -+if { [gdb_compile_shlib ${srcfile_lib2} ${binfile_lib2} \ -+ { debug "additional_flags=-fPIC" }] != "" } { -+ untested "Could not compile ${binfile_lib2}" -+ return -1 -+} -+ -+if { [prepare_for_testing ${testfile}.exp ${executable} ${srcfile} \ -+ [ list debug shlib_load "additional_flags=-Wno-deprecated-declarations" ]] } { -+ untested "Could not compile ${executable}" -+ return -1 -+} -+ -+set supported 0 -+gdb_test_multiple "run" "initial trial run" { -+ -re -wrap "exited normally.*" { -+ set supported 1 -+ pass $gdb_test_name -+ } -+ -re -wrap "exited with code.*" { -+ untested "failed at $gdb_test_name" -+ } -+} -+ -+if { $supported == 0 } { -+ return -1 -+} -+ -+proc do_test { has_libfoo has_libbar } { -+ global hex binfile_lib2 binfile_lib1 gdb_prompt -+ set libbar_match "[string_to_regexp $binfile_lib2]" -+ set libfoo_match "[string_to_regexp $binfile_lib1]" -+ -+ gdb_test_multiple "info shared" "info shared" { -+ -re ".*$libfoo_match\r\n.*$libbar_match\(\r\n.*Shared library is missing\)?.*\r\n${gdb_prompt} $" { -+ if { $has_libfoo && $has_libbar } { -+ pass "matched libfoo and libbar" -+ } else { -+ fail "matched libfoo and libbar (has_libfoo = $has_libfoo, has_libbar = $has_libbar)" -+ } -+ } -+ -re ".*$libfoo_match\(\r\n.*Shared library is missing\)?.*\r\n${gdb_prompt} $" { -+ if { $has_libfoo && !$has_libbar } { -+ pass "matched libfoo" -+ } else { -+ fail "matched libfoo (has_libfoo = $has_libfoo, has_libbar = $has_libbar)" -+ } -+ } -+ -re ".*$libbar_match\(\r\n.*Shared library is missing\)?.*\r\n${gdb_prompt} $" { -+ if { $has_libbar && !$has_libfoo } { -+ pass "matched libbar" -+ } else { -+ fail "matched libbar (has_libfoo = $has_libfoo, has_libbar = $has_libbar)" -+ } -+ } -+ "\r\n${gdb_prompt} $" { -+ if { !$has_libfoo && !$has_libbar } { -+ pass "did not match libfoo nor libbar" -+ } else { -+ fail "did not match libfoo nor libbar (has_libfoo = $has_libfoo, has_libbar = $has_libbar)" -+ } -+ } -+ } -+} -+ -+proc test_stop_on_solib_events { } { -+ set pass 0 -+ # This variable holds the information about whether libfoo and -+ # libbar (respectively) are expected in the "info shared" output. -+ set solib_event_order { { 0 0 } { 0 0 } { 0 0 } { 0 1 } \ -+ { 0 1 } { 0 0 } { 0 0 } { 0 1 } \ -+ { 0 1 } { 0 0 } { 0 0 } { 0 1 } \ -+ { 0 1 } { 0 0 } { 0 0 1 } { 1 1 } \ -+ { 1 1 } { 1 0 } { 1 0 } { 1 1 } \ -+ { 1 1 } { 1 0 1 } { 1 0 } { 1 0 } } -+ -+ with_test_prefix "stop-on-solib-events" { -+ gdb_test_no_output "set stop-on-solib-events 1" "setting stop-on-solib-events" -+ -+ gdb_run_cmd -+ gdb_test "" "Wait for first prompt" -+ foreach l $solib_event_order { -+ incr pass -+ with_test_prefix "pass #$pass" { -+ set should_be_corrupted [expr 0+0[lindex $l 2]] -+ do_test [lindex $l 0] [lindex $l 1] -+ set test "continue" -+ global gdb_prompt -+ gdb_test_multiple $test $test { -+ -re "\r\nwarning: Corrupted shared library list:.*\r\nStopped due to shared library event.*\r\n$gdb_prompt $" { -+ set corrupted 1 -+ pass $test -+ } -+ -re "\r\nStopped due to shared library event.*\r\n$gdb_prompt $" { -+ set corrupted 0 -+ pass $test -+ } -+ } -+ set test "corrupted=$corrupted but should_be_corrupted=$should_be_corrupted" -+ if {$corrupted == $should_be_corrupted} { -+ pass $test -+ } else { -+ fail $test -+ } -+ } -+ } -+ # In the last pass we do not expect to see libfoo or libbar. -+ incr pass -+ with_test_prefix "pass #$pass" { -+ do_test 0 0 -+ } -+ } -+} -+ -+test_stop_on_solib_events diff --git a/gdb-rhbz1325795-framefilters-test.patch b/gdb-rhbz1325795-framefilters-test.patch deleted file mode 100644 index b1cd040..0000000 --- a/gdb-rhbz1325795-framefilters-test.patch +++ /dev/null @@ -1,176 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1325795-framefilters-test.patch - -;; New test for Python "Cannot locate object file for block" (for RH BZ 1325795). -;;=fedoratest - -diff --git a/gdb/testsuite/gdb.python/py-framefilter-thread.c b/gdb/testsuite/gdb.python/py-framefilter-thread.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.python/py-framefilter-thread.c -@@ -0,0 +1,39 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2016 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 . */ -+ -+#include -+#include -+ -+static void * -+start (void *arg) -+{ -+ return arg; /* Backtrace end breakpoint */ -+} -+ -+int -+main (void) -+{ -+ pthread_t thread1; -+ int i; -+ -+ i = pthread_create (&thread1, NULL, start, NULL); -+ assert (i == 0); -+ i = pthread_join (thread1, NULL); -+ assert (i == 0); -+ -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.python/py-framefilter-thread.exp b/gdb/testsuite/gdb.python/py-framefilter-thread.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.python/py-framefilter-thread.exp -@@ -0,0 +1,54 @@ -+# Copyright (C) 2016 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 . -+ -+load_lib gdb-python.exp -+ -+standard_testfile -+ -+if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug pthreads}]} { -+ return -1 -+} -+ -+# Skip all tests if Python scripting is not enabled. -+if { [skip_python_tests] } { continue } -+ -+if ![runto_main] then { -+ return -+} -+gdb_test_no_output "set python print-stack full" \ -+ "Set python print-stack to full" -+ -+# Load global frame-filters -+set remote_python_file [remote_download host ${srcdir}/${subdir}/${testfile}.py] -+gdb_test_no_output "python exec (open ('${remote_python_file}').read ())" \ -+ "Load python file" -+ -+gdb_breakpoint [gdb_get_line_number "Backtrace end breakpoint"] -+gdb_continue_to_breakpoint "Backtrace end breakpoint" -+ -+# #2 0x00007ffff75f228d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113^M -+gdb_test "bt no-filters" " in (\\.?_*clone|thread_start) \[^\r\n\]*" "bt no-filters" -+ -+# #2 0x00007ffff75f228d in 941595343737041 () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113^M -+# vs. -+# #2 0x00007ffff75f228d in 941595343737041Traceback (most recent call last): -+# File "/home/jkratoch/redhat/rhel/gdb/rhel-7.3/gdb-7.6.1/gdb/testsuite/../data-directory/python/gdb/FrameDecorator.py", line 145, in frame_args -+# return self._base.frame_args() -+# File "/home/jkratoch/redhat/rhel/gdb/rhel-7.3/gdb-7.6.1/gdb/testsuite/../data-directory/python/gdb/FrameDecorator.py", line 152, in frame_args -+# return args.fetch_frame_args() -+# File "/home/jkratoch/redhat/rhel/gdb/rhel-7.3/gdb-7.6.1/gdb/testsuite/../data-directory/python/gdb/FrameDecorator.py", line 276, in fetch_frame_args -+# block = self.frame.block() -+# RuntimeError: Cannot locate object file for block. -+gdb_test "bt" " in \[0-9\]+ \[^\r\n\]*" "bt with filters" -diff --git a/gdb/testsuite/gdb.python/py-framefilter-thread.py b/gdb/testsuite/gdb.python/py-framefilter-thread.py -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.python/py-framefilter-thread.py -@@ -0,0 +1,60 @@ -+# Copyright (C) 2016 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 . -+ -+# This file is part of the GDB testsuite. It tests Python-based -+# frame-filters. -+ -+# This test is specifically crafted for RH BZ 1197665. -+ -+import gdb -+import itertools -+from gdb.FrameDecorator import FrameDecorator -+import copy -+ -+class Reverse_Function (FrameDecorator): -+ -+ def __init__(self, fobj): -+ super(Reverse_Function, self).__init__(fobj) -+ self.fobj = fobj -+ -+ def function (self): -+ # This function call should not fail. -+ gdb.target_charset () -+ -+ fname = str (self.fobj.function()) -+ if (fname == None or fname == ""): -+ return None -+ else: -+ fname = fname[::-1] -+ return fname -+ -+class FrameFilter (): -+ -+ def __init__ (self): -+ self.name = "Reverse" -+ self.priority = 100 -+ self.enabled = True -+ gdb.frame_filters [self.name] = self -+ -+ def filter (self, frame_iter): -+ # Python 3.x moved the itertools.imap functionality to map(), -+ # so check if it is available. -+ if hasattr(itertools, "imap"): -+ frame_iter = itertools.imap (Reverse_Function, frame_iter) -+ else: -+ frame_iter = map (Reverse_Function, frame_iter) -+ return frame_iter -+ -+FrameFilter() diff --git a/gdb-rhbz1398387-tab-crash-test.patch b/gdb-rhbz1398387-tab-crash-test.patch deleted file mode 100644 index b3c276e..0000000 --- a/gdb-rhbz1398387-tab-crash-test.patch +++ /dev/null @@ -1,454 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1398387-tab-crash-test.patch - -;; New testcase for: Fix -completion crash (Gary Benson, RH BZ 1398387). -;;=fedoratest - -diff --git a/gdb/testsuite/gdb.base/tab-crash.bz2.uu b/gdb/testsuite/gdb.base/tab-crash.bz2.uu -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/tab-crash.bz2.uu -@@ -0,0 +1,393 @@ -+begin 644 /tmp/libgcc_s-6.3.1-20161221.so.1-objcopyR.debug.bz2 -+M0EIH.3%!6293622@"44`>Q=_____________________________________ -+M________X#\<>SD#OM[7/HAP:R]\H#D"=!/";NP7!]OOJG>U[N;WW'KVV?9I -+M[[,[X.\/;%2U``[[NUM7P^T[U617V#12M]6M7W;M7CZU<=!]/8WL[LI=AZZ> -+MJ5XW;QP]W]DVHY@]/6RS= -+M8[:2][W/F01Z:GIID,IC$GHU-HR$:@T0F -+M@$PC($P"`$PF)D9-&IZFCT-4\$TRI^330-$TR>32>FFF@F!H0GJ>TD_*9!E, -+MR3Q3/11M-,%#T-3:-3T9(P-3T3TT@;1ZD>C1E,AM0:`@@303"`(Q*>FGHU)Z -+MGDFR8FFJ'L5/1C313R3U/*?JF]&35-J!Y3U/TI^1$\IZGFBGJ>HVF4>H])ZA -+MZC)ZFT)H>IH]0>H!H&RC0,F0T9E!HT-`TT`)-1(A$R&J?J3T80]313\F0GHC -+MU3:90\H]$]3:C93U-!LH\IIZ$]0R>:D>329J--`/4_5'I-`TT9#3U!ZC0>H# -+M0])H!H9!Z@#30VH#30-/4T'J`]09%$!4\)A3R,-1'J`S2#0--,$:/$C9-3TG -+MH:FR9-(T>D\4],HT'I`/4`>HVFIIZFR:FR:)Y,3*/3*;"FT:(VIYJC:FF)Z: -+MCTFAIZCTAH:#U!F*")1`0!`"9#4Q-,FT(R33R-4VFE/U&TU-3RGZ1FJ>&H]2 -+M;U38GJ-J3TQ0Q'DU-'J?JF]2&30-'J:>H,FC1HWJ@#RFC0!Z#2-/4T&&4T-/ -+M2:&(>D'J,5#"1JH5B["KJTH:1R2I95!0TXN8+PQ'&*+8%8JVQCC/1G1D0A-S -+M91MLJJLK];M*G>^]MGIW=W7E>KL -+M)MXKMO7VV\M77ANM3H=6LGI)+AR&CF'#<66)4&4S6:;*26:S5DUQGS$+>97< -+M!3.,U$LQELITU,X3Y5[GW>0?IM4(5>Z!^AE04E8=:H(X[7T$U.`@QRT\Z]_" -+M7?`4-8Q_UDP"AQ@$1,B`G(D*S"^7Z%ABZ-%T6MS+#&8M+G -+M)M>_Y9ME3-K"RMO>,UK^9/4HYU5!3:6'45^1-AA23JG7FH&=KT9ZK-!6>?\- -+M;_HD;$V3C,[X\-20B*R?`.(:CK$3A&J2!XYI6TW[U*HI*560[F!42LB.:FO9 -+MT2S-`KC"H/^S^JJFC(54?*/HIBKH,!73^2++62,G98Y/*,\,%R,Y08$R@$&L -+MC#"P#E53*YTZS&>L\]4*"<8&2^]*I?02,46;3.V(P+2P`3$>F+HNTY/(%Z<` -+MM.P&I]6,NED[M1J4`O?!J@8`&>?1 -+M%!8/]>.7UF-'?ZO,O??);\\L:3X7JN-O^ZWAPV:'ONI*N$I2REEE+$\Q47N6 -+M)NB0W\O.LZ)TMD[9VG1NS+?94@_.$$=!P2#U2(8;*%.99OOW:1@#`W]ZV:OR -+M1IWEL,R4\*2Y2^>SP[^QB -+M_,U-)GY3;9KT/P=Q.GX.7G"Q:>QK&9"$ -+M[#-J-&>2W>*T.XDRFC(,4I`"ED(D0(($(R0#&6;D6H(.:&R(R,:JBHZ!54G< -+M11T9V@K&&$`@8+T3IN#,:<5@P(RTBD1%(JP%55$2*#^!4E,%ER22`*-**JU6 -+MJZII6%N>*+(`*J_?LDI@")%A1D1`@0D?O:UXU=+B+/%.C.3P3935G@9N(=B( -+M39SA1$,K(<1`/."P@;M&4XI&*(9N(H[,#92F)PFDD,V:;%@V(`6%EHV(`6$+T`+00*I0;U -+M`+6F`+<5+:@OPH!:+<%V-Y:H6@0ST6@@$DQO&U0"]M7&.2N,;AN4`HP8H!<7 -+MT;QP4`N;A(R`&`P88BZ-&+V-:04?;20GS/LL>$_B,!&RT)$%@$(*)!"$E!7/ -+M#&8("!8N/9=K.,FB'MY.._/VD>C9#^`XS.XJ/S:XR1TI^MMN1AER0/FI,QI< -+MI!S/-3&8!4S2B>DK$=5/`G2Z><=$L7)SB`(%.`?MXB?J?H_!K]]%1:Q0>>D5 -+M@*,0!$21@`8Q[N?N_7_H;4[#S/![4O,^[NUOC?7F"'Z'YMMYO*;_)-K^K9([W=II7_32_/>'@"M-U3'I3>\5F/7!,>LN:H3*N!L;; -+M")']UU7>>-S\,?K65#!/&(542)(!76C2F<92T@@7G-NX#D][M'6*;YS)AF7< -+M!W7=#3Y1,RGT_`:&!`EU8>JEM/&JEI"+[5?4O\_]DT0",,XH95*#$@#=L,AO4L+ -+M1BB(3Q$X?C1IAS!$AY.>_%4]AI=*'&F6&\>U;\YG,QV14-HP9\BY30H/3].G -+MTW36AQ.N"4&8U(-$CSEJ:IAKE6J,KC=.U9$\H:1I/5!WK37"2WTTCL+"6YJD -+MVV8?W_`MAI=@)]J^U-YAOBS;:'(S4SPBJP))LEQ'+GK;<]US[@5VN)U.SEI] -+M@B6(>WE8&UNN(Z_Y^_U`>?=I*[4=\'V/"\YOXXU=RH7$2P -+MZ8AP5/2@#F" -+M^(R"5",K@5=:R=P=>/%\_!=LCS0>*ISX$*;G?\$9(P-<"734Z=7:V/E#,EJ3 -+MR#)DN].):$0+S";E13Q8UADO"%],GD)5UBLWUDCN34&A3.I3U+69_K:PL#9:%6F) -+M[AU5/05TLKLJ2*QB0,US:"U%(#G!9N81MN&'7T1O*J^]%%^#HV->-]LNGN*= -+M"C%H8>WG7$,^&0"244E4:#V6Y!289:<&E<<-ZGKH1[>$BW"MUU,#SL;,,),V -+M565B6/E!Z,H8E#]WD=(P%@X(,/C7GD0D -+MP-:,NZ$0>8GQY;JN=^^\XXXN0&5=W>Z5]AZ1HYC%E&S'8*.!D@5[<8]"EYC) -+M7*.I"&7-3RH1V#K4>$VO7@MZ*G*`]>M6049!\$(C%$3O$(">"B@IT'Y=.=H)`'G -+MP?T,;OF2.6;FQ;,.#Y<(PT)/0+73.OI!]&#-""F[4ST51A!FJDN2B3PA -+MCB(Q@J)!V14/5@R7:FG%FN\:RY!,K%>T32S-L$$!!OM9<,*\;?V9^D]EW* -+MBQ6*UR5PQ\J=9&)2U[%%,*&2VK(M$(BHTDQO)TV^76K`\E7:.HV99X,B$L68 -+MSG"]BK3]QP^-(JA!,M42_#=-`S`(@)8T4R,S_Y[7P__.8YW/0JJJJJJJNK8X -+M-=3PO'T&C*J9)`]F0`%K%$*P$#"""'MX"\OETF6EW>4IT9RN8.;PY_?U:<^? -+M*X$4&<5`%`1414BR`"1@4.DH8`QG9@#`TT7)^C&:7C@IA^%"_<3WTX+Q5*-=*7Y#/IE(_)_ -+MYYO52X/>^`A8NS+]GQ6$%J!9HFB5*_*22UE#*>TYS.T"1U[AFR44'A(ZIZ$N -+M7O')DXRK49/4T!7XG8#F7\)CF+,TPJAPV;\#4,AD7,Z/*?9D2DQDGR.^]LB( -+M%[`,/\]CK_:F,LN`#`T>]RT?A*WQ[K='\FN+&[/YKKD[GOG)".MPK9KOE&2> -+M4312<,\Y^C:>3=S-OHU-R)^F^*9H5Q"=7^-'_#GT?0V-ZX-3_S"6N2Q?O;7: -+M=G#ZR=L/JQG[ -+MO\_!J];07#9:XP=/JNC6V$KW5]`_.82T05/S?='X=WG0YS.[I94'X$?S()[N -+M#_Y@OQH(_`@/2399*2&\0*8=X^IVZ-3#*-44=7^#1YU#@<+A<&%:']\FNF[I -+M29_6J&Z$R.&H/.2,M8LDC$UZC*6*@F7SBW:"GQ3@-&AS/D'%[PAX*Z.!&Q`! -+MK?M_?V/CA,ZX91WMR-A0992O)T0BR^HF9=VIA-3&20"GDL&" -+M2O*AJJ$K`'3#X"@L61'"0N\_-&J])J,%%(*O_R0A*R3X>_<_]4=+TNCF/6?< -+M]IGY%UQ&M/IX7^;)C'TSL++)C1,MUVW257A0K(-$P.$V@S/RDA=MA.W#)`^< -+MI.1!C(@-*E;AB)^IQOD_^YWQ:2]K^31Z+%2J$@W$OT7PD.02BH.>E@'022(E -+M3@Y$+>HD)''I -+MK!<&,1@9T",6@FYM(V?[Q8KX6%]RJ`*8F:0\/6K-)X%%08$0"I?TTOH7J&:2 -+MP"RV[FF`@B!MYU]ZA5,A0DG2_Q)37"OW#@@D%P1P53,Y9BTRN'V=+Z4!-QP> -+M0Y0QJ(A,6"07X?-ZWOBHFM&@L1]UFNEG^IKIM+R/9>.LI"N99-[D[:+A+S@] -+M9SU/\?K]_\Q%2,`!A(D20!4>@D8$G;HBBL(!"(2`J'98-5R/N2MRE[9.N+,! -+MO"/VT9Y%Q@(TM(/8\%_VL"*'2P^*D+N2,C?4!XXM?3VL;&:5WJ^+#L>F7!H_,N -+MIUM`#L5Y[#M_O]A6"9J&&AI_78:(A$4RYACP^Q[,#B9?EORFBL,[/%'C)]'[ -+M.CACW"3O$#=`(=[_-\UU>&,/=25L+C^"'BK/E0!N1^$_"JB+_JPA`*]8CO(: -+M`,.^+BG;`ZF7BV09<[-_][:8^4KLHF.(1`0<SWGYJ3I.3K!0![LX-.34%X -+MKYZ.+[/.9+T`A+UD=Y@88X+WRYRQ#Z.0GAL_X^DU8%6CXLM.6/V<%ZXA\X\>Z?;"LR((5^)BH[ -+M9YVM6QCU[L+>4:^0@[(+A[*2R473>#_#80G05=[MO!0B83]S4Y#69SL\FU;, -+MM[%]++>'XGB[M<9CU9H/*ZY^J8LEQ/Y>=4H#=D -+M076@OV1*HU!09+VY&I##%336?/5%)M>9>5%%"0;X0^D(!5LP%ZR;J#4AL2A( -+MVL=+2L3>4N`V%1T%AG`R@("$$@E`4)0]>@`6#Y_ -+M!?KZ5D(#B^G8"OV,(-.'8LE-"R&W?C;5W&U,*%TS9#DQGG02?LI;-V'6_'VD:/[B\[^!BK._+R4O,AIRU>SJ67X@ -+M9BGP5'Z*.")D_)5(1^2U>5IE7MC^?6;KS0@W,1]%[_1Q>7T[6YJ6XJQ.^W;Y -+M/EBI?KRW$W[U(3Z"^#'K&C9:437[_,^`K\[(S?[&%\T)U''KMU:$5SAVI&?1 -+MO)WDB92)(QL1_:14'+!3-4<$"%!A'EL*M:SVOPL/C22OB0/^XF -+MK<69BJ[(VD8/"J7=>==O$-;WW//)P10\;N+6!'EH$U.A3!PVG>^?[V.QP)[E -+MM#M7!J:JJ5FI.V-&A9([(@[VAQ'!<$'(1S;SN=_.6>^5#L1AQ&_D'TL&-9`/ -+M68$)7J_190&=D@#5'\F^+AINR/5:*)DDUZ[PNR9<+9KN3=Z?U+GOLD3<33S= -+MITE&9$Q@::(*8DUSZ<4:QI+(U)BWK2;WBIFENWDW[`N'(FMFG:Z>V\N0-.!C -+M]U#!U]T8<9HC9P8<^B_][RM5^;"??IE6G\((HDSM:T1.%M7\:[:DU2F*_DM4 -+MYS/(B9,$-F_^*?"5:RW^<#:*&>C'":.!%4R6T1D?:_G=$H[JG;^K-&;DAU5X -+M&\$R"F*J1F;BV>]?N_E7K/--@V7(QI0@&I.NR=19-&!(=T.&_,X7T=/'`?1* -+M%W!R_DXWII`J:7?>BE$CIAWG*'YBZ$Q'_%_<27$JIQGYCU"!+X5C(PDS@W[\ -+M7\*E`_CB_W[+#`2HNE+Z5(.40BX]1`,]W]9L2=-5S\JMIA,-W<&@; -+M^[8^O76V>0CBYD0'SW%)\GD[WPO%X,)C%,*J;0T`C:JCB'+92>O:H';H,-[R -+M=DRZ#I]-'NVA`SO3(FDOZW8P4EL?@9A=5^0Y7FCDLWBFFUTVRG&%.[D2V^=` -+M5#K.+)QE0NXQY^M7*(C1-,N?>U93STMV@CGTY>&R$>RPK3'2R2*?5I5(24S/ -+M3K0$S`PJ(?/0Q9_SG%)RTTU3HP8:\7'A72DJ57`^O/MG`YY><>SSD?WAH=M: -+M"RO5HS+T!`\:(`9QAYB=#3-8"F2'/%UT1%Q3?D&F$[TQ2-M#%>'(OH`!2E./ -+M)389QV:(LHH6GG+(3N1L[?82L*K4K0&9XD2X6@M+0N,)U%K,T-":?/Y]\MK5 -+MK_Z:_I>'2UZ7+0:AKH\.K%VYPA6E!DHVG,PO?KU25M)+DT,P/AGJ<1$85R9% -+MPF!G=#T]U45@%VRRB)A-TW^ZQ(Q_ZZED+F:K/ -+M%[7I:0$4UD$#WL$0]Y40\#A.AW7;\'O>+#S^/JY/1OZ/3K>4XW>>[AD]#5PU -+M:AAQU[/W.(AMMJ>4Q`29&#B9U_*;%>_:VI]+:'MP6ICV=R&`\X8;_^^!.GMS -+M[CNN,)<#02E3:J,LVK(;7-QHKD@J'][T+:HKY^3V'XE@FQ3YWDML=KUMVS9T -+M--UE*6'ES*\2LIZ+T;BH^&&6:[X%`OG)G&&W,6 -+M)H$T1"14@OL:/PY6'YT^RE4`/70$D`%\6*J_[>]LELD`/3H$FC6R':]3T>]R:N[G/F>L^-Z8W(@05",604",9-Y"A3TN;K^7U_D?5 -+M]+)>,!C#_7R<;\D\CX1PL]S$^X[C@`P,/0"-31'T61;6DR@][DZ>GRX>I6>`E\3;J]#&J;J-QZDEZ -+MN`Z"S<>Q9D;G8V4DQ'4T:78NL=:(*1TE&S_R-!0N)EE'3[0&B*! -+MXQ*NL=1!1^MME#CP3"#Z\>EWS"6?=]^))"@K:@'@@WDG:-N)I=7TH:&]V:HU#$8H@2H7&5C!B8/< -+M>+*R`ZN=[,`1\>^V(NU#+I]][;J]J$$)=@@8!C&8F38Z2ZYW@!C;&*7UJH?S -+MQ*8,+&MJ!D'$H2WJ"=:##R1L!V.SV:FBB#KMJZ-A8U=P'F)%DBD+Y(]`W<76 -+M0"B`P'7/I#2C1W`Q//G]JRCF4N!U6V.,:6B(^'F_PM]?37_I^G\>W:F,#`!L -+M#$,?SLN]D@92+./&PT_IX_D\#C]]P.?H=A[GX8-3>EHG#-5Y:9#51"%*"@8, -+MR,#P4(,M6C4*U0!009;_,O-S^;=Q%1U4]/RN)VFLJGPB`SJ%?B]A6)UT%0>\ -+M7?CM)8U>&P!P_@=A7"`%&/ZL=2/B:J/Z>/Q_QN./XO]HL>FR%6\R]CX<7IV1 -+MM0K6BSY&M4Q1/\^R5ZB<#`'BZ1KJHV!@LE\&)<,`$827-VNZ1PXSI0/%T;N2 -+M:'A7:2NQC\#-SZFY*DG.9SA'QL/C0XYFJ`..@)-DDV29VD5#RDE>]G8Q^3VW -+ML)IY;;C3C--_D9B/%?0-[\A)B^]1S.A,'R5))?(UTRN%AZ[R=7^#1>8QD6;? -+M\\>9'WS7+Q2MMQB$4G'&LKKE_5:P6VHX=!IXC/A?V!&;E12BA`S"D%5]>PD& -+MLS[;Q-_NX\>E1,6!J!`.E>BKU-7><]ML_>YUY`*]=J1"%3^'=ZG#M`_=FP\5 -+M_1@U\L5HC!6/M^AK=6RKL$<4WMRZ#=/)WD-JE[^K[$5:2F,WF$W:PM9.*M4Y -+M,1F3/&3Z4AKF[0P[+OYJE&NVX5N("$H-U)M)Q]U1O+/^/[+5!F0AOSIW)JO1 -+M-W"XB@\FPFF^^+'I5<9E=\R":I,J$XM:0Y$V!"D*0/[J>C4]94.6F>7>N3E^ -+MZS4N7`.VR=BDAPI]W\W2SM;LA4L[C%P*HES%0]GNJ_4,L#<[Z^]\A0P/G_9< -+M-GJDQ,;U!M7+G$4.Q774HG@<3ZR^,@.(C5#=9R1V,1BJ>G;B^X1G8:0*J9PI -+M0O;M#TOG'I,BH@=IM=C3M.?3S+JKI7#,9^+T0K`E=MSFF.*<'F(&]5Y[G99G -+M$Q0MHQB/4_,W&S73.T(4?>X?VDZ)REP[?IQJS%,A"CV=$(_EC6+=\=C[AZ^L -+MT6_?WU:<<"*P,*F!BTVR-7-UZ8R*<(0Z,?*JV<():T68@T1[:_##<>AN:?DT -+MFK>X6UN;;41]M,=73:_5`8T)T.!>[ADD@M$)!&9DX4_BU5+'$2![3L[L]J^Z -+MNB>(E(74J3W"%&E0J0Z!0A1"@K/[XD5C,*BGM#&WV3BL+08N0>"'P6\JH&%[ -+M_'ONYQUCK5P8Z@\6BSVU0/@G(./1*RH.1^?4F$S2GX":4R%3D!X_,0:@()!, -+MX.-/LI6"D^5H9QOY(BMN;Y[FTCO5U^=_V]-005[^R6@N"H]!I"@*J2I9445_ -+M?LM+4&A$:4*A`@3/(K`5895(TB768N-]$Y",C9W-PTE8>7<6FSV_800?X^2Q -+ML6'"\!JHI4"AC#]EJ"+343WC0"P%!X6Z=Z+>/#;E\:3H -+M*J9Z)ZHG?FL$!@@([X%`13X]*>3\4W=4+!:?80*1;@X_:7`V2$",%O%+Y;NW -+MSK?IH.1]7FZJ%F6T;`NP\"[HC>M:RB9@9CM -+MN5V'C^C]SZ+:[B[]+=^EM]A+]F_!\*>SA;M^^UT*,[^Z802/D8,&I$20.*F'Q/!Z_P-@_2/8^OT^"0@))K'@?MU`W<04B($7/6DU3`./KY -+M:1.?^/Y_JBD3"%"(29.P4)IHI_DA+0R?6Z%LR#'D>>-RY]_<[&]";4S'N9LZ -+M"Y_Z2\H5#%Z.7J?>2_*H\+?3*3@?E2>)5$*M1;0//-@K!L7>5:>)F4[WO4.>,LM,94O5/E$SMAZ>H -+M\![?H>XT]I?,L*YE4(_XY&?7:=O,PS0::.'M8IM8F#)34%%76)^HW?:5.S=Y6&,4AE,AE@%G2V47(DXEPJT)0 -+M..PL_..*EQ-^+I,4 -+M56.:ST1Q#2EAT>"]%8+(?\>5O`*'!.B37T7>L6.7PW*[?5@`6%UD\A!('2L+ -+M.$R'/6!C>GKC#<5U,GN3M%F9WZDL`#J-4OYO1/K#W'8/.+L-B!CG -+MX>C5+"2X.U^#\@\X%#M@H7^B?UMO@_`IC<6<>OX?O"ZMQ?_D-P]Z(A[$]Z_% -+M+`/EE#J)UQ1L@*%@C[$1"K]>"A+B&;O@8'Q?I;)U?/;1OP=SD7X(0+@/D`C -+M/D>5DIGL#VVM`4V40(D($48(AZH0`3N`(J^_Z7C^-$K2C]+3I-44+?CE2BE: -+M#.]`(@$(E,*(A?*OS&D'J%0$X>>2#.C>W]UAB?==P[^@X@.USAH$4HVQ5N0` -+MZODUS#,W(T.=7,.=4Z"1PJ7D&>!D_"SMO9HN>!IEBHY@LWU&4`A2C*%!*P@F -+M8:NPEZZ1OJ+8!2PM4`I5D,(BM2`%DHF4@!@-D)G$G;9"2$@VMR@%5`*C5O"T -+M4`BYZ*`8%I9>WMXV(`8>GP<;"C@H!&EW$,0`H)-61KVF4`"BE8`&6*P(T5MY -+M[,,;ND@P0:%;$:!6,4@"?R*`@&(I`?/V.OR$P*:HNV,TP%#5A;Z`2JI_A9J' -+M][V!`!.$/:?0EGVF8TSR<_YI`4.0%0RB(=X"A!$/`!0OJ`)50["B$$0M!0I0 -+M2"H11'R04*J-04+S-FYJBAX210"0]YV;I/?,69?B1'DF7D;]MP`1`).+&>KUBK4B?4=S:MC<=XWW$U4KM[G[J2EVCN; -+M/@/-;<73F[?O[4P!0W`4.`%#R=[`2!W.O9K37>X]!V]56Z^)X;I9Q1+C!41$ -+MA)"20]?3*9`AEP?L?*3)N`Q3!3D0`LC0"E*)%1I%>]!0VP4.J"ALW`8GBTD@ -+M#L^)$P#&[CW_!W%E/`IFIAB>S2DGPA)&9)!F9F`A"*L=/@R,)LXZQI19P9&2 -+M15")D#(0,00(D`:\P,X<1RJ9G3.Q+U&^0G`B'FW@#<8A8&_T9K"I@@00;!0V -+MFV+(\9;GZW-.K6N_:8*<.7D+*!;[0KZ.DM+/;Q1#DO]1P=U0K$SDMIB"0,=)TI=B1D1`&1@9+]015`AUX.G%YCZTQSMP&.NF[Q2D -+MLFF^%S/`X*6,"GT/\-3\I.+EJ[:-C*DVU%JVK?RT55HA5M -+M=IL\W`ZX8X'%R6G6UJ($"HG#NPH6)[9)5#I>#661&#'.,(R#0BA?#,(=4P<9 -+MC849O*SG1$]L9,1UH*!1HCV=J7?)NP'\_L2T\!H*$(67:P!AE18K\Z$!Z8K# -+M3**H"OOKTP&`WF3K!\@2',QTC=T"G1R-J+][XLV -+M(+8U@=`1MFP\,V/E5"&F8=JAMA>ST4A8R]DFB-V.8J;>MYL^"G(IU)_!1T1S -+M1ZKUQC]A"6W+L==(4)^N[[/IW.W'V>OI3ZQ3I)5#=,;"[4`WYH:H"EIO#QP] -+MSLR@!H'@:TL;M]IPBL<^H8]HE8\TV##;I=QSPY_]QF;P -+MM/>O"3T)[*80=VMJ@'7HE+(S=H(%<+PY^)\@S]_< -+M;HPZ-X4BF#W(*'(0`K;8HF.\+K,J(@7U(\$0%_L?>;GX@ZBQQ8+SQM-(KZ,T -+M9C:"/-1$LP6-!UB!H'J`"Z[BU1&&*B])JICY7IM$"$[=1A]Z(`N00(;F^!CC -+M5^P%&$;?H8DTT347F=$+184JBY0.(9!0,+$N[M:9UZ'XN^`PG`&KU$+X:VQP^/6EA!K$],NI#&V[..-H-1%"/>\UILE?@CGDZ_->"R,B!V.L@$ -+M\&)YAC4=[_/OLTGHN.\HM45P\AYL%3UTXX8UK89FA0IA!,I6./VBK\XR="PY -+MX$>0E!].'NBXP53HL[#=M+887P^KJ$O*\J%%R3%HS53F3>PW"W)RE^0XP`&B -+MX5S4FXKO7KFF=!'B*40SE(LCGE4:[%<'28D=N(EZTAK?KT,J8/+0;J:&KD4Q -+MB[OTEDH1OBO+GDKUP8>/$/I/K&79VH!DW(/A#%O11Q,@?43>'>UDD\ER#*FT -+M')J(=2J>5.VW66K+2X(DT)IN(PK1W!R2F&OY&3M18,?"*L,:G@I^8P.Q>&WF -+M#.EZ:?20E*9N80_^%7)T'JNIOAM2U8J7U%SQ!5SP<%>O\CD:[T#9,"[%5=`GHARQIT -+M%\QD4*(FQ4)1^"94)MT,<05.QG++X<\&]/K$6S/WCS493!P1"*-:=F<4IPIN -+M/+HA_?]9K12Z4?9#B^ZG``&8)YPC&'J`:.$+6*I=A&GX74>)[[HP]&G1Q'WD -+M&I$34#4[D:E&0X>6!PZ:3'B0^W>(,D=*^/92`7Q>Q9-VAPUEQY3OTL_HZO#; -+M>#LA+:6P2J`"-2V,RA8$1Z7F[]*K)3,'CQHY$78K\B']@`8P%]=;,/U'E7#N -+M*&)X?MY1EQ%FK,8H:9K>;;!S?'N^@'EQ,87%WG+>)!%3C>! -+MPG)6ZNZG!P'@4%04Y;)`BM,$\7AB]3RL4:\XW7W00(".LJFSTKGT*M2TN^L7 -+M%@0`B`(A<`$"(1N!QX5FD\?@KO;H<;O.81WCXCX0Q*/U9@/0C -+M%(`V()O@A7*8\:4@&#F)EC0I05R7\PBCBCE#2XF,#"KCFN@W -+M>X>>N2Q1:\ZY(2F0,Q?:''2/&A[N9<9W,W"C.BFA"X6`#S/>PH?FQ$NZU?L5 -+M:%KJY31\`:46RYB8I12>4+@=KUF'V84*AZ9)<=+3`TMQSW!&4&1 -+MOVK3F)P\F'+M>@6I@UR)FR&V&]@54]WN43U=;>HIBQ14'9V"IBLL3##*Q],) -+M]QWNQWGS@"VU^,'ZK(O"&XX73+[$P:JK;=PJN[)=#R\,!3RVIIE4%#$M#M:[T;+*^L[L\_E->?;7GBTF.WV'SA^,C -+MI_(U5I*^F0K_A\E2M,7C("1S"";,76BQS-J0\@"(!@A7K8LPYTN8I$"81B%1 -+M`2=VC#?M08HPA"!^5`AU)@H2LH%WI7IIQW$(44H5I@A&_(*0&2]9BH$/S424 -+MA[ID(4F0PG+%CL8%'F96&M\T#-$984"5((`GI9O\^J`G)"3 -+MF$F&UPO%T7I"-_4@?=<7448N.,D(T:\SOC/B0Q[.&;'-BYP3#<._R"(7]"@2 -+MB;[:-2ACE"YUZ)"\@RP@*&P7C0%#GO?PG1Z($QPJPJX;0J% -+MM77KK\]``=R#J10T14"4D%<\6L+ME\?UG3^>^5U.OD!0]L0`3B!0@@KR<9-P -+MXQ-;L=B_?>*S;KP@@@<.\Z#.-M"Q%IPM$S$,EA?"(H)'AE%@E>(`38$0KENH -+M]!A=)P]Y_=LLSAE$R%+").Z_8;-;K9`DT\WCWG0Y"P]#];[*TR"=W$V,V91A -+M71,P*$:G9H`TMG,HETJ\/!38KNF;OK\P*&5H!OJJO>I!4(\(*&-IF"F@%#?: -+MYPX,&FHI(<=[S*;`*%BV3+ -+M@P&<#C!ZMB!2%%`=4,*!O.H4S#`@H%NK\B\5#*>?XGQMCF8W'\*G4SGM?J3$ -+M.[`K2U%`44!BQ&16V,KX'0*3KCCC(@8G90&TX@*';F\]9.BEPZ+322R/-M10 -+MR5`$IZ@@N9>,I984,W=;)`QC)JX*%>Y?0&'-AM15=<-%!(&;ZK>!O.*&]IL/,LNP44\D;(=EVWGN. -+M<:*;Y.R9TN"O:[A73N%1/,)PN)6#(&+%6B&Y"2A!;:[G-0( -+M^-\(=F/B/>'L(+-)POFTHV%?R5\SNC[ABBN!J7%-YELS%@L5(H5@58P5D`B` -+MQ/D!-HQ7,::HBH&,@RH3&"0PAK<0`BHRSV)WVT<&3@">YM+7(7/6<0U33JH% -+MFYS:'!VWP`!*]J2!E)"0B0B*((HQ$11B/WIB!1L2$UPD9"-3(1C`4W^Z@.T2 -+M$RV=VM%5165C3(]7JSZ`N=#Z<"=NM9G/\83I['_K/4_HWCFKHWV:J:Y?Y'7A -+M?DI$1`BM`$0%(``A]#ENPDS3Z^)MN7]3\W6%.*Z'<&R.8+:@@0!@(0% -+M"09`0($!0@H)Q;WT=+2$%0GCY,%V.FV#8+C555,5:JE1I*&A64J4TRPD#?A"`A7A?E=V;H^5^.-Z -+M6;9:`B>RV7/ZWMF<\GFAL7@"0.W=<"A9CT-E%!,43[^,@)S]'FB,H9"!IZQH -+MH1S!EM)#>P@B%+J@H=P:#%`(H!&-^E\:4(U/%V"IIP!0VP4,!8N3#&7E(4*% -+M)0E+QR`H8:"X`T;-Y?41POCSN=O=DYGW<]63['4"AD9$])!#N0$%Y%49R1H] -+M6*"?%YJ!HJ9E39'VPG`9;O/EH#D8L95,.A8F&DHX/>60794`1,M0S,&B"%^> -+M[P>L"]1T,P1:P($'TD0"Y41OAU@4,@*&P>W@],!U&R'%CMFQ:HY5&CU!-N[: -+M:`]:H6HH)F;`H[WL[.Z[\^9ZZ[8.CHFX(ZCAF4T3E@H1&D:F)3>UXW%).3O] -+MRT3:,VU>!F(A42\]S]WA?`OT/W'0ZPB&3&:)2,V*VM25/IZA($,I-Z0HI"08 -+M-.R5&JC:35G(%UE`@`EGDP"BC`(HW^#4+@4(!-L%"/8+F@V"(0E!$*(9H2M" -+MHPD"AN&[" -+MHYN6'+C&PP%&S;A:II;HDMNP,&X`2"C@&373*.8%#/6+@=`;!$.`>9,UQMY*T*=9H'VFCSJY7!1 -+MH?-G*%!;>7G+:^;0H7;MI8I6M-//XE"IS@R@H7E -+MY\2C1W-"$VZCS`4,FYEC"$C)Q.UJUX'2_3P_3?C7Y81 -+MP,^I,KDUEX*'2RG3Z1TR=K[S57UI`^G-6<@AIA:KW**=FLHRLF,>RE9I:;CV -+M4C_OU2_?Z=CQ.71PKA'F+1J.K@V'#!L0F\Q=I##\/`0="-8S0ZE_`R/TQF'CHT4`W8<[TPTZU!0+[.[FW,VK1354`PU6:N@I$Y -+M1)%S)K0='IB5-T]&)5RK!@S/9"_3E$4!NNR>F!0@9T1/(CV^`DDA/[34!0RQ -+M%#(P6<\X#56L2%-:EHOT6QP7!X.0;!#X&/ASC>:8LLPWEBS*LKKB9-)5-!59 -+M;6UU`W:U?"X$VMI5J-"JJM33NIPX&OL!*OGM;9XNSKN6C=V;OA4M:TIL8[8* -+M%^J)980DA-L3E:P4-XO,2W1]3!ORDA(8FT"AA0@TH(;+`IJ,.ZW.(-U!^J\((H=5D)E'S]CYGC\FGS[,.=D#, -+M(@6/J18(LK%TQ`B`(48]'1WW<%0RDAXIVF(Y#P3)VT/;XM?VC8[E<)6]2F'B^O^_4N,>`RGOW`@G[W'RU`?#%[PDA$DU(]^8A?^ -+MDQ/MS"1D8>ER,>3H3/'H7"ZZZZZ8`23.A,Z?;PB*/NR+C\>IA[S;IO[X\L(U -+M*8+6$!40?^>X!1K^-^)7O8>D0_%NKYCSHZS]:)( -+M#/7AQ%$8&:1AS>,M=[MMCGM6%&D&#F`2`,8!0\5[J>,"A_;L#]"=R+AE/7]C -+M8_=MCV(DO(2>>\_GL\JRX/G?045JAA`"?.G7@>0?@4#[;Q3V6/>^I+CR_SZ/ -+M,QH'S_0_0J>U@>)/_$/5:-1JY7&7'UTX3B"P`2@J&]3PK1Y37045.-[&RU@C -+MRZE!QRM1S7R%'CX/#[_R-&9Z3/H$A9[*ITAY+H87N/MQ^XRSN=4GN]8J"*9T -+M4R?\IT_Z'OD_W1@',I\5%O.?>V!^_>KA%_VPS55;10&&]E*IK?KLI,/7_/>L -+M^UO:R&]I_AK"3J+\;_ -+M27^:>[[K:'0_IRO#AY]*0D\W_]V,W?7WO7[;][\4N]4J;74]OKR#I("ZF)[\D.+7[JW<1M_S+T\R07]^.GHN2N_V9W^UAH/?M6L(]G=;K8`^ -+MNGF*OQV7S(P>`QF$K9K.8#_/:_`86%)Q#=W]L'PKE*TZ/Q/>W0X:[]Z!=MVAGZ3XE^R4@7Z<;!&Y2#\_ -+MZ)!2!?*E\$B%&8XI)1DC5[YX0Q.D!U5!X>T_#9.<7W8\W8*\2(#[7OKPL/%P -+MMCZ'U_NJ)T\='S>((D_7A^ELI=U(3,[P-9[+TT'PWDE'"$\!X=_\_).ROW^? -+MC=.S-W,8.>T2CBVG&3T>S'H/R==M"JX)?-VOP7GM- -+M?2\':;;5N;OB<3>9^20W4&3S:/LW:AARVH-G6TXL -+MDV\!)L(@OU(`.H@8<80FQRK)$PE(T\YV=T-QZICXH'U:!W.%:XYY4M:_.D`5 -+M6YB":A=D94"H`(#`W"$#%A,')0]-U:>&S":X@W%\BOH3^V+%,$"HQKE""HB- -+M0A!C@V((WR@$O#G3>I#[/G[2P@U&5UR47BO1?WMZ5$;Y`0%V0?IONU7!O;OQ -+M$->N4W#HL,OL_MU_I-KT.>\Z;3O>4:*LX#Q,&CM7">7Z$\6]4ZMY7I=NTYM% -+MZ)IY48P2K*WEJ^2V-(B`/`IKS(?6MQ2E'=>U[*5&>8($I,!YRH*,FI%59T3G -+MCT@9#11"[,IUXXTZJ=+@L^BO,#!,@8`B,,'D:[,(IRKJN!N(PCUN7ETFMNQ> -+MT.M,<5L4#9FB*%?$W!57FM?/^ZBA@2T-7E"Z%F;\[:8XR0<6)_+$E*H!FF8. -+M-XG<(8#8^U:S%08IU0*`6B3A$>0E<[+JG_>:@;>-`Y1E`&`8=(RYUE')]1`TYY(A:#RB0FG3$PE+)8S -+MGU.@!,R[6^+K@E&1>47'U:5Y9^H"9N$SLJ5J?%:_%JV9"PQ"#C%I;C:?MTG) -+M<_+^*U#T[J#O`$?NA$H`J5@CT><;M?J"+89:J5'/N15EU7F7>F1"I0/G+">Y -+M3+-@8%+J^"D)LAGHE1:IW4%D>L70=!S'KQZ=T/&:X3,<[QS#1;Q0:L.Y4(WR -+MIS8('-XK,_=EA`C,5^$HZS9@[X!)(&TP;5L0+F9IIL:86^R:&;<$8IY<9"=$ -+M980D2B%BWIQ8MF1**D]I;;CK69[X^A0WPLO@0K_*(X]F;<'PTXE7 -+M=W36:V(H)-CY_U'(8WEH]4NH>1WYRQ+BR@4% -+M$1U.K,)S+4!]61]+Q!Q];=1<:0H&&9F^&`@320!JS8'6STZ[:=E*IZ;&BDC7 -+M0Z/7-5O>MY:IK*BM/5>;X56^9&U^#42.H)OFI54HV1)`TJC7_B33GAVXJ]7O -+M;?1"OI([IPP,[MV,/M;SJ$X)F]1/8&A&510:&ID)5D![*U)9=_1^5X(."9$3 -+MAKAD3Q"G(58]/R>7K9'EWM'SQL4<(VSXPXG5&YKMU-_C3ND*S57\G4:0+B9, -+MJ5UN=Z]5!0TZS\:=[S.J>H-)[0]6K0B-@S.BC387!M -+M$S)!YJMA-!`JT[;'[Z^+^[0R-)::%H%GHKM=7G#8VW_]:.U^;<&A9&M/6UP?W""!BY%` -+M#![EE,U-#7?W49=0ZXLS<=KZ:P-?Z3.X9G9?7W,9U.N2TLZ.@I-#Z@G7\7TV -+MWHSA0AEJ*,1,`G^Y-'RV*AEKF,/?,:P^UZ&F<"J&#J0NMG0&<\V@F>9R#G`8 -+M8"2$M4:2?X:&&W[K8\*=>CQHL8G]'<]@CN1F#'"X-ZO8\(=;X+BJT=]2+C:H -+M4PL_D99">XRIU6^@S@B;6=;A"S6J!DD&;F8.@CY3\G*1J,;%1,\3U?C65;#&*>6OE! -+MFVJJJM,IDRO),/K661%M4\6#1,IBT04O9HXN64;!]\FH*H#<46AK6%-'LCF9 -+MR+1L24TY4/W_$$4`;*4R6-)=-<[!3VX70!7=GKY%5A/>5U.!KP4`/^X".'H%Q?;P',T8(,[(O1T\\K!%">*#TZ3L)AZ$/:3# -+MN#L_''38,`!CF+]:(8[7>H+[G4L`8'8$'2;(;A-TB>Y-?`Z0SHGO<-&]>=?1 -+M.%\D]#]-"\?6"0!S,$=]"\WZJKFWW+0,KN8@H5#,P4JO+2[I8+)K.GE;OZ'7 -+MW6^-;6=X]"-%4;W@V9C.#*N(]M'VAWIC7&N_#'E;W?3^T'>]-2-X=9B^4;U\ -+MT'*-(H-.>>8:,Q(3.V46OUD]TQT7D-PM+!C5]1&$A5_.0$FU.WL(&AB[^J(W -+MC9_.U;3@%I%C#)%M;R_(%(ZBT`U7Z%$^2K53FF"->R$&0GTQ1HJCRC*ZNL1@ -+M;F!0>FK6OK[E(YYHF^=GYS,F>9DC+2@>J2@N@/>\BL^-6Z=!H*-?OLIAZ_NK -+MLDN"E,GB8]*I2!;=UH7JBS.6AF88^:>-ZOR=_N7A"M\B,YE=CKV?B(2%+;-$FTH0P@=0=)7(@D5HIYCOV$EW.MZP_:HB -+M&,OED]W=BZGUITM#NKAC8,`1SO"V/<*,?4Q+AGF/V=O(_QZ9Q08'TG;(.%W> -+M3QI"^R0+9F25\+`V81V6@)V/X&8HAATY-]YTO.V[=I1-2`X6_"5%@0JCBP0? -+M!4@"!(7#-S*G*12#Q7ISP]OR(^?&&48%!EP>;\@B($4F'_XNY(IPH2!)0!** -+` -+end -diff --git a/gdb/testsuite/gdb.base/tab-crash.exp b/gdb/testsuite/gdb.base/tab-crash.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/tab-crash.exp -@@ -0,0 +1,43 @@ -+# This testcase is part of GDB, the GNU debugger. -+ -+# Copyright 2017 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 . -+ -+if { ![istarget x86_64-*-* ] || ![is_lp64_target] } { -+ return -+} -+ -+standard_testfile -+ -+# gcc-base-debuginfo-6.3.1-1.fc25.x86_64 -+# /usr/lib/debug/lib64/libgcc_s-6.3.1-20161221.so.1.debug -+# objcopy -R .debug_loc -R .debug_ranges -R .debug_info -R .debug_abbrev -R .debug_aranges -R .debug_str -R .comment ... -+ -+set debugfilebz2uu ${srcdir}/${subdir}/${testfile}.bz2.uu -+set debugfile [standard_output_file ${testfile}] -+ -+if {[catch "system \"uudecode -o - ${debugfilebz2uu} | bzip2 -dc >${debugfile}\""] != 0} { -+ untested "failed uudecode or bzip2" -+ return -1 -+} -+file stat ${debugfile} debugfilestat -+if {$debugfilestat(size) != 71936} { -+ untested "uudecode or bzip2 produce invalid result" -+ return -1 -+} -+ -+clean_restart ${debugfile} -+ -+gdb_test "complete p si" "complete p si\r\np size_of_encoded_value" diff --git a/gdb-runtest-pie-override.patch b/gdb-runtest-pie-override.patch deleted file mode 100644 index fa5418e..0000000 --- a/gdb-runtest-pie-override.patch +++ /dev/null @@ -1,49 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-runtest-pie-override.patch - -;; Hack for proper PIE run of the testsuite. -;;=fedoratest - -make check//unix/-fPIE/-pie RUNTESTFLAGS=solib-display.exp - -gcc -fpic -c -fPIE -pie -o x.o x.c -/usr/lib/gcc/x86_64-redhat-linux/4.6.1/../../../../lib64/Scrt1.o: In function `_start': -(.text+0x20): undefined reference to `main' - -=> Change the order for overrides. - -One has to also use -fPIC rather than -fPIE, -fPIC is stronger. - -The correct way would be: -make check//unix RUNTESTFLAGS='CC_FOR_TARGET=gcc\ -fPIC\ -pie CXX_FOR_TARGET=g++\ -fPIC\ -pie solib-display.exp' - -But there is a problem with testsuite.unix non-unique subdir name and also -a problem with make -j parallelization of the testsuite. - -diff --git a/gdb/testsuite/lib/future.exp b/gdb/testsuite/lib/future.exp ---- a/gdb/testsuite/lib/future.exp -+++ b/gdb/testsuite/lib/future.exp -@@ -197,6 +197,10 @@ proc gdb_default_target_compile_1 {source destfile type options} { - set ldflags "" - set dest [target_info name] - -+ if {[board_info $dest exists multilib_flags]} { -+ append add_flags " [board_info $dest multilib_flags]" -+ } -+ - if {[info exists CFLAGS_FOR_TARGET]} { - append add_flags " $CFLAGS_FOR_TARGET" - } -@@ -531,10 +535,6 @@ proc gdb_default_target_compile_1 {source destfile type options} { - } - } - -- if {[board_info $dest exists multilib_flags]} { -- append add_flags " [board_info $dest multilib_flags]" -- } -- - verbose "doing compile" - - set sources "" diff --git a/gdb-symtab-fix-handling-of-dw_tag_unspecified_type.patch b/gdb-symtab-fix-handling-of-dw_tag_unspecified_type.patch deleted file mode 100644 index 52bbbca..0000000 --- a/gdb-symtab-fix-handling-of-dw_tag_unspecified_type.patch +++ /dev/null @@ -1,200 +0,0 @@ -[gdb/symtab] Fix handling of DW_TAG_unspecified_type - -Currently, the test-case contained in this patch fails: -... -(gdb) p (int) foo ()^M -Invalid cast.^M -(gdb) FAIL: gdb.dwarf2/dw2-unspecified-type.exp: p (int) foo () -... -because DW_TAG_unspecified_type is translated as void. - -There's some code in read_unspecified_type that marks the type as stub, but -that's only active for ada: -... - if (cu->lang () == language_ada) - type->set_is_stub (true); -... - -Fix this by: -- marking the type as a stub for all languages, and -- handling the stub return type case in call_function_by_hand_dummy. - -Tested on x86_64-linux. - -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29558 - ---- - gdb/dwarf2/read.c | 6 +- - gdb/infcall.c | 2 +- - .../gdb.dwarf2/dw2-unspecified-type-foo.c | 22 +++++++ - gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.c | 25 ++++++++ - gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.exp | 72 ++++++++++++++++++++++ - 5 files changed, 123 insertions(+), 4 deletions(-) - -diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c -index 94b12773d3e..631a6df3635 100644 ---- a/gdb/dwarf2/read.c -+++ b/gdb/dwarf2/read.c -@@ -18744,9 +18744,9 @@ read_unspecified_type (struct die_info *die, struct dwarf2_cu *cu) - /* In Ada, an unspecified type is typically used when the description - of the type is deferred to a different unit. When encountering - such a type, we treat it as a stub, and try to resolve it later on, -- when needed. */ -- if (cu->per_cu->lang == language_ada) -- type->set_is_stub (true); -+ when needed. -+ Mark this as a stub type for all languages though. */ -+ type->set_is_stub (true); - - return set_die_type (die, type, cu); - } -diff --git a/gdb/infcall.c b/gdb/infcall.c -index f8c812c8f61..57cfa8875a5 100644 ---- a/gdb/infcall.c -+++ b/gdb/infcall.c -@@ -817,7 +817,7 @@ call_function_by_hand_dummy (struct value *function, - "target calling convention."), - get_function_name (funaddr, name_buf, sizeof (name_buf))); - -- if (values_type == NULL) -+ if (values_type == NULL || values_type->is_stub ()) - values_type = default_return_type; - if (values_type == NULL) - { -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type-foo.c b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type-foo.c -new file mode 100644 -index 00000000000..b1e3a8b98e4 ---- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type-foo.c -@@ -0,0 +1,22 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2022 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 . */ -+ -+int -+foo (void) -+{ -+ asm ("foo_label: .globl foo_label"); -+} -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.c b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.c -new file mode 100644 -index 00000000000..e3218205560 ---- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.c -@@ -0,0 +1,25 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2022 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 . */ -+ -+extern int foo (void); -+ -+int -+main (void) -+{ -+ int res = foo (); -+ return res; -+} -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.exp b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.exp -new file mode 100644 -index 00000000000..20c31dc5740 ---- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.exp -@@ -0,0 +1,72 @@ -+# Copyright 2022 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 . -+ -+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 .c -foo.c dwz.S -+ -+set foo_res \ -+ [function_range foo \ -+ [list ${srcdir}/${subdir}/$srcfile ${srcdir}/${subdir}/$srcfile2]] -+lassign $foo_res \ -+ foo_start foo_len -+set foo_end "$foo_start + $foo_len" -+ -+# Create the DWARF. -+set asm_file [standard_output_file $srcfile3] -+Dwarf::assemble $asm_file { -+ global foo_start foo_end -+ declare_labels unspecified_type_label -+ -+ cu {} { -+ compile_unit { -+ {language @DW_LANG_Mips_Assembler} -+ } { -+ unspecified_type_label: unspecified_type {} -+ -+ DW_TAG_subprogram { -+ {name foo} -+ {low_pc $foo_start addr} -+ {high_pc $foo_end addr} -+ {type :$unspecified_type_label} -+ } -+ -+ } -+ } -+} -+ -+if [prepare_for_testing "failed to prepare" $testfile \ -+ "${asm_file} ${srcfile} ${srcfile2}" {}] { -+ return -1 -+} -+ -+if ![runto_main] { -+ return -1 -+} -+ -+# Print the function type. Return type should be stub type, which is printed -+# as void. -+gdb_test "ptype foo" "type = void \\(void\\)" -+ -+# Call the function, casting the function to the correct function type. -+gdb_test "p ((int (*) ()) foo) ()" " = 0" -+ -+# Call the function, casting the function result to the correct type. -+gdb_test "p (int) foo ()" " = 0" diff --git a/gdb-tdep-aarch64-fix-frame-address-of-last-insn.patch b/gdb-tdep-aarch64-fix-frame-address-of-last-insn.patch new file mode 100644 index 0000000..88f9d75 --- /dev/null +++ b/gdb-tdep-aarch64-fix-frame-address-of-last-insn.patch @@ -0,0 +1,140 @@ +From 433568090645c05d3b7fdbb1a4ae0887e96d9cc0 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Mon, 23 Jan 2023 16:49:36 +0100 +Subject: [PATCH 1/2] [gdb/tdep, aarch64] Fix frame address of last insn + +Consider the test-case test.c, compiled without debug info: +... +void +foo (const char *s) +{ +} + +int +main (void) +{ + foo ("foo"); + return 0; +} +... + +Disassembly of foo: +... +0000000000400564 : + 400564: d10043ff sub sp, sp, #0x10 + 400568: f90007e0 str x0, [sp, #8] + 40056c: d503201f nop + 400570: 910043ff add sp, sp, #0x10 + 400574: d65f03c0 ret +... + +Now, let's do "info frame" at each insn in foo, as well as printing $sp +and $x29 (and strip the output of info frame to the first line, for brevity): +... +$ gdb -q a.out +Reading symbols from a.out... +(gdb) b *foo +Breakpoint 1 at 0x400564 +(gdb) r +Starting program: a.out + +Breakpoint 1, 0x0000000000400564 in foo () +(gdb) display /x $sp +1: /x $sp = 0xfffffffff3a0 +(gdb) display /x $x29 +2: /x $x29 = 0xfffffffff3a0 +(gdb) info frame +Stack level 0, frame at 0xfffffffff3a0: +(gdb) si +0x0000000000400568 in foo () +1: /x $sp = 0xfffffffff390 +2: /x $x29 = 0xfffffffff3a0 +(gdb) info frame +Stack level 0, frame at 0xfffffffff3a0: +(gdb) si +0x000000000040056c in foo () +1: /x $sp = 0xfffffffff390 +2: /x $x29 = 0xfffffffff3a0 +(gdb) info frame +Stack level 0, frame at 0xfffffffff3a0: +(gdb) si +0x0000000000400570 in foo () +1: /x $sp = 0xfffffffff390 +2: /x $x29 = 0xfffffffff3a0 +(gdb) info frame +Stack level 0, frame at 0xfffffffff3a0: +(gdb) si +0x0000000000400574 in foo () +1: /x $sp = 0xfffffffff3a0 +2: /x $x29 = 0xfffffffff3a0 +(gdb) info frame +Stack level 0, frame at 0xfffffffff3b0: + pc = 0x400574 in foo; saved pc = 0x40058c +(gdb) si +0x000000000040058c in main () +1: /x $sp = 0xfffffffff3a0 +2: /x $x29 = 0xfffffffff3a0 +... + +The "frame at" bit lists 0xfffffffff3a0 except at the last insn, where it +lists 0xfffffffff3b0. + +The frame address is calculated here in aarch64_make_prologue_cache_1: +... + unwound_fp = get_frame_register_unsigned (this_frame, cache->framereg); + if (unwound_fp == 0) + return; + + cache->prev_sp = unwound_fp + cache->framesize; +... + +For insns after the prologue, we have cache->framereg == sp and +cache->framesize == 16, so unwound_fp + cache->framesize gives the wrong +answer once sp has been restored to entry value by the before-last insn. + +Fix this by detecting the situation that the sp has been restored. + +This fixes PRs tdep/30010 and tdep/30011. + +This also fixes the aarch64 FAILs in gdb.reverse/solib-precsave.exp and +gdb.reverse/solib-reverse.exp I reported in PR gdb/PR29721. + +Tested on aarch64-linux. +PR tdep/30010 +PR tdep/30011 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30010 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30011 +--- + gdb/aarch64-tdep.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c +index 3cc0d3b234d..499b87ef480 100644 +--- a/gdb/aarch64-tdep.c ++++ b/gdb/aarch64-tdep.c +@@ -145,6 +145,8 @@ static const char *const aarch64_mte_register_names[] = + "tag_ctl" + }; + ++static int aarch64_stack_frame_destroyed_p (struct gdbarch *, CORE_ADDR); ++ + /* AArch64 prologue cache structure. */ + struct aarch64_prologue_cache + { +@@ -996,7 +998,10 @@ aarch64_make_prologue_cache_1 (frame_info_ptr this_frame, + if (unwound_fp == 0) + return; + +- cache->prev_sp = unwound_fp + cache->framesize; ++ cache->prev_sp = unwound_fp; ++ if (!aarch64_stack_frame_destroyed_p (get_frame_arch (this_frame), ++ cache->prev_pc)) ++ cache->prev_sp += cache->framesize; + + /* Calculate actual addresses of saved registers using offsets + determined by aarch64_analyze_prologue. */ + +base-commit: 11c93dc64f6137214809583d9c5a775b18b4f027 +-- +2.35.3 + diff --git a/gdb-tdep-fix-powerpc-ieee-128-bit-format-arg-passing.patch b/gdb-tdep-fix-powerpc-ieee-128-bit-format-arg-passing.patch deleted file mode 100644 index d3ff61f..0000000 --- a/gdb-tdep-fix-powerpc-ieee-128-bit-format-arg-passing.patch +++ /dev/null @@ -1,149 +0,0 @@ -[gdb/tdep] Fix PowerPC IEEE 128-bit format arg passing - -On a powerpc system with gcc 12 built to default to 128-bit IEEE long double, -I run into: -... -(gdb) print find_max_long_double_real(4, ldc1, ldc2, ldc3, ldc4)^M -$8 = 0 + 0i^M -(gdb) FAIL: gdb.base/varargs.exp: print \ - find_max_long_double_real(4, ldc1, ldc2, ldc3, ldc4) -... - -This is due to incorrect handling of the argument in ppc64_sysv_abi_push_param. - -Fix this and similar cases, and expand the test-case to test handling of -homogeneous aggregates. - -Tested on ppc64le-linux, power 10. - -Co-Authored-By: Ulrich Weigand -Tested-by: Carl Love -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29543 - ---- - gdb/ppc-sysv-tdep.c | 25 +++++++++++++++++++------ - gdb/testsuite/gdb.base/varargs.c | 28 ++++++++++++++++++++++++++++ - gdb/testsuite/gdb.base/varargs.exp | 2 ++ - 3 files changed, 49 insertions(+), 6 deletions(-) - -diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c -index b7106542b5d..5a8761d64e7 100644 ---- a/gdb/ppc-sysv-tdep.c -+++ b/gdb/ppc-sysv-tdep.c -@@ -1444,7 +1444,7 @@ ppc64_sysv_abi_push_param (struct gdbarch *gdbarch, - == floatformats_ia64_quad)) - { - /* IEEE FLOAT128, args in vector registers. */ -- ppc64_sysv_abi_push_val (gdbarch, val, TYPE_LENGTH (type), 0, argpos); -+ ppc64_sysv_abi_push_val (gdbarch, val, TYPE_LENGTH (type), 16, argpos); - ppc64_sysv_abi_push_vreg (gdbarch, val, argpos); - } - else if (type->code () == TYPE_CODE_FLT -@@ -1514,7 +1514,10 @@ ppc64_sysv_abi_push_param (struct gdbarch *gdbarch, - } - else - { -- ppc64_sysv_abi_push_val (gdbarch, val, TYPE_LENGTH (type), 0, argpos); -+ /* Align == 0 is correct for ppc64_sysv_abi_push_freg, -+ Align == 16 is correct for ppc64_sysv_abi_push_vreg. -+ Default to 0. */ -+ int align = 0; - - /* The ABI (version 1.9) specifies that structs containing a - single floating-point value, at any level of nesting of -@@ -1532,7 +1535,10 @@ ppc64_sysv_abi_push_param (struct gdbarch *gdbarch, - if (TYPE_LENGTH (type) == 16 - && (gdbarch_long_double_format (gdbarch) - == floatformats_ia64_quad)) -- ppc64_sysv_abi_push_vreg (gdbarch, val, argpos); -+ { -+ ppc64_sysv_abi_push_vreg (gdbarch, val, argpos); -+ align = 16; -+ } - else - ppc64_sysv_abi_push_freg (gdbarch, type, val, argpos); - } -@@ -1556,8 +1562,10 @@ ppc64_sysv_abi_push_param (struct gdbarch *gdbarch, - && (gdbarch_long_double_format (gdbarch) - == floatformats_ia64_quad)) - /* IEEE FLOAT128, args in vector registers. */ -- ppc64_sysv_abi_push_vreg (gdbarch, elval, argpos); -- -+ { -+ ppc64_sysv_abi_push_vreg (gdbarch, elval, argpos); -+ align = 16; -+ } - else if (eltype->code () == TYPE_CODE_FLT - || eltype->code () == TYPE_CODE_DECFLOAT) - /* IBM long double and all other floats and decfloats, args -@@ -1567,9 +1575,14 @@ ppc64_sysv_abi_push_param (struct gdbarch *gdbarch, - && eltype->is_vector () - && tdep->vector_abi == POWERPC_VEC_ALTIVEC - && TYPE_LENGTH (eltype) == 16) -- ppc64_sysv_abi_push_vreg (gdbarch, elval, argpos); -+ { -+ ppc64_sysv_abi_push_vreg (gdbarch, elval, argpos); -+ align = 16; -+ } - } - } -+ -+ ppc64_sysv_abi_push_val (gdbarch, val, TYPE_LENGTH (type), align, argpos); - } - } - -diff --git a/gdb/testsuite/gdb.base/varargs.c b/gdb/testsuite/gdb.base/varargs.c -index cacb29d89e7..fcadcee6fb3 100644 ---- a/gdb/testsuite/gdb.base/varargs.c -+++ b/gdb/testsuite/gdb.base/varargs.c -@@ -45,6 +45,16 @@ long double _Complex ldc2 = 2.0L + 2.0Li; - long double _Complex ldc3 = 3.0L + 3.0Li; - long double _Complex ldc4 = 4.0L + 4.0Li; - -+struct sldc -+{ -+ long double _Complex ldc; -+}; -+ -+struct sldc sldc1 = { 1.0L + 1.0Li }; -+struct sldc sldc2 = { 2.0L + 2.0Li }; -+struct sldc sldc3 = { 3.0L + 3.0Li }; -+struct sldc sldc4 = { 4.0L + 4.0Li }; -+ - #endif - - int -@@ -201,4 +211,22 @@ find_max_long_double_real (int num_vals, ...) - } - - -+long double _Complex -+find_max_struct_long_double_real (int num_vals, ...) -+{ -+ long double _Complex max = 0.0L + 0.0iL; -+ struct sldc x; -+ va_list argp; -+ int i; -+ -+ va_start(argp, num_vals); -+ for (i = 0; i < num_vals; i++) -+ { -+ x = va_arg (argp, struct sldc); -+ if (creall (max) < creal (x.ldc)) max = x.ldc; -+ } -+ -+ return max; -+} -+ - #endif /* TEST_COMPLEX */ -diff --git a/gdb/testsuite/gdb.base/varargs.exp b/gdb/testsuite/gdb.base/varargs.exp -index e778af031cf..f3d413e4de6 100644 ---- a/gdb/testsuite/gdb.base/varargs.exp -+++ b/gdb/testsuite/gdb.base/varargs.exp -@@ -107,4 +107,6 @@ if [support_complex_tests] { - set test "print find_max_long_double_real(4, ldc1, ldc2, ldc3, ldc4)" - gdb_test $test ".*= 4 \\+ 4i" - -+ set test "print find_max_struct_long_double_real(4, sldc1, sldc2, sldc3, sldc4)" -+ gdb_test $test ".*= 4 \\+ 4i" - } diff --git a/gdb-tdep-handle-pipe2-syscall-for-amd64.patch b/gdb-tdep-handle-pipe2-syscall-for-amd64.patch deleted file mode 100644 index 9897641..0000000 --- a/gdb-tdep-handle-pipe2-syscall-for-amd64.patch +++ /dev/null @@ -1,61 +0,0 @@ -[gdb/tdep] Handle pipe2 syscall for amd64 - -When running test-case gdb.reverse/pipe-reverse.exp on openSUSE Tumbleweed, -I run into: -... -(gdb) continue^M -Continuing.^M -Process record and replay target doesn't support syscall number 293^M -Process record: failed to record execution log.^M -^M -Program stopped.^M -0x00007ffff7daabdb in pipe () from /lib64/libc.so.6^M -(gdb) FAIL: gdb.reverse/pipe-reverse.exp: continue to breakpoint: marker2 -... - -The current glibc on Tumbleweed is 2.35, which contains commit -"linux: Implement pipe in terms of __NR_pipe2", and consequently syscall pipe2 -is used in stead of syscall pipe. - -There is already support added for syscall pipe2 for aarch64 (which only has -syscall pipe2, not syscall pipe), so enable the same for amd64, by: -- adding amd64_sys_pipe2 in enum amd64_syscall -- translating amd64_sys_pipe2 to gdb_sys_pipe2 in amd64_canonicalize_syscall - -Tested on x86_64-linux, specifically on: -- openSUSE Tumbleweed (with glibc 2.35), and -- openSUSE Leap 15.3 (with glibc 2.31). - -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29056 - ---- - gdb/amd64-linux-tdep.c | 3 +++ - gdb/amd64-linux-tdep.h | 1 + - 2 files changed, 4 insertions(+) - -diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c -index 0e5194fbeee..9a0759d639c 100644 ---- a/gdb/amd64-linux-tdep.c -+++ b/gdb/amd64-linux-tdep.c -@@ -460,6 +460,9 @@ amd64_canonicalize_syscall (enum amd64_syscall syscall_number) - case amd64_x32_sys_pipe: - return gdb_sys_pipe; - -+ case amd64_sys_pipe2: -+ return gdb_sys_pipe2; -+ - case amd64_sys_select: - case amd64_x32_sys_select: - return gdb_sys_select; -diff --git a/gdb/amd64-linux-tdep.h b/gdb/amd64-linux-tdep.h -index 4a41b3b8245..184b0c86f07 100644 ---- a/gdb/amd64-linux-tdep.h -+++ b/gdb/amd64-linux-tdep.h -@@ -320,6 +320,7 @@ enum amd64_syscall { - amd64_sys_sync_file_range = 277, - amd64_sys_vmsplice = 278, - amd64_sys_move_pages = 279, -+ amd64_sys_pipe2 = 293 - }; - - /* Enum that defines the syscall identifiers for x32 linux. diff --git a/gdb-tdep-support-catch-syscall-pipe2-for-i386.patch b/gdb-tdep-support-catch-syscall-pipe2-for-i386.patch deleted file mode 100644 index 47ef00b..0000000 --- a/gdb-tdep-support-catch-syscall-pipe2-for-i386.patch +++ /dev/null @@ -1,44 +0,0 @@ -[gdb/tdep] Support catch syscall pipe2 for i386 - -With test-case gdb.base/catch-syscall.exp and target board unix/-m32, we run -into: -... -(gdb) catch syscall pipe2^M -Unknown syscall name 'pipe2'.^M -(gdb) FAIL: gdb.base/catch-syscall.exp: determine pipe syscall: catch syscall pipe2 -... - -Fix this by: -- adding a pipe2 entry in gdb/syscalls/i386-linux.xml.in, and -- regenerating gdb/syscalls/i386-linux.xml using - "xsltproc --output i386-linux.xml apply-defaults.xsl i386-linux.xml.in". - -Tested on x86_64-linux with native and unix/-m32. - -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29056 - ---- - gdb/syscalls/i386-linux.xml | 1 + - gdb/syscalls/i386-linux.xml.in | 1 + - 2 files changed, 2 insertions(+) - -diff --git a/gdb/syscalls/i386-linux.xml b/gdb/syscalls/i386-linux.xml -index a783dd10af3..4a7a2345186 100644 ---- a/gdb/syscalls/i386-linux.xml -+++ b/gdb/syscalls/i386-linux.xml -@@ -334,4 +334,5 @@ - - - -+ - -diff --git a/gdb/syscalls/i386-linux.xml.in b/gdb/syscalls/i386-linux.xml.in -index e778ab54043..13c4d1d99d4 100644 ---- a/gdb/syscalls/i386-linux.xml.in -+++ b/gdb/syscalls/i386-linux.xml.in -@@ -337,4 +337,5 @@ - - - -+ - diff --git a/gdb-tdep-update-syscalls-ppc64-ppc-linux.xml.patch b/gdb-tdep-update-syscalls-ppc64-ppc-linux.xml.patch deleted file mode 100644 index 89fea68..0000000 --- a/gdb-tdep-update-syscalls-ppc64-ppc-linux.xml.patch +++ /dev/null @@ -1,701 +0,0 @@ -[gdb/tdep] Update syscalls/{ppc64,ppc}-linux.xml - -Regenerate syscalls/{ppc64,ppc}-linux.xml on a system with 5.14 kernel. - ---- - gdb/syscalls/ppc-linux.xml | 139 +++++++++++++++++++++++++++++- - gdb/syscalls/ppc-linux.xml.in | 140 +++++++++++++++++++++++++++++- - gdb/syscalls/ppc64-linux.xml | 140 ++++++++++++++++++++++++++++-- - gdb/syscalls/ppc64-linux.xml.in | 141 +++++++++++++++++++++++++++++-- - gdb/testsuite/gdb.base/catch-syscall.exp | 6 +- - 5 files changed, 541 insertions(+), 25 deletions(-) - -diff --git a/gdb/syscalls/ppc-linux.xml b/gdb/syscalls/ppc-linux.xml -index 328b889839a..34ba8bd4e49 100644 ---- a/gdb/syscalls/ppc-linux.xml -+++ b/gdb/syscalls/ppc-linux.xml -@@ -6,8 +6,8 @@ - are permitted in any medium without royalty provided the copyright - notice and this notice are preserved. --> - - -@@ -267,6 +267,7 @@ - - - -+ - - - -@@ -291,6 +292,9 @@ - - - -+ -+ -+ - - - -@@ -304,4 +308,135 @@ - - - -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - -diff --git a/gdb/syscalls/ppc-linux.xml.in b/gdb/syscalls/ppc-linux.xml.in -index 0c1003e311b..61c7c585453 100644 ---- a/gdb/syscalls/ppc-linux.xml.in -+++ b/gdb/syscalls/ppc-linux.xml.in -@@ -8,11 +8,12 @@ - - - - -+ - - - -@@ -270,6 +271,7 @@ - - - -+ - - - -@@ -294,6 +296,9 @@ - - - -+ -+ -+ - - - -@@ -307,4 +312,135 @@ - - - -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - -diff --git a/gdb/syscalls/ppc64-linux.xml b/gdb/syscalls/ppc64-linux.xml -index 2e46cac0684..838f73bc25e 100644 ---- a/gdb/syscalls/ppc64-linux.xml -+++ b/gdb/syscalls/ppc64-linux.xml -@@ -6,8 +6,8 @@ - are permitted in any medium without royalty provided the copyright - notice and this notice are preserved. --> - - -@@ -258,6 +258,7 @@ - - - -+ - - - -@@ -282,11 +283,132 @@ - - - -- -- -- -- -- -- -- -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - -diff --git a/gdb/syscalls/ppc64-linux.xml.in b/gdb/syscalls/ppc64-linux.xml.in -index 2a96a8d34b8..4ed80e0a41b 100644 ---- a/gdb/syscalls/ppc64-linux.xml.in -+++ b/gdb/syscalls/ppc64-linux.xml.in -@@ -8,11 +8,12 @@ - - - - -+ - - - -@@ -261,6 +262,7 @@ - - - -+ - - - -@@ -285,11 +287,132 @@ - - - -- -- -- -- -- -- -- -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - -diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp -index 939cf4876b6..3e6ed94be96 100644 ---- a/gdb/testsuite/gdb.base/catch-syscall.exp -+++ b/gdb/testsuite/gdb.base/catch-syscall.exp -@@ -621,9 +621,9 @@ proc test_catch_syscall_multi_arch {} { - - set arch1 "powerpc:common" - set arch2 "powerpc:common64" -- set syscall1_name "openat" -- set syscall2_name "unlinkat" -- set syscall_number 286 -+ set syscall1_name "fstatat64" -+ set syscall2_name "newfstatat" -+ set syscall_number 291 - test_catch_syscall_multi_arch_1 $arch1 $arch2 $syscall1_name \ - $syscall2_name $syscall_number - diff --git a/gdb-test-expr-cumulative-archer.patch b/gdb-test-expr-cumulative-archer.patch deleted file mode 100644 index 2c3fc1f..0000000 --- a/gdb-test-expr-cumulative-archer.patch +++ /dev/null @@ -1,223 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-test-expr-cumulative-archer.patch - -;; [archer-keiths-expr-cumulative+upstream] Import C++ testcases. -;;=fedoratest - -archer archer-keiths-expr-cumulative -b5a7497340b24199f0c7ba7fdf0d54d4df44d6bc - -diff --git a/gdb/testsuite/gdb.cp/namespace-nested-imports.cc b/gdb/testsuite/gdb.cp/namespace-nested-imports.cc -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/namespace-nested-imports.cc -@@ -0,0 +1,36 @@ -+namespace A -+{ -+ namespace B -+ { -+ int ab = 11; -+ } -+} -+ -+namespace C -+{ -+ namespace D -+ { -+ using namespace A::B; -+ -+ int -+ second() -+ { -+ ab; -+ return 0; -+ } -+ } -+ -+ int -+ first() -+ { -+ //ab; -+ return D::second(); -+ } -+} -+ -+int -+main() -+{ -+ //ab; -+ return C::first(); -+} -diff --git a/gdb/testsuite/gdb.cp/namespace-nested-imports.exp b/gdb/testsuite/gdb.cp/namespace-nested-imports.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/namespace-nested-imports.exp -@@ -0,0 +1,50 @@ -+# Copyright 2008 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 . -+ -+set testfile namespace-nested-imports -+set srcfile ${testfile}.cc -+set binfile [standard_output_file ${testfile}] -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { -+ untested "Couldn't compile test program" -+ return -1 -+} -+ -+# Get things started. -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+############################################ -+if ![runto_main] then { -+ perror "couldn't run to breakpoint main" -+ continue -+} -+ -+gdb_test "print ab" "No symbol .* in current context." -+ -+############################################ -+gdb_breakpoint C::first -+gdb_continue_to_breakpoint "C::first" -+ -+gdb_test "print ab" "No symbol .* in current context." -+gdb_test "print C::D::ab" "= 11" -+ -+############################################ -+gdb_breakpoint C::D::second -+gdb_continue_to_breakpoint "C::D::second" -+ -+gdb_test "print ab" "= 11" -diff --git a/gdb/testsuite/gdb.cp/namespace-no-imports.cc b/gdb/testsuite/gdb.cp/namespace-no-imports.cc -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/namespace-no-imports.cc -@@ -0,0 +1,37 @@ -+ -+namespace A -+{ -+ int _a = 11; -+ -+ namespace B{ -+ -+ int ab = 22; -+ -+ namespace C{ -+ -+ int abc = 33; -+ -+ int second(){ -+ return 0; -+ } -+ -+ } -+ -+ int first(){ -+ _a; -+ ab; -+ C::abc; -+ return C::second(); -+ } -+ } -+} -+ -+ -+int -+main() -+{ -+ A::_a; -+ A::B::ab; -+ A::B::C::abc; -+ return A::B::first(); -+} -diff --git a/gdb/testsuite/gdb.cp/namespace-no-imports.exp b/gdb/testsuite/gdb.cp/namespace-no-imports.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/namespace-no-imports.exp -@@ -0,0 +1,69 @@ -+# Copyright 2008 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 . -+ -+set testfile namespace-no-imports -+set srcfile ${testfile}.cc -+set binfile [standard_output_file ${testfile}] -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { -+ untested "Couldn't compile test program" -+ return -1 -+} -+ -+# Get things started. -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+############################################ -+if ![runto_main] then { -+ perror "couldn't run to breakpoint main" -+ continue -+} -+ -+gdb_test "print A::_a" "= 11" -+gdb_test "print A::B::ab" "= 22" -+gdb_test "print A::B::C::abc" "= 33" -+ -+gdb_test "print _a" "No symbol .* in current context." -+gdb_test "print ab" "No symbol .* in current context." -+gdb_test "print abc" "No symbol .* in current context." -+ -+############################################ -+gdb_breakpoint A::B::first -+gdb_continue_to_breakpoint "A::B::first" -+ -+gdb_test "print A::_a" "= 11" -+gdb_test "print A::B::ab" "= 22" -+gdb_test "print A::B::C::abc" "= 33" -+ -+gdb_test "print _a" "= 11" -+gdb_test "print ab" "= 22" -+gdb_test "print C::abc" "= 33" -+ -+gdb_test "print abc" "No symbol .* in current context." -+ -+############################################ -+gdb_breakpoint A::B::C::second -+gdb_continue_to_breakpoint "A::B::C::second" -+ -+gdb_test "print A::_a" "= 11" -+gdb_test "print A::B::ab" "= 22" -+gdb_test "print A::B::C::abc" "= 33" -+ -+gdb_test "print _a" "= 11" -+gdb_test "print ab" "= 22" -+gdb_test "print abc" "= 33" diff --git a/gdb-testsuite-ada-pie.patch b/gdb-testsuite-ada-pie.patch index 9999c1b..c4adb25 100644 --- a/gdb-testsuite-ada-pie.patch +++ b/gdb-testsuite-ada-pie.patch @@ -1,4 +1,8 @@ -[gdb/testsuite] Compile ada hello world for skip_ada_tests +From e9faa078c28b14386609a12d307471cb142547d6 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Fri, 21 Apr 2023 09:12:35 +0200 +Subject: [PATCH 2/5] [gdb/testsuite] Compile ada hello world for + skip_ada_tests For openSUSE Leap 15.0 with gcc-PIE installed (which makes gcc create PIE executables by default) we get: @@ -32,17 +36,16 @@ gdb/testsuite/ChangeLog: (gdb_can_compile_ada): New gdb_caching_proc. * lib/gdb.exp: Add load_lib ada.exp. (skip_ada_tests): Return 1 if !gdb_can_compile_ada. - --- gdb/testsuite/lib/ada.exp | 31 +++++++++++++++++++++++++++++++ gdb/testsuite/lib/gdb.exp | 6 ++++++ 2 files changed, 37 insertions(+) diff --git a/gdb/testsuite/lib/ada.exp b/gdb/testsuite/lib/ada.exp -index 0ffc5957c8..8370ce5b9b 100644 +index f5bf2dcbb71..48dcd00bbe3 100644 --- a/gdb/testsuite/lib/ada.exp +++ b/gdb/testsuite/lib/ada.exp -@@ -87,12 +87,43 @@ proc gdb_compile_ada_1 {source dest type options} { +@@ -85,12 +85,43 @@ proc gdb_compile_ada_1 {source dest type options} { # compile was successful. proc gdb_compile_ada {source dest type options} { @@ -87,18 +90,18 @@ index 0ffc5957c8..8370ce5b9b 100644 # used a different naming convention from many of the other gdb tests, # and this difference was preserved during the conversion to diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp -index 653f145c1c..a0f2961a75 100644 +index 31856fa3721..85c0bfb897f 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp -@@ -84,6 +84,7 @@ load_lib cache.exp +@@ -137,6 +137,7 @@ load_lib cache.exp load_lib gdb-utils.exp load_lib memory.exp load_lib check-test-names.exp +load_lib ada.exp + # The path to the GDB binary to test. global GDB - -@@ -2093,6 +2094,11 @@ proc skip_fortran_tests {} { +@@ -2450,6 +2451,11 @@ proc skip_fortran_tests {} { # Return a 1 if I don't even want to try to test ada. proc skip_ada_tests {} { @@ -110,3 +113,6 @@ index 653f145c1c..a0f2961a75 100644 return 0 } +-- +2.35.3 + diff --git a/gdb-testsuite-add-basic-lmap-for-tcl-8.6.patch b/gdb-testsuite-add-basic-lmap-for-tcl-8.6.patch new file mode 100644 index 0000000..c0b7446 --- /dev/null +++ b/gdb-testsuite-add-basic-lmap-for-tcl-8.6.patch @@ -0,0 +1,80 @@ +From f54470964a1781c0e5a92b5ff2f1979a79b4a4b1 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Mon, 24 Apr 2023 14:48:06 +0200 +Subject: [PATCH 1/9] [gdb/testsuite] Add basic lmap for tcl < 8.6 + +With test-case gdb.dwarf2/dw2-abs-hi-pc.exp and tcl 8.5, I run into: +... +ERROR: tcl error sourcing gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc.exp. +ERROR: invalid command name "lmap" + while executing +"::gdb_tcl_unknown lmap i {dw2-abs-hi-pc.c dw2-abs-hi-pc-hello.c \ + dw2-abs-hi-pc-world.c} { expr { "$srcdir/$subdir/$i" } }" +... + +Fix this by adding basic lmap support for tcl version < 8.6. + +Tested on x86_64-linux. +--- + gdb/testsuite/gdb.testsuite/lmap.exp | 20 ++++++++++++++++++++ + gdb/testsuite/lib/gdb.exp | 15 +++++++++++++++ + 2 files changed, 35 insertions(+) + create mode 100644 gdb/testsuite/gdb.testsuite/lmap.exp + +diff --git a/gdb/testsuite/gdb.testsuite/lmap.exp b/gdb/testsuite/gdb.testsuite/lmap.exp +new file mode 100644 +index 00000000000..501e18bdd92 +--- /dev/null ++++ b/gdb/testsuite/gdb.testsuite/lmap.exp +@@ -0,0 +1,20 @@ ++# Copyright 2023 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 . ++ ++set one 1 ++set l1 { $one 2 } ++set res1 [lmap item $l1 {expr $item + 1}] ++gdb_assert { [lindex $res1 0] == 2 } ++gdb_assert { [lindex $res1 1] == 3 } ++gdb_assert { $item == 2 } +diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp +index b6e30204371..0b8a15f61cb 100644 +--- a/gdb/testsuite/lib/gdb.exp ++++ b/gdb/testsuite/lib/gdb.exp +@@ -1524,6 +1524,21 @@ if { [tcl_version_at_least 8 5] == 0 } { + } + } + ++if { [tcl_version_at_least 8 6] == 0 } { ++ # lmap was added in tcl 8.6. Only add if missing. ++ ++ # Note that we only implement the simple variant for now. ++ proc lmap { varname list body } { ++ set res {} ++ foreach val $list { ++ uplevel 1 "set $varname $val" ++ lappend res [uplevel 1 $body] ++ } ++ ++ return $res ++ } ++} ++ + # gdb_test_no_output [-prompt PROMPT_REGEXP] [-nopass] COMMAND [MESSAGE] + # Send a command to GDB and verify that this command generated no output. + # + +base-commit: fdf0253385db9239c44ea5a4ec879eeeae12fca1 +-- +2.35.3 + diff --git a/gdb-testsuite-add-have_host_locale.patch b/gdb-testsuite-add-have_host_locale.patch new file mode 100644 index 0000000..a4e4799 --- /dev/null +++ b/gdb-testsuite-add-have_host_locale.patch @@ -0,0 +1,148 @@ +From f26e9f1ce8e47bca399116a99ffdbf0aff9f2080 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Mon, 12 Jun 2023 18:00:10 +0200 +Subject: [PATCH 3/9] [gdb/testsuite] Add have_host_locale + +With test-case gdb.tui/pr30056.exp, I run into: +... +sh: warning: setlocale: LC_ALL: cannot change locale (C.UTF-8)^M +... +and then subsequently into: +... +WARNING: timeout in accept_gdb_output +FAIL: gdb.tui/pr30056.exp: Control-C +... + +This is on a CentOS 7 distro for powerpc64le. + +Either it has no C.UTF-8 support, or it's not installed: +... +$ locale -a | grep ^C +C +$ +... + +Fix this by: +- adding a new proc have_host_locale, and +- using it in all test-cases using setenv LC_ALL. + +Tested on powerpc64le-linux and x86_64-linux. +--- + gdb/testsuite/gdb.ada/non-ascii-latin-1.exp | 1 + + gdb/testsuite/gdb.ada/non-ascii-latin-3.exp | 1 + + gdb/testsuite/gdb.ada/non-ascii-utf-8.exp | 1 + + gdb/testsuite/gdb.base/utf8-identifiers.exp | 2 ++ + gdb/testsuite/gdb.rust/unicode.exp | 1 + + gdb/testsuite/lib/gdb.exp | 36 +++++++++++++++++++++ + 6 files changed, 42 insertions(+) + +diff --git a/gdb/testsuite/gdb.ada/non-ascii-latin-1.exp b/gdb/testsuite/gdb.ada/non-ascii-latin-1.exp +index ad4ccde625b..472e049737b 100644 +--- a/gdb/testsuite/gdb.ada/non-ascii-latin-1.exp ++++ b/gdb/testsuite/gdb.ada/non-ascii-latin-1.exp +@@ -18,6 +18,7 @@ + load_lib "ada.exp" + + if { [skip_ada_tests] } { return -1 } ++if { ![have_host_locale C.UTF-8] } { return -1 } + + # Enable basic use of UTF-8. LC_ALL gets reset for each testfile. We + # want this despite the program itself using Latin-1, as this test is +diff --git a/gdb/testsuite/gdb.ada/non-ascii-latin-3.exp b/gdb/testsuite/gdb.ada/non-ascii-latin-3.exp +index f2bdd99d243..6f826427ad3 100644 +--- a/gdb/testsuite/gdb.ada/non-ascii-latin-3.exp ++++ b/gdb/testsuite/gdb.ada/non-ascii-latin-3.exp +@@ -18,6 +18,7 @@ + load_lib "ada.exp" + + if { [skip_ada_tests] } { return -1 } ++if { ![have_host_locale C.UTF-8] } { return -1 } + + # Enable basic use of UTF-8. LC_ALL gets reset for each testfile. We + # want this despite the program itself using Latin-1, as this test is +diff --git a/gdb/testsuite/gdb.ada/non-ascii-utf-8.exp b/gdb/testsuite/gdb.ada/non-ascii-utf-8.exp +index d3c1ac4d0cf..7dcfb71bbb3 100644 +--- a/gdb/testsuite/gdb.ada/non-ascii-utf-8.exp ++++ b/gdb/testsuite/gdb.ada/non-ascii-utf-8.exp +@@ -18,6 +18,7 @@ + load_lib "ada.exp" + + if { [skip_ada_tests] } { return -1 } ++if { ![have_host_locale C.UTF-8] } { return -1 } + + # Enable basic use of UTF-8. LC_ALL gets reset for each testfile. + setenv LC_ALL C.UTF-8 +diff --git a/gdb/testsuite/gdb.base/utf8-identifiers.exp b/gdb/testsuite/gdb.base/utf8-identifiers.exp +index a6ef80fb0bd..7babe237dfb 100644 +--- a/gdb/testsuite/gdb.base/utf8-identifiers.exp ++++ b/gdb/testsuite/gdb.base/utf8-identifiers.exp +@@ -21,6 +21,8 @@ + + load_lib completion-support.exp + ++if { ![have_host_locale C.UTF-8] } { return -1 } ++ + standard_testfile + + # Enable basic use of UTF-8. LC_ALL gets reset for each testfile. +diff --git a/gdb/testsuite/gdb.rust/unicode.exp b/gdb/testsuite/gdb.rust/unicode.exp +index 63ed8d1250c..185eae008f6 100644 +--- a/gdb/testsuite/gdb.rust/unicode.exp ++++ b/gdb/testsuite/gdb.rust/unicode.exp +@@ -19,6 +19,7 @@ load_lib rust-support.exp + if {[skip_rust_tests]} { + return + } ++if { ![have_host_locale C.UTF-8] } { return } + + # Non-ASCII identifiers were allowed starting in 1.53. + set v [split [rust_compiler_version] .] +diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp +index 0b8a15f61cb..cd043ce3436 100644 +--- a/gdb/testsuite/lib/gdb.exp ++++ b/gdb/testsuite/lib/gdb.exp +@@ -9452,5 +9452,41 @@ proc have_syscall { name } { + return [gdb_can_simple_compile have_syscall_$name $src object] + } + ++# Return a list of supported host locales. ++ ++gdb_caching_proc host_locales { ++ set result [remote_exec host "locale -a"] ++ set status [lindex $result 0] ++ set output [lindex $result 1] ++ ++ if { $status != 0 } { ++ return {} ++ } ++ ++ # Split into list. ++ set output [string trim $output] ++ set l [split $output \n] ++ ++ # Trim items. ++ set l [lmap v $l { string trim $v }] ++ ++ # Normalize items to lower-case. ++ set l [lmap v $l { string tolower $v }] ++ ++ return $l ++} ++ ++# Return 1 if host locale LOCALE is supported. ++ ++proc have_host_locale { locale } { ++ # Normalize to lower-case. ++ set locale [string tolower $locale] ++ # Normalize to without dash. ++ set locale [string map { "-" "" } $locale] ++ ++ set idx [lsearch [host_locales] $locale] ++ return [expr $idx != -1] ++} ++ + # Always load compatibility stuff. + load_lib future.exp +-- +2.35.3 + diff --git a/gdb-testsuite-add-kfail-in-gdb.threads-fork-plus-threads.exp.patch b/gdb-testsuite-add-kfail-in-gdb.threads-fork-plus-threads.exp.patch deleted file mode 100644 index 9bde3f6..0000000 --- a/gdb-testsuite-add-kfail-in-gdb.threads-fork-plus-threads.exp.patch +++ /dev/null @@ -1,57 +0,0 @@ -[gdb/testsuite] Add KFAIL in gdb.threads/fork-plus-threads.exp - -When running test-case gdb.threads/fork-and-threads.exp on a VM with openSUSE -Tumbleweed, with the VM bound to 1 cpu with 75% execution cap, I get: -... -(gdb) info inferiors^M - Num Description Connection Executable ^M -* 1 fork-plus-threads ^M - 11 fork-plus-threads ^M -(gdb) FAIL: gdb.threads/fork-plus-threads.exp: detach-on-fork=off: \ - only inferior 1 left -... - -The test checks that all removable inferiors are indeed removed from the -inferior list after exit, and evidently this didn't happen for inferior 11 -(which is added by fork rather than a user command, and therefore removable). - -I've investigated why that is that case, and it's because its refcount didn't -drop to 0. - -This seems like a bug to me, so add a KFAIL for this. - -Tested on x86_64-linux. - ---- - gdb/testsuite/gdb.threads/fork-plus-threads.exp | 18 +++++++++++++++--- - 1 file changed, 15 insertions(+), 3 deletions(-) - -diff --git a/gdb/testsuite/gdb.threads/fork-plus-threads.exp b/gdb/testsuite/gdb.threads/fork-plus-threads.exp -index c8e179938c6..5b2b0909a65 100644 ---- a/gdb/testsuite/gdb.threads/fork-plus-threads.exp -+++ b/gdb/testsuite/gdb.threads/fork-plus-threads.exp -@@ -119,9 +119,21 @@ proc do_test { detach-on-fork } { - gdb_test "info threads" "No threads\." \ - "no threads left" - -- gdb_test "info inferiors" \ -- "Num\[ \t\]+Description\[ \t\]+Connection\[ \t\]+Executable\[ \t\]+\r\n\\* 1 \[^\r\n\]+" \ -- "only inferior 1 left" -+ set re \ -+ [multi_line \ -+ "Num\[ \t\]+Description\[ \t\]+Connection\[ \t\]+Executable\[ \t\]+" \ -+ "\\* 1 \[^\r\n\]+"] -+ gdb_test_multiple "info inferiors" "only inferior 1 left" { -+ -re -wrap $re { -+ pass $gdb_test_name -+ } -+ -re -wrap $re.* { -+ if { ${detach-on-fork} == "off" } { -+ setup_kfail "threads/26272" *-*-* -+ } -+ fail $gdb_test_name -+ } -+ } - } - - foreach_with_prefix detach-on-fork {"on" "off"} { diff --git a/gdb-testsuite-add-new-gdb_attach-to-check-attach-command.patch b/gdb-testsuite-add-new-gdb_attach-to-check-attach-command.patch deleted file mode 100644 index 272c878..0000000 --- a/gdb-testsuite-add-new-gdb_attach-to-check-attach-command.patch +++ /dev/null @@ -1,49 +0,0 @@ -gdb: testsuite: add new gdb_attach to check "attach" command - -This commit adds new gdb_attach to centralize the failure checking of -"attach" command. Return 0 if attach failed, otherwise return 1. - -Signed-off-by: Tiezhu Yang -Change-Id: I553cf386cef60c67d38e331904b4aa01e132104a - ---- - gdb/testsuite/lib/gdb.exp | 26 ++++++++++++++++++++++++++ - 1 file changed, 26 insertions(+) - -diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp -index 25c1572a53a..5104835a2a9 100644 ---- a/gdb/testsuite/lib/gdb.exp -+++ b/gdb/testsuite/lib/gdb.exp -@@ -5146,6 +5146,32 @@ proc can_spawn_for_attach { } { - return 1 - } - -+# Centralize the failure checking of "attach" command. -+# Return 0 if attach failed, otherwise return 1. -+ -+proc gdb_attach { testpid args } { -+ parse_args { -+ {pattern ""} -+ } -+ -+ if { [llength $args] != 0 } { -+ error "Unexpected arguments: $args" -+ } -+ -+ gdb_test_multiple "attach $testpid" "attach" { -+ -re -wrap "Attaching to.*ptrace: Operation not permitted\\." { -+ unsupported "$gdb_test_name (Operation not permitted)" -+ return 0 -+ } -+ -re -wrap "$pattern" { -+ pass $gdb_test_name -+ return 1 -+ } -+ } -+ -+ return 0 -+} -+ - # Kill a progress previously started with spawn_wait_for_attach, and - # reap its wait status. PROC_SPAWN_ID is the spawn id associated with - # the process. diff --git a/gdb-testsuite-add-xfail-in-gdb.arch-i386-pkru.exp.patch b/gdb-testsuite-add-xfail-in-gdb.arch-i386-pkru.exp.patch index ab67178..30ec59d 100644 --- a/gdb-testsuite-add-xfail-in-gdb.arch-i386-pkru.exp.patch +++ b/gdb-testsuite-add-xfail-in-gdb.arch-i386-pkru.exp.patch @@ -1,7 +1,7 @@ -From 1b89c346a99d89a06d9694ca4d47d040d4eebd5a Mon Sep 17 00:00:00 2001 +From 090d15fb9c7f7a48210783bddcf1d620bce6bf2a Mon Sep 17 00:00:00 2001 From: Tom de Vries -Date: Tue, 3 Jan 2023 16:41:05 +0100 -Subject: [PATCH 02/11] [gdb/testsuite] Add xfail in gdb.arch/i386-pkru.exp +Date: Fri, 21 Apr 2023 17:57:05 +0200 +Subject: [PATCH 3/5] [gdb/testsuite] Add xfail in gdb.arch/i386-pkru.exp On a x86_64-linux machine with pkru register, I run into: ... @@ -30,7 +30,7 @@ Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29790 2 files changed, 89 insertions(+), 4 deletions(-) diff --git a/gdb/testsuite/gdb.arch/i386-pkru.exp b/gdb/testsuite/gdb.arch/i386-pkru.exp -index 7724a579631..5fe93db9b4b 100644 +index f5d74380a61..5d2b1a24a15 100644 --- a/gdb/testsuite/gdb.arch/i386-pkru.exp +++ b/gdb/testsuite/gdb.arch/i386-pkru.exp @@ -58,6 +58,26 @@ if { !$supports_pkru } { @@ -94,12 +94,12 @@ index 7724a579631..5fe93db9b4b 100644 -gdb_test "print /x rd_value" "= 0x44444444" "variable after reading pkru" +gdb_test "print /x rd_value" "= $xval" "variable after reading pkru" diff --git a/gdb/testsuite/lib/gdb-utils.exp b/gdb/testsuite/lib/gdb-utils.exp -index ffdfb75557c..294d0998632 100644 +index 78724f8b622..2757050fdfd 100644 --- a/gdb/testsuite/lib/gdb-utils.exp +++ b/gdb/testsuite/lib/gdb-utils.exp -@@ -72,3 +72,51 @@ proc style {str style} { +@@ -100,3 +100,51 @@ proc gdb_get_bp_addr { num } { } - return "\033\\\[${style}m${str}\033\\\[m" + return "" } + +# Compare the version numbers in L1 to those in L2 using OP, and return diff --git a/gdb-testsuite-address-test-failures-in-gdb.mi-mi-multi-commands.exp.patch b/gdb-testsuite-address-test-failures-in-gdb.mi-mi-multi-commands.exp.patch deleted file mode 100644 index 3368ae1..0000000 --- a/gdb-testsuite-address-test-failures-in-gdb.mi-mi-multi-commands.exp.patch +++ /dev/null @@ -1,69 +0,0 @@ -gdb/testsuite: address test failures in gdb.mi/mi-multi-commands.exp - -The gdb.mi/mi-multi-commands.exp test was added in commit: - - commit d08cbc5d3203118da5583296e49273cf82378042 - Date: Wed Dec 22 12:57:44 2021 +0000 - - gdb: unbuffer all input streams when not using readline - -And then tweaked in commit: - - commit 144459531dd68a1287905079aaa131b777a8cc82 - Date: Mon Feb 7 20:35:58 2022 +0000 - - gdb/testsuite: relax pattern in new gdb.mi/mi-multi-commands.exp test - -The second of these commits was intended to address periodic test -failures that I was seeing, and this change did fix some problems, -but, unfortunately, introduced other issues. - -The problem is that the test relies on sending two commands to GDB in -a single write. As the characters that make these two commands arrive -they are echoed to GDB's console. However, there is a race between -how quickly the characters are echoed and how quickly GDB decides to -act on the incoming commands. - -Usually, both commands are echoed in full before GDB acts on the first -command, but sometimes this is not the case, and GDB can execute the -first command before both commands are fully echoed to the console. -In this case, the output of the first command will be mixed in with -the echoing of the second command. - -This mixing of the command echoing and the first command output is -what was causing failures in the original version of the test. - -The second commit relaxed the expected output pattern a little, but -was still susceptible to failures, so this commit further relaxes the -pattern. - -Now, we look for the first command output with no regard to what is -before, or after the command. Then we look for the first mi prompt to -indicate that the first command has completed. - -I believe that this change should make the test more stable than it -was before. - ---- - gdb/testsuite/gdb.mi/mi-multi-commands.exp | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -diff --git a/gdb/testsuite/gdb.mi/mi-multi-commands.exp b/gdb/testsuite/gdb.mi/mi-multi-commands.exp -index 12b1b482f9a..d00e0aaea8b 100644 ---- a/gdb/testsuite/gdb.mi/mi-multi-commands.exp -+++ b/gdb/testsuite/gdb.mi/mi-multi-commands.exp -@@ -100,9 +100,12 @@ proc run_test { args } { - set seen_second_message false - - gdb_test_multiple "" "look for first command output, command length $i" -prompt "$mi_gdb_prompt" { -- -re "\\^done,value=\"\\\\\"FIRST COMMAND\\\\\"\"\r\n" { -- pass $gdb_test_name -+ -re "\\^done,value=\"\\\\\"FIRST COMMAND\\\\\"\"" { - set seen_first_message true -+ exp_continue -+ } -+ -re "\r\n$mi_gdb_prompt" { -+ gdb_assert $seen_first_message $gdb_test_name - } - } - diff --git a/gdb-testsuite-detect-change-instead-of-init-in-gdb.mi-mi-var-block.exp.patch b/gdb-testsuite-detect-change-instead-of-init-in-gdb.mi-mi-var-block.exp.patch deleted file mode 100644 index 45b5d0b..0000000 --- a/gdb-testsuite-detect-change-instead-of-init-in-gdb.mi-mi-var-block.exp.patch +++ /dev/null @@ -1,74 +0,0 @@ -[gdb/testsuite] Detect change instead of init in gdb.mi/mi-var-block.exp - -On openSUSE Tumbleweed with target board unix/-m32, I run into: -... -PASS: gdb.mi/mi-var-block.exp: step at do_block_test 2 -Expecting: ^(-var-update \*[^M -]+)?(\^done,changelist=\[{name="foo",in_scope="true",type_changed="false",has_more="0"}, -{name="cb",in_scope="true",type_changed="false",has_more="0"}\][^M -]+[(]gdb[)] ^M -[ ]*) --var-update *^M -^done,changelist=[{name="foo",in_scope="true",type_changed="false",has_more="0"}]^M -(gdb) ^M -FAIL: gdb.mi/mi-var-block.exp: update all vars: cb foo changed (unexpected output) -... - -The problem is that the test-case attempts to detect a change in the cb -variable caused by this initialization: -... -void -do_block_tests () -{ - int cb = 12; -... -but that only works if the stack location happens to be unequal to 12 before -the initialization. - -Fix this by first initializing to 0, and then changing the value to 12: -... -- int cb = 12; -+ int cb = 0; -+ cb = 12; -... -and detecting that change. - -Tested on x86_64-linux. - -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29195 - ---- - gdb/testsuite/gdb.mi/mi-var-block.exp | 5 +++++ - gdb/testsuite/gdb.mi/var-cmd.c | 3 ++- - 2 files changed, 7 insertions(+), 1 deletion(-) - -diff --git a/gdb/testsuite/gdb.mi/mi-var-block.exp b/gdb/testsuite/gdb.mi/mi-var-block.exp -index cb94936fa86..b0707eb3530 100644 ---- a/gdb/testsuite/gdb.mi/mi-var-block.exp -+++ b/gdb/testsuite/gdb.mi/mi-var-block.exp -@@ -40,6 +40,11 @@ mi_gdb_load ${binfile} - - mi_runto do_block_tests - -+# step to "cb = 12;" -+mi_step_to "do_block_tests" "" "var-cmd.c" \ -+ [gdb_get_line_number "cb = 12;"] \ -+ "step at do_block_test 0" -+ - # Test: c_variable-3.2 - # Desc: create cb and foo - mi_create_varobj "cb" "cb" "create local variable cb" -diff --git a/gdb/testsuite/gdb.mi/var-cmd.c b/gdb/testsuite/gdb.mi/var-cmd.c -index fddb0d39a5e..f3312788a80 100644 ---- a/gdb/testsuite/gdb.mi/var-cmd.c -+++ b/gdb/testsuite/gdb.mi/var-cmd.c -@@ -207,7 +207,8 @@ subroutine1 (int i, long *l) - void - do_block_tests () - { -- int cb = 12; -+ int cb = 0; -+ cb = 12; - - { - int foo; diff --git a/gdb-testsuite-don-t-use-string-cat-in-gdb.dwarf2-dw2.patch b/gdb-testsuite-don-t-use-string-cat-in-gdb.dwarf2-dw2.patch new file mode 100644 index 0000000..cfd90eb --- /dev/null +++ b/gdb-testsuite-don-t-use-string-cat-in-gdb.dwarf2-dw2.patch @@ -0,0 +1,39 @@ +From f3a7b8d3d63005e9e0b680688d0cde0e5d4e1de9 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Mon, 24 Apr 2023 14:48:06 +0200 +Subject: [PATCH 7/9] [gdb/testsuite] Don't use string cat in + gdb.dwarf2/dw2-abs-hi-pc.exp + +Test-case gdb.dwarf2/dw2-abs-hi-pc.exp uses string cat: +... +set sources [lmap i $sources { string cat "${srcdir}/${subdir}/" $i }] +... +but that's only supported starting tcl 8.6. + +Fix this by using "expr" instead: +... +set sources [lmap i $sources { expr { "$srcdir/$subdir/$i" } }] +... + +Tested on x86_64-linux. +--- + gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc.exp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc.exp b/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc.exp +index 397cb38ceef..6e4b570c86d 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc.exp ++++ b/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc.exp +@@ -26,7 +26,8 @@ set sources \ + ${testfile}.c \ + ${testfile}-hello.c \ + ${testfile}-world.c] +-set sources [lmap i $sources { string cat "${srcdir}/${subdir}/" $i }] ++set sources [lmap i $sources { expr { "$srcdir/$subdir/$i" } }] ++ + lassign [function_range hello $sources] \ + hello_start hello_len + lassign [function_range world $sources] \ +-- +2.35.3 + diff --git a/gdb-testsuite-enable-some-test-cases-for-x86_64-m32.patch b/gdb-testsuite-enable-some-test-cases-for-x86_64-m32.patch deleted file mode 100644 index 50a7478..0000000 --- a/gdb-testsuite-enable-some-test-cases-for-x86_64-m32.patch +++ /dev/null @@ -1,430 +0,0 @@ -[gdb/testsuite] Enable some test-cases for x86_64 -m32 - -When trying to run test-case gdb.reverse/i387-env-reverse.exp for x86_64-linux -with target board unix/-m32, it's skipped. - -Fix this by using is_x86_like_target instead of istarget "i?86-*linux*". - -This exposes a number of duplicates, fix those by making the test names unique. - -Likewise in a couple of other test-cases. - -Tested on x86_64-linux with target boards unix/-m32. - ---- - gdb/testsuite/gdb.reverse/i386-precsave.exp | 2 +- - gdb/testsuite/gdb.reverse/i386-reverse.exp | 2 +- - gdb/testsuite/gdb.reverse/i387-env-reverse.exp | 121 +++++++------ - gdb/testsuite/gdb.reverse/i387-stack-reverse.exp | 214 +++++++++++------------ - 4 files changed, 166 insertions(+), 173 deletions(-) - -diff --git a/gdb/testsuite/gdb.reverse/i386-precsave.exp b/gdb/testsuite/gdb.reverse/i386-precsave.exp -index e3fc940f5d0..54580474430 100644 ---- a/gdb/testsuite/gdb.reverse/i386-precsave.exp -+++ b/gdb/testsuite/gdb.reverse/i386-precsave.exp -@@ -25,7 +25,7 @@ if ![supports_process_record] { - } - - --if ![istarget "i?86-*linux*"] then { -+if ![is_x86_like_target] then { - verbose "Skipping i386 reverse tests." - return - } -diff --git a/gdb/testsuite/gdb.reverse/i386-reverse.exp b/gdb/testsuite/gdb.reverse/i386-reverse.exp -index 68e964e863c..15c18dad205 100644 ---- a/gdb/testsuite/gdb.reverse/i386-reverse.exp -+++ b/gdb/testsuite/gdb.reverse/i386-reverse.exp -@@ -24,7 +24,7 @@ if ![supports_reverse] { - } - - --if ![istarget "i?86-*linux*"] then { -+if ![is_x86_like_target] then { - verbose "Skipping i386 reverse tests." - return - } -diff --git a/gdb/testsuite/gdb.reverse/i387-env-reverse.exp b/gdb/testsuite/gdb.reverse/i387-env-reverse.exp -index 43c493dcca9..a0a79c22ed0 100644 ---- a/gdb/testsuite/gdb.reverse/i387-env-reverse.exp -+++ b/gdb/testsuite/gdb.reverse/i387-env-reverse.exp -@@ -16,7 +16,7 @@ - # This file is part of the gdb testsuite. - - --if ![istarget "i?86-*linux*"] then { -+if ![is_x86_like_target] then { - verbose "Skipping i387 reverse float tests." - return - } -@@ -52,82 +52,79 @@ gdb_test "until $location" ".*$srcfile:$location.*" \ - "rewind to beginning of main" - gdb_test_no_output "set exec-dir forward" "set forward direction" - --# Test FPU env particularly ftag and fstatus reigters. -+with_test_prefix "forward" { -+ # Test FPU env particularly ftag and fstatus reigters. - --set location [gdb_get_line_number "TEST ENV"] --gdb_test "until $location" ".*$srcfile:$location.*asm.*nop.*" \ -- "begin testing fpu env" -+ set location [gdb_get_line_number "TEST ENV"] -+ gdb_test "until $location" ".*$srcfile:$location.*asm.*nop.*" \ -+ "begin testing fpu env" - --gdb_test "n" "asm.*fsave.*" "save FPU env in memory" --gdb_test "n" "asm.*frstor.*" "restore FPU env" --gdb_test "n" "asm.*fstsw.*" "store status word in EAX" --gdb_test "n" "asm.*fld1.*" "push st0" -+ gdb_test "n" "asm.*fsave.*" "save FPU env in memory" -+ gdb_test "n" "asm.*frstor.*" "restore FPU env" -+ gdb_test "n" "asm.*fstsw.*" "store status word in EAX" -+ gdb_test "n" "asm.*fld1.*" "push st0" - --gdb_test "info register eax" "eax *0x8040000.*\[ \t\]+.*" "verify eax == 0x8040000" --gdb_test "info register fstat" "fstat *0.*\[ \t\]+.*" "verify fstat == 0" --gdb_test "info register ftag" "ftag *0xffff.*\[ \t\]+.*" "verify ftag == 0xffff" -+ gdb_test "info register eax" "eax *0x8040000.*\[ \t\]+.*" "verify eax == 0x8040000" -+ gdb_test "info register fstat" "fstat *0.*\[ \t\]+.*" "verify fstat == 0" -+ gdb_test "info register ftag" "ftag *0xffff.*\[ \t\]+.*" "verify ftag == 0xffff" - --gdb_test "stepi" "asm.*fldl2t.*" "push st0" --gdb_test "info register fstat" "fstat *0x3800.*\[ \t\]+.*" "verify fstat == 0x3800" --gdb_test "info register ftag" "ftag *0x3fff.*\[ \t\]+.*" "verify ftag == 0x3fff" -+ gdb_test "stepi" "asm.*fldl2t.*" "step to fldl2t" -+ gdb_test "info register fstat" "fstat *0x3800.*\[ \t\]+.*" "verify fstat == 0x3800" -+ gdb_test "info register ftag" "ftag *0x3fff.*\[ \t\]+.*" "verify ftag == 0x3fff" - --gdb_test "stepi" "asm.*fldl2e.*" "push st0" --gdb_test "info register fstat" "fstat *0x3000.*\[ \t\]+.*" "verify fstat == 0x3000" --gdb_test "info register ftag" "ftag *0xfff.*\[ \t\]+.*" "verify ftag == 0xfff" -+ gdb_test "stepi" "asm.*fldl2e.*" "step to fldl2e" -+ gdb_test "info register fstat" "fstat *0x3000.*\[ \t\]+.*" "verify fstat == 0x3000" -+ gdb_test "info register ftag" "ftag *0xfff.*\[ \t\]+.*" "verify ftag == 0xfff" - --gdb_test "stepi" "asm.*fldpi.*" "push st0" --gdb_test "info register fstat" "fstat *0x2800.*\[ \t\]+.*" "verify fstat == 0x2800" --gdb_test "info register ftag" "ftag *0x3ff.*\[ \t\]+.*" "verify ftag == 0x3ff" -+ gdb_test "stepi" "asm.*fldpi.*" "step to fldpi" -+ gdb_test "info register fstat" "fstat *0x2800.*\[ \t\]+.*" "verify fstat == 0x2800" -+ gdb_test "info register ftag" "ftag *0x3ff.*\[ \t\]+.*" "verify ftag == 0x3ff" - --gdb_test "stepi" "asm.*fldlg2.*" "push st0" --gdb_test "info register fstat" "fstat *0x2000.*\[ \t\]+.*" "verify fstat == 0x2000" --gdb_test "info register ftag" "ftag *0xff.*\[ \t\]+.*" "verify ftag == 0xff" -+ gdb_test "stepi" "asm.*fldlg2.*" "step to fldlg2" -+ gdb_test "info register fstat" "fstat *0x2000.*\[ \t\]+.*" "verify fstat == 0x2000" -+ gdb_test "info register ftag" "ftag *0xff.*\[ \t\]+.*" "verify ftag == 0xff" - --gdb_test "stepi" "asm.*fldln2.*" "push st0" --gdb_test "info register fstat" "fstat *0x1800.*\[ \t\]+.*" "verify fstat == 0x1800" --gdb_test "info register ftag" "ftag *0x3f.*\[ \t\]+.*" "verify ftag == 0x3f" -+ gdb_test "stepi" "asm.*fldln2.*" "step to fldln2" -+ gdb_test "info register fstat" "fstat *0x1800.*\[ \t\]+.*" "verify fstat == 0x1800" -+ gdb_test "info register ftag" "ftag *0x3f.*\[ \t\]+.*" "verify ftag == 0x3f" - --gdb_test "stepi" "asm.*fldz.*" "push st0" --gdb_test "info register fstat" "fstat *0x1000.*\[ \t\]+.*" "verify fstat == 0x1000" --gdb_test "info register ftag" "ftag *0xf.*\[ \t\]+.*" "verify ftag == 0xf" -+ gdb_test "stepi" "asm.*fldz.*" "step to fldz" -+ gdb_test "info register fstat" "fstat *0x1000.*\[ \t\]+.*" "verify fstat == 0x1000" -+ gdb_test "info register ftag" "ftag *0xf.*\[ \t\]+.*" "verify ftag == 0xf" - --gdb_test "stepi" "asm.*nop.*" "push st0" --gdb_test "info register fstat" "fstat *0x800.*\[ \t\]+.*" "verify fstat == 0x800" --gdb_test "info register ftag" "ftag *0x7.*\[ \t\]+.*" "verify ftag == 0x7" -- -- --# move backward and ehck we get the same registers back. -- --gdb_test "reverse-stepi" "asm.*fldz.*" "push st0" --gdb_test "info register fstat" "fstat *0x1000.*\[ \t\]+.*" "verify fstat == 0x1000" --gdb_test "info register ftag" "ftag *0xf.*\[ \t\]+.*" "verify ftag == 0xf" -- --gdb_test "reverse-stepi" "asm.*fldln2.*" "push st0" --gdb_test "info register fstat" "fstat *0x1800.*\[ \t\]+.*" "verify fstat == 0x1800" --gdb_test "info register ftag" "ftag *0x3f.*\[ \t\]+.*" "verify ftag == 0x3f" -- --gdb_test "reverse-stepi" "asm.*fldlg2.*" "push st0" --gdb_test "info register fstat" "fstat *0x2000.*\[ \t\]+.*" "verify fstat == 0x2000" --gdb_test "info register ftag" "ftag *0xff.*\[ \t\]+.*" "verify ftag == 0xff" -- --gdb_test "reverse-stepi" "asm.*fldpi.*" "push st0" --gdb_test "info register fstat" "fstat *0x2800.*\[ \t\]+.*" "verify fstat == 0x2800" --gdb_test "info register ftag" "ftag *0x3ff.*\[ \t\]+.*" "verify ftag == 0x3ff" -- --gdb_test "reverse-stepi" "asm.*fldl2e.*" "push st0" --gdb_test "info register fstat" "fstat *0x3000.*\[ \t\]+.*" "verify fstat == 0x3000" --gdb_test "info register ftag" "ftag *0xfff.*\[ \t\]+.*" "verify ftag == 0xfff" -+ gdb_test "stepi" "asm.*nop.*" "step to nop" -+ gdb_test "info register fstat" "fstat *0x800.*\[ \t\]+.*" "verify fstat == 0x800" -+ gdb_test "info register ftag" "ftag *0x7.*\[ \t\]+.*" "verify ftag == 0x7" -+} - --gdb_test "reverse-stepi" "asm.*fldl2t.*" "push st0" --gdb_test "info register fstat" "fstat *0x3800.*\[ \t\]+.*" "verify fstat == 0x3800" --gdb_test "info register ftag" "ftag *0x3fff.*\[ \t\]+.*" "verify ftag == 0x3fff" -+# Move backward and check we get the same registers back. - --gdb_test "reverse-stepi" "asm.*fld1.*" "push st0" --gdb_test "info register fstat" "fstat *0.*\[ \t\]+.*" "verify fstat == 0" --gdb_test "info register ftag" "ftag *0xffff.*\[ \t\]+.*" "verify ftag == 0xffff" -+with_test_prefix "backward" { -+ gdb_test "reverse-stepi" "asm.*fldz.*" "step to fldz" -+ gdb_test "info register fstat" "fstat *0x1000.*\[ \t\]+.*" "verify fstat == 0x1000" -+ gdb_test "info register ftag" "ftag *0xf.*\[ \t\]+.*" "verify ftag == 0xf" - -+ gdb_test "reverse-stepi" "asm.*fldln2.*" "step to fldln2" -+ gdb_test "info register fstat" "fstat *0x1800.*\[ \t\]+.*" "verify fstat == 0x1800" -+ gdb_test "info register ftag" "ftag *0x3f.*\[ \t\]+.*" "verify ftag == 0x3f" - -+ gdb_test "reverse-stepi" "asm.*fldlg2.*" "step to fldlg2" -+ gdb_test "info register fstat" "fstat *0x2000.*\[ \t\]+.*" "verify fstat == 0x2000" -+ gdb_test "info register ftag" "ftag *0xff.*\[ \t\]+.*" "verify ftag == 0xff" - -+ gdb_test "reverse-stepi" "asm.*fldpi.*" "step to fldpi" -+ gdb_test "info register fstat" "fstat *0x2800.*\[ \t\]+.*" "verify fstat == 0x2800" -+ gdb_test "info register ftag" "ftag *0x3ff.*\[ \t\]+.*" "verify ftag == 0x3ff" - -+ gdb_test "reverse-stepi" "asm.*fldl2e.*" "step tp fldl2d" -+ gdb_test "info register fstat" "fstat *0x3000.*\[ \t\]+.*" "verify fstat == 0x3000" -+ gdb_test "info register ftag" "ftag *0xfff.*\[ \t\]+.*" "verify ftag == 0xfff" - -+ gdb_test "reverse-stepi" "asm.*fldl2t.*" "step to fldl2t" -+ gdb_test "info register fstat" "fstat *0x3800.*\[ \t\]+.*" "verify fstat == 0x3800" -+ gdb_test "info register ftag" "ftag *0x3fff.*\[ \t\]+.*" "verify ftag == 0x3fff" - -+ gdb_test "reverse-stepi" "asm.*fld1.*" "step to fld1" -+ gdb_test "info register fstat" "fstat *0.*\[ \t\]+.*" "verify fstat == 0" -+ gdb_test "info register ftag" "ftag *0xffff.*\[ \t\]+.*" "verify ftag == 0xffff" -+} -diff --git a/gdb/testsuite/gdb.reverse/i387-stack-reverse.exp b/gdb/testsuite/gdb.reverse/i387-stack-reverse.exp -index 9f8ff74da2b..cadd4f76035 100644 ---- a/gdb/testsuite/gdb.reverse/i387-stack-reverse.exp -+++ b/gdb/testsuite/gdb.reverse/i387-stack-reverse.exp -@@ -16,7 +16,7 @@ - # This file is part of the gdb testsuite. - - --if ![istarget "i?86-*linux*"] then { -+if ![is_x86_like_target] then { - verbose "Skipping i387 reverse float tests." - return - } -@@ -48,112 +48,108 @@ gdb_test "until $location" ".*$srcfile:$location.*" \ - "rewind to beginning of main" - gdb_test_no_output "set exec-dir forward" "set forward direction" - --# Test FPU stack. FPU stack includes st0, st1, st2, st3, st4, --# st5, st6, st7. We push 8 values to FPU stack in record mode --# and see whether all are getting recorded. -- --set location [gdb_get_line_number "test st0 register"] --gdb_test "until $location" ".*$srcfile:$location.*asm.*fld1.*" \ -- "begin test st0" --gdb_test "stepi" "asm.*fldl2t.*" "push st0 == 1" --gdb_test "info register st0" "st0 *1\[ \t\]+.*" "verify st0 == 1" -- -- --gdb_test "stepi" "asm.*fldl2e.*" "push st0 == 3.3219280948*" --gdb_test "info register st0" "st0 *3.32192.*\[ \t\]+.*" "verify st0 == 3.321928094*" --gdb_test "info register st1" "st1 *1\[ \t\]+.*" "verify st1 == 1" -- --gdb_test "stepi" "asm.*fldpi.*" "push st0 == 1.4426950406*" --gdb_test "info register st0" "st0 *1.44269.*\[ \t\]+.*" "verify st0 == 1.442695040*" --gdb_test "info register st1" "st1 *3.32192.*\[ \t\]+.*" "verify st1 == 3.3219280948*" --gdb_test "info register st2" "st2 *1\[ \t\]+.*" "verify st2 == 1" -- --gdb_test "stepi" "asm.*fldlg2.*" "push st0 == 3.14159265*" --gdb_test "info register st0" "st0 *3.14159.*\[ \t\]+.*" "verify st0 == 3.14159265*" --gdb_test "info register st1" "st1 *1.44269.*\[ \t\]+.*" "verify st1 == 1.4426950*" --gdb_test "info register st2" "st2 *3.32192.*\[ \t\]+.*" "verify st2 == 3.3219280*" --gdb_test "info register st3" "st3 *1\[ \t\]+.*" "verify st3 == 1" -- --gdb_test "stepi" "asm.*fldln2.*" "push st0 == 0.301029*" --gdb_test "info register st0" "st0 *0.30102.*\[ \t\]+.*" "verify st0 == 0.301029*" --gdb_test "info register st1" "st1 *3.14159.*\[ \t\]+.*" "verify st1 == 3.14159265*" --gdb_test "info register st2" "st2 *1.44269.*\[ \t\]+.*" "verify st2 == 1.44269506*" --gdb_test "info register st3" "st3 *3.32192.*\[ \t\]+.*" "verify st3 == 3.3219280948*" --gdb_test "info register st4" "st4 *1\[ \t\]+.*" "verify st4 == 1" -- --gdb_test "stepi" "asm.*fldz.*" "push st0 == 0.69314*" --gdb_test "info register st0" "st0 *0.69314.*\[ \t\]+.*" "verify st0 == 0.69314*" --gdb_test "info register st1" "st1 *0.30102.*\[ \t\]+.*" "verify st1 == 0.301029*" --gdb_test "info register st2" "st2 *3.14159.*\[ \t\]+.*" "verify st2 == 3.14159265*" --gdb_test "info register st3" "st3 *1.44269.*\[ \t\]+.*" "verify st3 == 1.442695040*" --gdb_test "info register st4" "st4 *3.32192.*\[ \t\]+.*" "verify st4 == 3.3219280948*" --gdb_test "info register st5" "st5 *1\[ \t\]+.*" "verify st5 == 1" -- --gdb_test "stepi" "asm.*fld1.*" "push st0 == 0" --gdb_test "info register st0" "st0 *0\[ \t\]+.*" "verify st0 == 0" --gdb_test "info register st1" "st1 *0.69314.*\[ \t\]+.*" "verify st1 == 0.69314*" --gdb_test "info register st2" "st2 *0.30102.*\[ \t\]+.*" "verify st2 == 0.301029*" --gdb_test "info register st3" "st3 *3.14159.*\[ \t\]+.*" "verify st3 == 3.14159265*" --gdb_test "info register st4" "st4 *1.44269.*\[ \t\]+.*" "verify st4 == 1.442695040*" --gdb_test "info register st5" "st5 *3.32192.*\[ \t\]+.*" "verify st5 == 3.32192809*" --gdb_test "info register st6" "st6 *1\[ \t\]+.*" "verify st6 == 1" -- --gdb_test "stepi" "asm.*nop.*" "push st0 == 0" --gdb_test "info register st0" "st0 *1\[ \t\]+.*" "verify st0 == 1" --gdb_test "info register st1" "st1 *0\[ \t\]+.*" "verify st1 == 0" --gdb_test "info register st2" "st2 *0.69314.*\[ \t\]+.*" "verify st2 == 0.69314*" --gdb_test "info register st3" "st3 *0.30102.*\[ \t\]+.*" "verify st3 == 0.301029*" --gdb_test "info register st4" "st4 *3.14159.*\[ \t\]+.*" "verify st4 == 3.14159265*" --gdb_test "info register st5" "st5 *1.44269.*\[ \t\]+.*" "verify st5 == 1.44269504*" --gdb_test "info register st6" "st6 *3.32192.*\[ \t\]+.*" "verify st6 == 3.3219280948*" --gdb_test "info register st7" "st7 *1.*" "verify st7 == 1" -- --# Now step backward, and check that st0 value reverts to zero. -- --gdb_test "reverse-stepi" "asm.*fld1.*" "undo registers, st0-st7" --gdb_test "info register st0" "st0 *0\[ \t\]+.*" "verify st0 == 0" --gdb_test "info register st1" "st1 *0.69314.*\[ \t\]+.*" "verify st1 == 0.69314*" --gdb_test "info register st2" "st2 *0.30102.*\[ \t\]+.*" "verify st2 == 0.301029*" --gdb_test "info register st3" "st3 *3.14159.*\[ \t\]+.*" "verify st3 == 3.14159265*" --gdb_test "info register st4" "st4 *1.44269.*\[ \t\]+.*" "verify st4 == 1.442695040*" --gdb_test "info register st5" "st5 *3.32192.*\[ \t\]+.*" "verify st5 == 3.3219280948*" --gdb_test "info register st6" "st6 *1\[ \t\]+.*" "verify st6 == 1" -- --gdb_test "reverse-stepi" "asm.*fldz.*" "push st0 == 0.69314*" --gdb_test "info register st0" "st0 *0.69314.*\[ \t\]+.*" "verify st0 == 0.69314*" --gdb_test "info register st1" "st1 *0.30102.*\[ \t\]+.*" "verify st1 == 0.301029*" --gdb_test "info register st2" "st2 *3.14159.*\[ \t\]+.*" "verify st2 == 3.14159265*" --gdb_test "info register st3" "st3 *1.44269.*\[ \t\]+.*" "verify st3 == 1.442695040*" --gdb_test "info register st4" "st4 *3.32192.*\[ \t\]+.*" "verify st4 == 3.3219280948*" --gdb_test "info register st5" "st5 *1\[ \t\]+.*" "verify st5 == 1" -- --gdb_test "reverse-stepi" "asm.*fldln2.*" "push st0 == 0.301029*" --gdb_test "info register st0" "st0 *0.30102.*\[ \t\]+.*" "verify st0 == 0.301029*" --gdb_test "info register st1" "st1 *3.14159.*\[ \t\]+.*" "verify st1 == 3.14159265*" --gdb_test "info register st2" "st2 *1.44269.*\[ \t\]+.*" "verify st2 == 1.442695040*" --gdb_test "info register st3" "st3 *3.32192.*\[ \t\]+.*" "verify st3 == 3.3219280948*" --gdb_test "info register st4" "st4 *1\[ \t\]+.*" "verify st4 == 1" -- --gdb_test "reverse-stepi" "asm.*fldlg2.*" "push st0 == 3.14159265*" --gdb_test "info register st0" "st0 *3.14159.*\[ \t\]+.*" "verify st0 == 3.14159265*" --gdb_test "info register st1" "st1 *1.44269.*\[ \t\]+.*" "verify st1 == 1.442695040*" --gdb_test "info register st2" "st2 *3.32192.*\[ \t\]+.*" "verify st2 == 3.3219280948*" --gdb_test "info register st3" "st3 *1\[ \t\]+.*" "verify st3 == 1" -- --gdb_test "reverse-stepi" "asm.*fldpi.*" "push st0 == 1.44269504088*" --gdb_test "info register st0" "st0 *1.44269.*\[ \t\]+.*" "verify st0 == 1.442695040*" --gdb_test "info register st1" "st1 *3.32192.*\[ \t\]+.*" "verify st1 == 3.3219280948*" --gdb_test "info register st2" "st2 *1\[ \t\]+.*" "verify st2 == 1" -- -- --gdb_test "reverse-stepi" "asm.*fldl2e.*" "push st0 == 3.3219280948*" --gdb_test "info register st0" "st0 *3.32192.*\[ \t\]+.*" "verify st0 == 3.3219280948*" --gdb_test "info register st1" "st1 *1\[ \t\]+.*" "verify st1 == 1" -- --gdb_test "reverse-stepi" "asm.*fldl2t.*" "push st0 == 1" --gdb_test "info register st0" "st0 *1\[ \t\]+.*" "verify st0 == 1" -- -- -- -- -+with_test_prefix "forward" { -+ # Test FPU stack. FPU stack includes st0, st1, st2, st3, st4, -+ # st5, st6, st7. We push 8 values to FPU stack in record mode -+ # and see whether all are getting recorded. -+ -+ set location [gdb_get_line_number "test st0 register"] -+ gdb_test "until $location" ".*$srcfile:$location.*asm.*fld1.*" \ -+ "begin test st0" -+ gdb_test "stepi" "asm.*fldl2t.*" "push st0 == 1" -+ gdb_test "info register st0" "st0 *1\[ \t\]+.*" "verify st0 == 1" -+ -+ gdb_test "stepi" "asm.*fldl2e.*" "push st0 == 3.3219280948*" -+ gdb_test "info register st0" "st0 *3.32192.*\[ \t\]+.*" "verify st0 == 3.321928094*" -+ gdb_test "info register st1" "st1 *1\[ \t\]+.*" "verify st1 == 1" -+ -+ gdb_test "stepi" "asm.*fldpi.*" "push st0 == 1.4426950406*" -+ gdb_test "info register st0" "st0 *1.44269.*\[ \t\]+.*" "verify st0 == 1.442695040*" -+ gdb_test "info register st1" "st1 *3.32192.*\[ \t\]+.*" "verify st1 == 3.3219280948*" -+ gdb_test "info register st2" "st2 *1\[ \t\]+.*" "verify st2 == 1" -+ -+ gdb_test "stepi" "asm.*fldlg2.*" "push st0 == 3.14159265*" -+ gdb_test "info register st0" "st0 *3.14159.*\[ \t\]+.*" "verify st0 == 3.14159265*" -+ gdb_test "info register st1" "st1 *1.44269.*\[ \t\]+.*" "verify st1 == 1.4426950*" -+ gdb_test "info register st2" "st2 *3.32192.*\[ \t\]+.*" "verify st2 == 3.3219280*" -+ gdb_test "info register st3" "st3 *1\[ \t\]+.*" "verify st3 == 1" -+ -+ gdb_test "stepi" "asm.*fldln2.*" "push st0 == 0.301029*" -+ gdb_test "info register st0" "st0 *0.30102.*\[ \t\]+.*" "verify st0 == 0.301029*" -+ gdb_test "info register st1" "st1 *3.14159.*\[ \t\]+.*" "verify st1 == 3.14159265*" -+ gdb_test "info register st2" "st2 *1.44269.*\[ \t\]+.*" "verify st2 == 1.44269506*" -+ gdb_test "info register st3" "st3 *3.32192.*\[ \t\]+.*" "verify st3 == 3.3219280948*" -+ gdb_test "info register st4" "st4 *1\[ \t\]+.*" "verify st4 == 1" -+ -+ gdb_test "stepi" "asm.*fldz.*" "push st0 == 0.69314*" -+ gdb_test "info register st0" "st0 *0.69314.*\[ \t\]+.*" "verify st0 == 0.69314*" -+ gdb_test "info register st1" "st1 *0.30102.*\[ \t\]+.*" "verify st1 == 0.301029*" -+ gdb_test "info register st2" "st2 *3.14159.*\[ \t\]+.*" "verify st2 == 3.14159265*" -+ gdb_test "info register st3" "st3 *1.44269.*\[ \t\]+.*" "verify st3 == 1.442695040*" -+ gdb_test "info register st4" "st4 *3.32192.*\[ \t\]+.*" "verify st4 == 3.3219280948*" -+ gdb_test "info register st5" "st5 *1\[ \t\]+.*" "verify st5 == 1" -+ -+ gdb_test "stepi" "asm.*fld1.*" "push st0 == 0" -+ gdb_test "info register st0" "st0 *0\[ \t\]+.*" "verify st0 == 0" -+ gdb_test "info register st1" "st1 *0.69314.*\[ \t\]+.*" "verify st1 == 0.69314*" -+ gdb_test "info register st2" "st2 *0.30102.*\[ \t\]+.*" "verify st2 == 0.301029*" -+ gdb_test "info register st3" "st3 *3.14159.*\[ \t\]+.*" "verify st3 == 3.14159265*" -+ gdb_test "info register st4" "st4 *1.44269.*\[ \t\]+.*" "verify st4 == 1.442695040*" -+ gdb_test "info register st5" "st5 *3.32192.*\[ \t\]+.*" "verify st5 == 3.32192809*" -+ gdb_test "info register st6" "st6 *1\[ \t\]+.*" "verify st6 == 1" -+ -+ gdb_test "stepi" "asm.*nop.*" "push st0 == 1, again" -+ gdb_test "info register st0" "st0 *1\[ \t\]+.*" "verify st0 == 1, again" -+ gdb_test "info register st1" "st1 *0\[ \t\]+.*" "verify st1 == 0" -+ gdb_test "info register st2" "st2 *0.69314.*\[ \t\]+.*" "verify st2 == 0.69314*" -+ gdb_test "info register st3" "st3 *0.30102.*\[ \t\]+.*" "verify st3 == 0.301029*" -+ gdb_test "info register st4" "st4 *3.14159.*\[ \t\]+.*" "verify st4 == 3.14159265*" -+ gdb_test "info register st5" "st5 *1.44269.*\[ \t\]+.*" "verify st5 == 1.44269504*" -+ gdb_test "info register st6" "st6 *3.32192.*\[ \t\]+.*" "verify st6 == 3.3219280948*" -+ gdb_test "info register st7" "st7 *1.*" "verify st7 == 1" -+} - -+with_test_prefix "backward" { -+ # Now step backward, and check that st0 value reverts to zero. -+ gdb_test "reverse-stepi" "asm.*fld1.*" "undo registers, st0-st7" -+ gdb_test "info register st0" "st0 *0\[ \t\]+.*" "verify st0 == 0" -+ gdb_test "info register st1" "st1 *0.69314.*\[ \t\]+.*" "verify st1 == 0.69314*" -+ gdb_test "info register st2" "st2 *0.30102.*\[ \t\]+.*" "verify st2 == 0.301029*" -+ gdb_test "info register st3" "st3 *3.14159.*\[ \t\]+.*" "verify st3 == 3.14159265*" -+ gdb_test "info register st4" "st4 *1.44269.*\[ \t\]+.*" "verify st4 == 1.442695040*" -+ gdb_test "info register st5" "st5 *3.32192.*\[ \t\]+.*" "verify st5 == 3.3219280948*" -+ gdb_test "info register st6" "st6 *1\[ \t\]+.*" "verify st6 == 1" -+ -+ gdb_test "reverse-stepi" "asm.*fldz.*" "push st0 == 0.69314*" -+ gdb_test "info register st0" "st0 *0.69314.*\[ \t\]+.*" "verify st0 == 0.69314*" -+ gdb_test "info register st1" "st1 *0.30102.*\[ \t\]+.*" "verify st1 == 0.301029*" -+ gdb_test "info register st2" "st2 *3.14159.*\[ \t\]+.*" "verify st2 == 3.14159265*" -+ gdb_test "info register st3" "st3 *1.44269.*\[ \t\]+.*" "verify st3 == 1.442695040*" -+ gdb_test "info register st4" "st4 *3.32192.*\[ \t\]+.*" "verify st4 == 3.3219280948*" -+ gdb_test "info register st5" "st5 *1\[ \t\]+.*" "verify st5 == 1" -+ -+ gdb_test "reverse-stepi" "asm.*fldln2.*" "push st0 == 0.301029*" -+ gdb_test "info register st0" "st0 *0.30102.*\[ \t\]+.*" "verify st0 == 0.301029*" -+ gdb_test "info register st1" "st1 *3.14159.*\[ \t\]+.*" "verify st1 == 3.14159265*" -+ gdb_test "info register st2" "st2 *1.44269.*\[ \t\]+.*" "verify st2 == 1.442695040*" -+ gdb_test "info register st3" "st3 *3.32192.*\[ \t\]+.*" "verify st3 == 3.3219280948*" -+ gdb_test "info register st4" "st4 *1\[ \t\]+.*" "verify st4 == 1" -+ -+ gdb_test "reverse-stepi" "asm.*fldlg2.*" "push st0 == 3.14159265*" -+ gdb_test "info register st0" "st0 *3.14159.*\[ \t\]+.*" "verify st0 == 3.14159265*" -+ gdb_test "info register st1" "st1 *1.44269.*\[ \t\]+.*" "verify st1 == 1.442695040*" -+ gdb_test "info register st2" "st2 *3.32192.*\[ \t\]+.*" "verify st2 == 3.3219280948*" -+ gdb_test "info register st3" "st3 *1\[ \t\]+.*" "verify st3 == 1" -+ -+ gdb_test "reverse-stepi" "asm.*fldpi.*" "push st0 == 1.44269504088*" -+ gdb_test "info register st0" "st0 *1.44269.*\[ \t\]+.*" "verify st0 == 1.442695040*" -+ gdb_test "info register st1" "st1 *3.32192.*\[ \t\]+.*" "verify st1 == 3.3219280948*" -+ gdb_test "info register st2" "st2 *1\[ \t\]+.*" "verify st2 == 1" -+ -+ gdb_test "reverse-stepi" "asm.*fldl2e.*" "push st0 == 3.3219280948*" -+ gdb_test "info register st0" "st0 *3.32192.*\[ \t\]+.*" "verify st0 == 3.3219280948*" -+ gdb_test "info register st1" "st1 *1\[ \t\]+.*" "verify st1 == 1" -+ -+ gdb_test "reverse-stepi" "asm.*fldl2t.*" "push st0 == 1" -+ gdb_test "info register st0" "st0 *1\[ \t\]+.*" "verify st0 == 1" -+} diff --git a/gdb-testsuite-factor-out-proc-linux_kernel_version.patch b/gdb-testsuite-factor-out-proc-linux_kernel_version.patch index daf8069..95bc791 100644 --- a/gdb-testsuite-factor-out-proc-linux_kernel_version.patch +++ b/gdb-testsuite-factor-out-proc-linux_kernel_version.patch @@ -1,7 +1,7 @@ -From bbf4e4ba2a9bd73384268b0160d54e36edc92a12 Mon Sep 17 00:00:00 2001 +From 8797e6c1eb8c863617cd484d469dff23d059a15f Mon Sep 17 00:00:00 2001 From: Tom de Vries -Date: Tue, 14 Feb 2023 11:53:54 +0100 -Subject: [PATCH 03/11] [gdb/testsuite] Factor out proc linux_kernel_version +Date: Fri, 21 Apr 2023 17:58:49 +0200 +Subject: [PATCH 4/5] [gdb/testsuite] Factor out proc linux_kernel_version Factor out new proc linux_kernel_version from test-case gdb.arch/i386-pkru.exp. @@ -13,7 +13,7 @@ Tested on x86_64-linux. 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/gdb/testsuite/gdb.arch/i386-pkru.exp b/gdb/testsuite/gdb.arch/i386-pkru.exp -index 5fe93db9b4b..9bc9f9735e5 100644 +index 5d2b1a24a15..b2e5385c52b 100644 --- a/gdb/testsuite/gdb.arch/i386-pkru.exp +++ b/gdb/testsuite/gdb.arch/i386-pkru.exp @@ -62,20 +62,12 @@ if { !$supports_pkru } { @@ -44,11 +44,11 @@ index 5fe93db9b4b..9bc9f9735e5 100644 # Test pkru register at startup diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp -index 5104835a2a9..069a61038e6 100644 +index 85c0bfb897f..2be69479d70 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp -@@ -8551,5 +8551,28 @@ gdb_caching_proc has_hw_wp_support { - return $has_hw_wp_support +@@ -9334,5 +9334,28 @@ proc decompress_bz2 { bz2 } { + return $copy } +# Detect linux kernel version and return as list of 3 numbers: major, minor, diff --git a/gdb-testsuite-fix-breakpoint-regexp-in-gdb.ada-out_o.patch b/gdb-testsuite-fix-breakpoint-regexp-in-gdb.ada-out_o.patch new file mode 100644 index 0000000..e23b285 --- /dev/null +++ b/gdb-testsuite-fix-breakpoint-regexp-in-gdb.ada-out_o.patch @@ -0,0 +1,50 @@ +From 85025e0631ed4b0e8c3aa85d7561a715f142bdc6 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Mon, 12 Jun 2023 11:14:24 +0200 +Subject: [PATCH] [gdb/testsuite] Fix breakpoint regexp in + gdb.ada/out_of_line_in_inlined.exp + +With a gdb 13.2 based package on openSUSE Tumbleweed i586, I ran into: +... +(gdb) run ^M +Starting program: out_of_line_in_inlined/foo_o224_021-all ^M +[Thread debugging using libthread_db enabled]^M +Using host libthread_db library "/lib/libthread_db.so.1".^M +^M +Breakpoint 1.1, foo_o224_021.child1.child2 (s=...) at foo_o224_021.adb:26^M +26 for C of S loop^M +(gdb) FAIL: gdb.ada/out_of_line_in_inlined.exp: scenario=all: \ + run to foo_o224_021.child1.child2 +... + +I can reproduce the same issue with gdb trunk on x86_64, by using optimize=-O3 +instead of optimize=-O2. + +Fix this by using $bkptno_num_re. + +Tested on x86_64-linux. + +PR testsuite/30539 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30539 +--- + gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp b/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp +index 03092a15188..08245777d84 100644 +--- a/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp ++++ b/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp +@@ -34,7 +34,7 @@ foreach_with_prefix scenario {all minimal} { + + gdb_run_cmd + gdb_test "" \ +- "Breakpoint $decimal, ($hex in )?foo_o224_021\\.child1\\.child2 \\(s=\\.\\.\\.\\).*" \ ++ "Breakpoint ($decimal|$bkptno_num_re), ($hex in )?foo_o224_021\\.child1\\.child2 \\(s=\\.\\.\\.\\).*" \ + "run to foo_o224_021.child1.child2" + + set opt_addr_in "($hex in)?" + +base-commit: 11a41bc318ba0307248eadf29bf7d4a1af31d3a8 +-- +2.35.3 + diff --git a/gdb-testsuite-fix-buffer-overflow-in-gdb.base-signed.patch b/gdb-testsuite-fix-buffer-overflow-in-gdb.base-signed.patch new file mode 100644 index 0000000..770d23f --- /dev/null +++ b/gdb-testsuite-fix-buffer-overflow-in-gdb.base-signed.patch @@ -0,0 +1,120 @@ +From 6c09d2d14f44ac92d2509973ff6da376c248510f Mon Sep 17 00:00:00 2001 +From: Andrew Burgess +Date: Tue, 20 Dec 2022 12:51:50 +0000 +Subject: [PATCH 1/6] gdb/testsuite: fix buffer overflow in + gdb.base/signed-builtin-types.exp + +In commit: + + commit 9f50fe0835850645bd8ea9bb1efe1fe6c48dfb12 + Date: Wed Dec 7 15:55:25 2022 +0000 + + gdb/testsuite: new test for recent dwarf reader issue + +A new test (gdb.base/signed-builtin-types.exp) was added that made use +of 'info sources' to figure out if the debug information for a +particular object file had been fully expanded or not. Unfortunately +some lines of the 'info sources' output can be very long, this was +observed on some systems where the debug information for the +dynamic-linker was installed, in this case, the list of source files +associated with the dynamic linker was so long it would cause expect's +internal buffer to overflow. + +This commit switches from using 'info sources' to 'maint print +objfile', the output from the latter command is more compact, but +also, can be restricted to a single named object file. + +With this change in place I am no longer seeing buffer overflow errors +from expect when running gdb.base/signed-builtin-types.exp. +--- + .../gdb.base/signed-builtin-types.exp | 51 +++---------------- + 1 file changed, 8 insertions(+), 43 deletions(-) + +diff --git a/gdb/testsuite/gdb.base/signed-builtin-types.exp b/gdb/testsuite/gdb.base/signed-builtin-types.exp +index c7eee139c74..c4afc621cee 100644 +--- a/gdb/testsuite/gdb.base/signed-builtin-types.exp ++++ b/gdb/testsuite/gdb.base/signed-builtin-types.exp +@@ -21,7 +21,8 @@ standard_testfile .c -lib.c + + # Compile the shared library. + set srcdso [file join $srcdir $subdir $srcfile2] +-set objdso [standard_output_file lib${gdb_test_file_name}.so] ++set libname "lib${gdb_test_file_name}.so" ++set objdso [standard_output_file $libname] + if {[gdb_compile_shlib $srcdso $objdso {debug}] != ""} { + untested "failed to compile dso" + return -1 +@@ -46,46 +47,10 @@ if {[readnow]} { + # library has been fully expanded or not. Return true if the debug + # information has NOT been fully expanded (which is what we want for this + # test). +-proc shared_library_debug_not_fully_expanded {} { +- set library_expanded "" +- gdb_test_multiple "info sources" "" { +- -re "^info sources\r\n" { +- exp_continue +- } +- -re "^(\[^\r\n\]+):\r\n\\(Full debug information has not yet been read for this file\\.\\)\r\n\r\n" { +- set libname $expect_out(1,string) +- if {$libname == $::objdso} { +- set library_expanded "no" +- } +- exp_continue +- } +- -re "^(\[^\r\n\]+):\r\n\\(Objfile has no debug information\\.\\)\r\n\r\n" { +- set libname $expect_out(1,string) +- if {$libname == $::objdso} { +- # For some reason the shared library has no debug +- # information, this is not expected. +- set library_expanded "missing debug" +- } +- exp_continue +- } +- -re "^(\[^\r\n\]+):\r\n\r\n" { +- set libname $expect_out(1,string) +- if {$libname == $::objdso} { +- set library_expanded "yes" +- } +- exp_continue +- } +- -re "^$::gdb_prompt $" { +- gdb_assert {[string equal $library_expanded "yes"] \ +- || [string equal $library_expanded "no"]} \ +- $gdb_test_name +- } +- -re "^(\[^\r\n:\]*)\r\n" { +- exp_continue +- } +- } +- +- return [expr $library_expanded == "no"] ++proc assert_shared_library_debug_not_fully_expanded {} { ++ gdb_test_lines "maint print objfiles $::libname" "" \ ++ "Object file \[^\r\n\]*$::libname" \ ++ -re-not "Symtabs:" + } + + foreach_with_prefix type_name {"short" "int" "long" "char"} { +@@ -93,7 +58,7 @@ foreach_with_prefix type_name {"short" "int" "long" "char"} { + with_test_prefix "before sizeof expression" { + # Check that the debug information for the shared library has + # not yet been read in. +- gdb_assert { [shared_library_debug_not_fully_expanded] } ++ assert_shared_library_debug_not_fully_expanded + } + + # Evaluate a sizeof expression for a builtin type. At one point GDB +@@ -106,7 +71,7 @@ foreach_with_prefix type_name {"short" "int" "long" "char"} { + with_test_prefix "after sizeof expression" { + # Check that the debug information for the shared library has not + # yet been read in. +- gdb_assert { [shared_library_debug_not_fully_expanded] } ++ assert_shared_library_debug_not_fully_expanded + } + } + } + +base-commit: d5d2daa1efc67fdaaefe9648bb1275608779455d +-- +2.35.3 + diff --git a/gdb-testsuite-fix-fail-in-gdb.threads-fork-and-threads.exp.patch b/gdb-testsuite-fix-fail-in-gdb.threads-fork-and-threads.exp.patch deleted file mode 100644 index 9a6e75a..0000000 --- a/gdb-testsuite-fix-fail-in-gdb.threads-fork-and-threads.exp.patch +++ /dev/null @@ -1,144 +0,0 @@ -[gdb/testsuite] Fix FAIL in gdb.threads/fork-and-threads.exp - -As reported in PR26272, when running test-case -gdb.threads/fork-and-threads.exp on a VM with openSUSE Tumbleweed, with the VM -bound to 1 cpu with 75% execution cap, I get: -... -[Inferior 1 (process 21928) exited normally]PASS: \ - gdb.threads/fork-plus-threads.exp: detach-on-fork=off: inferior 1 exited -PASS: gdb.threads/fork-plus-threads.exp: detach-on-fork=off: \ - no failure to remove breakpoints -PASS: gdb.threads/fork-plus-threads.exp: detach-on-fork=off: \ - no spurious thread stop -^M -info threads^M - Id Target Id Frame ^M - 11.11 Thread 0x7ffff3470700 (LWP 22041) (running)^M -^M -No selected thread. See `help thread'.^M -(gdb) FAIL: gdb.threads/fork-plus-threads.exp: detach-on-fork=off: \ - no threads left -[Inferior 11 (process 21990) exited normally]^M -info inferiors^M - Num Description Connection Executable ^M -* 1 fork-plus-threads ^M - 11 fork-plus-threads ^M -(gdb) FAIL: gdb.threads/fork-plus-threads.exp: detach-on-fork=off: \ - only inferior 1 left (the program exited) -... - -The initial process (inferior 1) creates 10 child processes, and then waits on -the child processes. Consequently, the initial process is also the last -process to exit. - -However, in the log above we see: -... -[Inferior 1 (process 21928) exited normally] - ... -[Inferior 11 (process 21990) exited normally] -... -This seems counter-intuitive: if inferior 1 is the last to exit, shouldn't we -see it last? - -However, looking at the debug infrun log: -... -[infrun] fetch_inferior_event: enter - [infrun] scoped_disable_commit_resumed: reason=handling event - [infrun] do_target_wait: Found 2 inferiors, starting at #0 - [infrun] random_pending_event_thread: None found. - [infrun] print_target_wait_results: target_wait (-1.0.0 [process -1], status) = - [infrun] print_target_wait_results: 17202.17202.0 [Thread 0x7ffff7c79740 (LWP 17202)], - [infrun] print_target_wait_results: status->kind = exited, status = 0 - [infrun] handle_inferior_event: status->kind = exited, status = 0 -[Inferior 1 (process 17202) exited normally] - [infrun] stop_waiting: stop_waiting - [infrun] reset: reason=handling event - [infrun] maybe_set_commit_resumed_all_targets: enabling commit-resumed for target native - [infrun] maybe_call_commit_resumed_all_targets: calling commit_resumed for target native -[infrun] fetch_inferior_event: exit -[infrun] fetch_inferior_event: enter - [infrun] scoped_disable_commit_resumed: reason=handling event - [infrun] random_pending_event_thread: None found. - [infrun] print_target_wait_results: target_wait (-1.0.0 [process -1], status) = - [infrun] print_target_wait_results: 17215.17215.0 [Thread 0x7ffff7c79740 (LWP 17215)], - [infrun] print_target_wait_results: status->kind = exited, status = 0 - [infrun] handle_inferior_event: status->kind = exited, status = 0 -[Inferior 11 (process 17215) exited normally] -... -this seems plausible. - -Doing a waitpid with a pid of -1 will wait for any child process, and if -both inferior 1 and 11 have exited, and not yet been reaped, waitpid may -return any of the two. - -Fix the first FAIL by waiting for all inferiors to exit, rather than waiting -for inferior 1 to exit, assuming it's the last. - -Tested on x86_64-linux. - ---- - gdb/testsuite/gdb.threads/fork-plus-threads.exp | 31 ++++++++++++++----------- - 1 file changed, 17 insertions(+), 14 deletions(-) - -diff --git a/gdb/testsuite/gdb.threads/fork-plus-threads.exp b/gdb/testsuite/gdb.threads/fork-plus-threads.exp -index 7fe3c603bcd..8540fbf3082 100644 ---- a/gdb/testsuite/gdb.threads/fork-plus-threads.exp -+++ b/gdb/testsuite/gdb.threads/fork-plus-threads.exp -@@ -33,6 +33,7 @@ proc do_test { detach-on-fork } { - global GDBFLAGS - global srcfile testfile - global gdb_prompt -+ global decimal - - set saved_gdbflags $GDBFLAGS - set GDBFLAGS [concat $GDBFLAGS " -ex \"set non-stop on\""] -@@ -51,6 +52,12 @@ proc do_test { detach-on-fork } { - } - - gdb_test_no_output "set detach-on-fork ${detach-on-fork}" -+ if { ${detach-on-fork} == "on" } { -+ set expected_exits 1 -+ } else { -+ set expected_exits 11 -+ } -+ - set test "continue &" - gdb_test_multiple $test $test { - -re "$gdb_prompt " { -@@ -77,26 +84,22 @@ proc do_test { detach-on-fork } { - set saw_cannot_remove_breakpoints 0 - set saw_thread_stopped 0 - -- set test "inferior 1 exited" -- gdb_test_multiple "" $test { -- -re "Cannot remove breakpoints" { -+ set nr_exits 0 -+ gdb_test_multiple "" "last inferior exited" -lbl { -+ -re "^\r\nCannot remove breakpoints \[^\r\n\]+\\.(?=\r\n)" { - set saw_cannot_remove_breakpoints 1 - exp_continue - } -- -re "Thread \[^\r\n\]+ stopped\\." { -+ -re "^\r\n\\\[Thread \[^\r\n\]+ stopped\\.(?=\r\n)" { - set saw_thread_stopped 1 - exp_continue - } -- -re "(Thread|LWP) \[^\r\n\]+ exited" { -- # Avoid timeout with check-read1 -- exp_continue -- } -- -re "New (Thread|LWP) \[^\r\n\]+" { -- # Avoid timeout with check-read1 -- exp_continue -- } -- -re "Inferior 1 \(\[^\r\n\]+\) exited normally" { -- pass $test -+ -re "^\r\n\\\[Inferior $decimal \(\[^\r\n\]+\) exited normally\\\](?=\r\n)" { -+ incr nr_exits -+ if { $nr_exits < $expected_exits } { -+ exp_continue -+ } -+ pass $gdb_test_name - } - } - diff --git a/gdb-testsuite-fix-gdb.ada-literals.exp-with-aarch64.patch b/gdb-testsuite-fix-gdb.ada-literals.exp-with-aarch64.patch deleted file mode 100644 index a023ae3..0000000 --- a/gdb-testsuite-fix-gdb.ada-literals.exp-with-aarch64.patch +++ /dev/null @@ -1,77 +0,0 @@ -[gdb/testsuite] Fix gdb.ada/literals.exp with aarch64 - -On aarch64-linux, I run into: -... -(gdb) print 16#ffffffffffffffff#^M -$7 = 18446744073709551615^M -(gdb) FAIL: gdb.ada/literals.exp: print 16#ffffffffffffffff# -... -while on x86_64-linux instead, I get: -... -(gdb) print 16#ffffffffffffffff#^M -$7 = -1^M -(gdb) PASS: gdb.ada/literals.exp: print 16#ffffffffffffffff# -... - -We can easily reproduce this on x86_64-linux using: -... -$ gdb -q -batch -ex "set lang ada" -ex "set arch i386" \ - -ex "print 16#ffffffffffffffff#" -$1 = -1 -$ gdb -q -batch -ex "set lang ada" -ex "set arch aarch64" \ - -ex "print 16#ffffffffffffffff#" -$1 = 18446744073709551615 -... - -With i386, we have: -... -(gdb) p int_bits -$3 = 32 -(gdb) p long_bits -$4 = 32 -(gdb) p long_long_bits -$5 = 64 -... -and so in processInt we hit the fits-in-unsigned-long-long case where we use -as type long long: -... - /* Note: Interprets ULLONG_MAX as -1. */ - yylval.typed_val.type = type_long_long (par_state); -... - -With aarch64, we have instead: -... -(gdb) p int_bits -$1 = 32 -(gdb) p long_bits -$2 = 64 -(gdb) p long_long_bits -$3 = 64 -... -and so in processInt we hit the fits-in-unsigned-long case where we use -as type unsigned long: -... - yylval.typed_val.type - = builtin_type (par_state->gdbarch ())->builtin_unsigned_long; -... - -Fix this by updating the test-case to accept 18446744073709551615 as well. - -Tested on x86_64-linux and aarch64-linux. - -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29416 - ---- - gdb/testsuite/gdb.ada/literals.exp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gdb/testsuite/gdb.ada/literals.exp b/gdb/testsuite/gdb.ada/literals.exp -index a6ac89b540f..744a6bc573c 100644 ---- a/gdb/testsuite/gdb.ada/literals.exp -+++ b/gdb/testsuite/gdb.ada/literals.exp -@@ -36,4 +36,4 @@ gdb_test "print 16#f#e1" " = 240" - gdb_test "print 16#1#e10" " = 1099511627776" - - gdb_test "print/x 16#7fffffffffffffff#" " = 0x7fffffffffffffff" --gdb_test "print 16#ffffffffffffffff#" " = -1" -+gdb_test "print 16#ffffffffffffffff#" " = (-1|18446744073709551615)" diff --git a/gdb-testsuite-fix-gdb.base-break-idempotent.exp-on-ppc.patch b/gdb-testsuite-fix-gdb.base-break-idempotent.exp-on-ppc.patch deleted file mode 100644 index 48b6350..0000000 --- a/gdb-testsuite-fix-gdb.base-break-idempotent.exp-on-ppc.patch +++ /dev/null @@ -1,93 +0,0 @@ -gdb/testsuite: fix gdb.base/break-idempotent.exp on ppc - -When running the gdb.base/break-idempotent.exp test on ppc, I was -seeing some test failures (or rather errors), that looked like this: - - (gdb) watch local - Hardware watchpoint 2: local - - has_hw_wp_support: Hardware watchpoint detected - ERROR: no fileid for gcc2-power8 - ERROR: Couldn't send delete breakpoints to GDB. - ERROR OCCURED: can't read "gdb_spawn_id": no such variable - while executing - "expect { - -i 1000 -timeout 100 - -re ".*A problem internal to GDB has been detected" { - fail "$message (GDB internal error)" - gdb_internal_erro..." - ("uplevel" body line 1) - invoked from within - -What happens is that in break-idempotent.exp we basically do this: - - if {[prepare_for_testing "failed to prepare" $binfile $srcfile $opts]} { - continue - } - - # .... - - if {![skip_hw_watchpoint_tests]} { - test_break $always_inserted "watch" - } - -The problem with this is that skip_hw_watchpoint_tests, includes this: - - if { [istarget "i?86-*-*"] - || [istarget "x86_64-*-*"] - || [istarget "ia64-*-*"] - || [istarget "arm*-*-*"] - || [istarget "aarch64*-*-*"] - || ([istarget "powerpc*-*-linux*"] && [has_hw_wp_support]) - || [istarget "s390*-*-*"] } { - return 0 - } - -For powerpc only we call has_hw_wp_support. This is a caching proc -that runs a test within GDB to detect if we have hardware watchpoint -support or not. - -Unfortunately, to run this test we restart GDB, and when the test has -completed, we exit GDB. This means that in break-idempotent.exp, when -we call skip_hw_watchpoint_tests for the first time on powerpc, GDB -will unexpectedly be exited. When we later call delete_breakpoints we -see the errors I reported above. - -The fix is to call skip_hw_watchpoint_tests early, before we start GDB -as part of the break-idempotent.exp script, and store the result in a -variable, we can then check this variable in the script as needed. - -After this change break-idempotent.exp runs fine on powerpc. - -Co-authored-by: Andrew Burgess - ---- - gdb/testsuite/gdb.base/break-idempotent.exp | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/gdb/testsuite/gdb.base/break-idempotent.exp b/gdb/testsuite/gdb.base/break-idempotent.exp -index 29002f103a8..837ac000b57 100644 ---- a/gdb/testsuite/gdb.base/break-idempotent.exp -+++ b/gdb/testsuite/gdb.base/break-idempotent.exp -@@ -36,6 +36,12 @@ - - standard_testfile - -+# The skip_hw_watchpoint_tests starts GDB on a small test program to -+# check if HW watchpoints are supported. We do not want to restart -+# GDB after this test script has itself started GDB, so call -+# skip_hw_watchpoint_tests first and cache the result. -+set skip_hw_watchpoint_tests_p [skip_hw_watchpoint_tests] -+ - # Force a breakpoint re-set in GDB. Currently this is done by - # reloading symbols with the "file" command. - -@@ -174,7 +180,7 @@ foreach_with_prefix pie { "nopie" "pie" } { - test_break $always_inserted "hbreak" - } - -- if {![skip_hw_watchpoint_tests]} { -+ if {!$skip_hw_watchpoint_tests_p} { - test_break $always_inserted "watch" - } - diff --git a/gdb-testsuite-fix-gdb.base-catch-syscall.exp-with-with-expat-no.patch b/gdb-testsuite-fix-gdb.base-catch-syscall.exp-with-with-expat-no.patch deleted file mode 100644 index e7d8b0a..0000000 --- a/gdb-testsuite-fix-gdb.base-catch-syscall.exp-with-with-expat-no.patch +++ /dev/null @@ -1,88 +0,0 @@ -[gdb/testsuite] Fix gdb.base/catch-syscall.exp with --with-expat=no - -When doing a gdb build with --with-expat=no, I run into: -... -(gdb) PASS: gdb.base/catch-syscall.exp: determine pipe syscall: \ - continue to breakpoint: before pipe call -catch syscall pipe^M -Unknown syscall name 'pipe'.^M -(gdb) PASS: gdb.base/catch-syscall.exp: determine pipe syscall: \ - catch syscall pipe -catch syscall pipe2^M -Unknown syscall name 'pipe2'.^M -(gdb) PASS: gdb.base/catch-syscall.exp: determine pipe syscall: \ - catch syscall pipe2 -continue^M -Continuing.^M -[Detaching after vfork from child process 18538]^M -[Inferior 1 (process 18537) exited normally]^M -(gdb) FAIL: gdb.base/catch-syscall.exp: determine pipe syscall: continue -... - -This is a regression since recent commit 5463a15c18b ("[gdb/testsuite] Handle -pipe2 syscall in gdb.base/catch-syscall.exp"). - -Fix this by using pipe/pipe2 syscall numbers instead. - -Tested on x86_64-linux. - ---- - gdb/testsuite/gdb.base/catch-syscall.exp | 16 ++++++++++------ - 1 file changed, 10 insertions(+), 6 deletions(-) - -diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp -index 1260a64270f..d8b6898b3e0 100644 ---- a/gdb/testsuite/gdb.base/catch-syscall.exp -+++ b/gdb/testsuite/gdb.base/catch-syscall.exp -@@ -705,10 +705,12 @@ proc setup_all_syscalls {} { - # SYS_pipe doesn't exist on aarch64 kernel. - set test "check SYS_pipe" - set have_SYS_pipe 0 -+ set SYS_pipe -1 - gdb_test_multiple "p pipe_syscall" $test { -- -re -wrap " = $decimal" { -+ -re -wrap " = ($decimal)" { - pass $test - set have_SYS_pipe 1 -+ set SYS_pipe $expect_out(1,string) - } - -re -wrap "No symbol .*" { - pass $test -@@ -717,10 +719,12 @@ proc setup_all_syscalls {} { - - set test "check SYS_pipe2" - set have_SYS_pipe2 0 -+ set SYS_pipe2 -1 - gdb_test_multiple "p pipe2_syscall" $test { -- -re -wrap " = $decimal" { -+ -re -wrap " = ($decimal)" { - pass $test - set have_SYS_pipe2 1 -+ set SYS_pipe2 $expect_out(1,string) - } - -re -wrap "No symbol .*" { - pass $test -@@ -736,19 +740,19 @@ proc setup_all_syscalls {} { - gdb_test "break $line" - gdb_continue_to_breakpoint "before pipe call" - if { $have_SYS_pipe } { -- gdb_test "catch syscall pipe" -+ gdb_test "catch syscall $SYS_pipe" - } - if { $have_SYS_pipe2 } { -- gdb_test "catch syscall pipe2" -+ gdb_test "catch syscall $SYS_pipe2" - } - set ok 0 - gdb_test_multiple "continue" "" { -- -re -wrap "Catchpoint $decimal \\(call to syscall pipe\\).*" { -+ -re -wrap "Catchpoint $decimal \\(call to syscall (pipe|$SYS_pipe)\\).*" { - lappend all_syscalls pipe - pass $gdb_test_name - set ok 1 - } -- -re -wrap "Catchpoint $decimal \\(call to syscall pipe2\\).*" { -+ -re -wrap "Catchpoint $decimal \\(call to syscall (pipe2|$SYS_pipe)\\).*" { - lappend all_syscalls pipe2 - pass $gdb_test_name - set ok 1 diff --git a/gdb-testsuite-fix-gdb.base-catch-syscall.exp-without-enable-targets.patch b/gdb-testsuite-fix-gdb.base-catch-syscall.exp-without-enable-targets.patch deleted file mode 100644 index ea8b7f9..0000000 --- a/gdb-testsuite-fix-gdb.base-catch-syscall.exp-without-enable-targets.patch +++ /dev/null @@ -1,65 +0,0 @@ -[gdb/testsuite] Fix gdb.base/catch-syscall.exp without --enable-targets - -When doing a gdb build without --enable-targets, I run into: -... -(gdb) UNSUPPORTED: gdb.base/catch-syscall.exp: multiple targets: \ - s390:31-bit vs s390:64-bit: set architecture s390:64-bit -delete breakpoints^M -(gdb) info breakpoints^M -No breakpoints or watchpoints.^M -(gdb) break -qualified main^M -No symbol table is loaded. Use the "file" command.^M -Make breakpoint pending on future shared library load? (y or [n]) n^M -(gdb) FAIL: gdb.base/catch-syscall.exp: gdb_breakpoint: set breakpoint at main -... - -The problem is that due to recent commit e21d8399303 ("[gdb/testsuite] Remove -target limits in gdb.base/catch-syscall.exp") "clean_restart $binfile" no -longer is called at the end of test_catch_syscall_multi_arch. - -Fix this by moving "clean_restart $binfile" back to -test_catch_syscall_multi_arch. - -Tested on x86_64-linux. - ---- - gdb/testsuite/gdb.base/catch-syscall.exp | 8 +++++--- - 1 file changed, 5 insertions(+), 3 deletions(-) - -diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp -index fed0e7b774c..1260a64270f 100644 ---- a/gdb/testsuite/gdb.base/catch-syscall.exp -+++ b/gdb/testsuite/gdb.base/catch-syscall.exp -@@ -568,7 +568,7 @@ proc test_catch_syscall_with_wrong_args_noxml {} { - proc test_catch_syscall_multi_arch_1 { - arch1 arch2 syscall1_name syscall2_name syscall_number - } { -- global decimal binfile -+ global decimal - - with_test_prefix "multiple targets: $arch1 vs $arch2" { - # We are not interested in loading any binary here, and in -@@ -605,12 +605,12 @@ proc test_catch_syscall_multi_arch_1 { - gdb_test "catch syscall $syscall_number" \ - "Catchpoint $decimal \\(syscall .${syscall2_name}. \\\[${syscall_number}\\\]\\)" \ - "insert catch syscall on syscall $syscall_number -- $syscall2_name on $arch2" -- -- clean_restart $binfile - } - } - - proc test_catch_syscall_multi_arch {} { -+ global binfile -+ - set arch1 "i386" - set arch2 "i386:x86-64" - set syscall1_name "exit" -@@ -650,6 +650,8 @@ proc test_catch_syscall_multi_arch {} { - set syscall_number 142 - test_catch_syscall_multi_arch_1 $arch1 $arch2 $syscall1_name \ - $syscall2_name $syscall_number -+ -+ clean_restart $binfile - } - - proc do_syscall_tests_without_xml {} { diff --git a/gdb-testsuite-fix-gdb.base-infoline-reloc-main-from-.patch b/gdb-testsuite-fix-gdb.base-infoline-reloc-main-from-.patch deleted file mode 100644 index 34a03a4..0000000 --- a/gdb-testsuite-fix-gdb.base-infoline-reloc-main-from-.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 52ce02f7e38ed00f9e42fe4f272787652540c863 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Wed, 12 Oct 2022 16:50:16 +0200 -Subject: [PATCH 08/11] [gdb/testsuite] Fix - gdb.base/infoline-reloc-main-from-zero.exp with recent ld - -On openSUSE Tumbleweed (with ld 2.39) and test-case -gdb.base/infoline-reloc-main-from-zero.exp, I get: -... -gdb compile failed, ld: warning: infoline-reloc-main-from-zero has a LOAD \ - segment with RWX permissions -UNTESTED: gdb.base/infoline-reloc-main-from-zero.exp: \ - infoline-reloc-main-from-zero.exp -... - -Fix this by compiling with -Wl,--no-warn-rwx-segments. - -Tested on x86_64-linux. ---- - .../gdb.base/infoline-reloc-main-from-zero.exp | 10 +++++++++- - 1 file changed, 9 insertions(+), 1 deletion(-) - -diff --git a/gdb/testsuite/gdb.base/infoline-reloc-main-from-zero.exp b/gdb/testsuite/gdb.base/infoline-reloc-main-from-zero.exp -index ef5fe8c24bc..a29668c9712 100644 ---- a/gdb/testsuite/gdb.base/infoline-reloc-main-from-zero.exp -+++ b/gdb/testsuite/gdb.base/infoline-reloc-main-from-zero.exp -@@ -29,7 +29,15 @@ if [get_compiler_info] { - - # Build executable with stripped startup code and text section starting at zero - --set opts {debug "additional_flags=-nostdlib -emain -Wl,-Ttext=0x00 -Wl,-N"} -+set opts {} -+lappend opts debug -+lappend opts "additional_flags=-nostdlib -emain -Wl,-Ttext=0x00 -Wl,-N" -+ -+set ld_flags additional_flags=-Wl,--no-warn-rwx-segments -+if { [gdb_can_simple_compile ld-flags {int main () { return 0; }} executable \ -+ $ld_flags] } { -+ lappend opts $ld_flags -+} - - if {[build_executable $testfile.exp $testfile $srcfile $opts] == -1} { - untested "failed to compile" --- -2.35.3 - diff --git a/gdb-testsuite-fix-gdb.base-nested-subp-2-3-.exp-with.patch b/gdb-testsuite-fix-gdb.base-nested-subp-2-3-.exp-with.patch deleted file mode 100644 index d5d5adf..0000000 --- a/gdb-testsuite-fix-gdb.base-nested-subp-2-3-.exp-with.patch +++ /dev/null @@ -1,80 +0,0 @@ -From a95556346e4336d2d6eeba74430212e833c065fb Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Wed, 12 Oct 2022 16:50:16 +0200 -Subject: [PATCH 10/11] [gdb/testsuite] Fix gdb.base/nested-subp{2,3}.exp with - recent ld - -On openSUSE Tumbleweed (with ld 2.39) I get for test-case -gdb.base/nested-subp2.exp: -... -gdb compile failed, ld: warning: tmp.o: requires executable stack \ - (because the .note.GNU-stack section is executable) -... - -Fix this by compiling with -Wl,--no-warn-execstack. - -Likewise in gdb.base/nested-subp3.exp - -Tested on x86_64-linux. ---- - gdb/testsuite/gdb.base/nested-subp2.exp | 15 ++++++++++++--- - gdb/testsuite/gdb.base/nested-subp3.exp | 15 ++++++++++++--- - 2 files changed, 24 insertions(+), 6 deletions(-) - -diff --git a/gdb/testsuite/gdb.base/nested-subp2.exp b/gdb/testsuite/gdb.base/nested-subp2.exp -index 876b797e49d..8cb57bd1ee7 100644 ---- a/gdb/testsuite/gdb.base/nested-subp2.exp -+++ b/gdb/testsuite/gdb.base/nested-subp2.exp -@@ -29,10 +29,19 @@ if ![support_nested_function_tests] { - return -1 - } - -+set flags {} -+lappend flags debug -+lappend flags additional_flags=-std=gnu99 -+ -+set ld_flags additional_flags=-Wl,--no-warn-execstack -+if { [gdb_can_simple_compile ld-flags {int main () { return 0; }} executable \ -+ $ld_flags] } { -+ lappend flags $ld_flags -+} -+ - if { [gdb_compile "${srcdir}/${subdir}/${testcase}.c" \ -- [standard_output_file "${testcase}"] \ -- executable \ -- [list debug "additional_flags=-std=gnu99"]] != "" } { -+ [standard_output_file "${testcase}"] \ -+ executable $flags] != "" } { - return -1 - } - -diff --git a/gdb/testsuite/gdb.base/nested-subp3.exp b/gdb/testsuite/gdb.base/nested-subp3.exp -index dd236f07c8f..31da8d47f84 100644 ---- a/gdb/testsuite/gdb.base/nested-subp3.exp -+++ b/gdb/testsuite/gdb.base/nested-subp3.exp -@@ -29,10 +29,19 @@ if ![support_nested_function_tests] { - return -1 - } - -+set flags {} -+lappend flags debug -+lappend flags additional_flags=-std=gnu99 -+ -+set ld_flags additional_flags=-Wl,--no-warn-execstack -+if { [gdb_can_simple_compile ld-flags {int main () { return 0; }} executable \ -+ $ld_flags] } { -+ lappend flags $ld_flags -+} -+ - if { [gdb_compile "${srcdir}/${subdir}/${testcase}.c" \ -- [standard_output_file "${testcase}"] \ -- executable \ -- [list debug "additional_flags=-std=gnu99"]] != "" } { -+ [standard_output_file "${testcase}"] \ -+ executable $flags] != "" } { - return -1 - } - --- -2.35.3 - diff --git a/gdb-testsuite-fix-gdb.dwarf2-dw2-dir-file-name.exp-w.patch b/gdb-testsuite-fix-gdb.dwarf2-dw2-dir-file-name.exp-w.patch deleted file mode 100644 index b55d768..0000000 --- a/gdb-testsuite-fix-gdb.dwarf2-dw2-dir-file-name.exp-w.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 7ba9d8dda33a985a97c9ab922b84b894ffb2e288 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Thu, 16 Feb 2023 13:56:07 +0100 -Subject: [PATCH 11/11] [gdb/testsuite] Fix gdb.dwarf2/dw2-dir-file-name.exp - with recent ld - ---- - gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.exp | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.exp b/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.exp -index 4d3f767f597..1fc34ef387b 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.exp -+++ b/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.exp -@@ -317,6 +317,8 @@ puts -nonewline $f "\ - .byte 0x0 /* Terminator */ - " - -+puts -nonewline $f "\t.section\t.note.GNU-stack,\"\",@progbits" -+ - close $f - - set opts {} --- -2.35.3 - diff --git a/gdb-testsuite-fix-gdb.dwarf2-dw2-out-of-range-end-of-seq.exp-on-aarch64.patch b/gdb-testsuite-fix-gdb.dwarf2-dw2-out-of-range-end-of-seq.exp-on-aarch64.patch deleted file mode 100644 index b227074..0000000 --- a/gdb-testsuite-fix-gdb.dwarf2-dw2-out-of-range-end-of-seq.exp-on-aarch64.patch +++ /dev/null @@ -1,82 +0,0 @@ -[gdb/testsuite] Fix gdb.dwarf2/dw2-out-of-range-end-of-seq.exp on aarch64 - -On aarch64-linux, with test-case gdb.dwarf2/dw2-out-of-range-end-of-seq.exp I -run into: -... -(gdb) run ^M -Starting program: dw2-out-of-range-end-of-seq ^M -^M -Program received signal SIGILL, Illegal instruction.^M -main () at src/gdb/testsuite/gdb.dwarf2/main.c:1^M -1 /* This testcase is part of GDB, the GNU debugger.^M -(gdb) FAIL: gdb.dwarf2/dw2-out-of-range-end-of-seq.exp: runto: run to main -... - -There are two problems here: -- the test-case contains a hardcoded "DW_LNS_advance_pc 1" which causes the - breakpoint pointing in the middle of an insn -- the FAIL triggers on aarch64-linux, but not on x86_64-linux, because the - test-case uses 'main_label' as the address of the first and only valid entry - in the line table, and: - - on aarch64-linux, there's no prologue, so main_label and main coincide, - while - - on x86_64-linux, there's a prologue, so main_label is different from main. - -Fix these problems by: -- eliminating the use of "DW_LNS_advance_pc 1", and using - "DW_LNE_set_address $main_end" instead, and -- eliminating the use of main_label, using "DW_LNE_set_address $main_start" - instead. - -Tested on both x86_64-linux and aarch64-linux. - ---- - gdb/testsuite/gdb.dwarf2/dw2-out-of-range-end-of-seq.exp | 14 +++++++++++--- - 1 file changed, 11 insertions(+), 3 deletions(-) - -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-out-of-range-end-of-seq.exp b/gdb/testsuite/gdb.dwarf2/dw2-out-of-range-end-of-seq.exp -index f60f622067e..749755fc771 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-out-of-range-end-of-seq.exp -+++ b/gdb/testsuite/gdb.dwarf2/dw2-out-of-range-end-of-seq.exp -@@ -35,10 +35,16 @@ if !$gcc_compiled { - - standard_testfile main.c -dw.S - -+set func_info_vars [get_func_info main] -+ - set asm_file [standard_output_file $srcfile2] - Dwarf::assemble $asm_file { - declare_labels Llines - global srcdir subdir srcfile -+ global func_info_vars -+ foreach var $func_info_vars { -+ global $var -+ } - - cu {} { - compile_unit { -@@ -48,7 +54,9 @@ Dwarf::assemble $asm_file { - } { - subprogram { - {external 1 flag} -- {MACRO_AT_func {main}} -+ {name main} -+ {low_pc $main_start} -+ {high_pc $main_end addr} - } - } - } -@@ -58,11 +66,11 @@ Dwarf::assemble $asm_file { - file_name "$srcfile" 1 - - program { -- {DW_LNE_set_address main_label} -+ {DW_LNE_set_address $main_start} - {line 1} - {DW_LNS_copy} - -- {DW_LNS_advance_pc 1} -+ {DW_LNE_set_address $main_end} - {DW_LNE_end_sequence} - - {DW_LNE_set_address 0} diff --git a/gdb-testsuite-fix-gdb.dwarf2-dw2-unspecified-type-foo.c-with-m32.patch b/gdb-testsuite-fix-gdb.dwarf2-dw2-unspecified-type-foo.c-with-m32.patch deleted file mode 100644 index 48e35e2..0000000 --- a/gdb-testsuite-fix-gdb.dwarf2-dw2-unspecified-type-foo.c-with-m32.patch +++ /dev/null @@ -1,28 +0,0 @@ -[gdb/testsuite] Fix gdb.dwarf2/dw2-unspecified-type-foo.c with -m32 - -When running test-case gdb.dwarf2/dw2-unspecified-type-foo.c with target board -unix/-m32, I run into: -... -(gdb) PASS: gdb.dwarf2/dw2-unspecified-type.exp: ptype foo -p ((int (*) ()) foo) ()^M -$1 = -135698472^M -... - -Add the missing "return 0" in foo, which fixes this. - -Tested on x86_64-linux. - ---- - gdb/testsuite/gdb.dwarf2/dw2-unspecified-type-foo.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type-foo.c b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type-foo.c -index b1e3a8b98e4..c92e18b898f 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type-foo.c -+++ b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type-foo.c -@@ -19,4 +19,5 @@ int - foo (void) - { - asm ("foo_label: .globl foo_label"); -+ return 0; - } diff --git a/gdb-testsuite-fix-gdb.gdb-python-helper.exp-with-o2-.patch b/gdb-testsuite-fix-gdb.gdb-python-helper.exp-with-o2-.patch new file mode 100644 index 0000000..2884f59 --- /dev/null +++ b/gdb-testsuite-fix-gdb.gdb-python-helper.exp-with-o2-.patch @@ -0,0 +1,146 @@ +From f90de5ff0840a3807e01a250fd3379a009821a04 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Mon, 24 Apr 2023 22:08:53 +0200 +Subject: [PATCH 4/4] [gdb/testsuite] Fix gdb.gdb/python-helper.exp with -O2 + -flto + +On openSUSE Leap 15.4, with gcc 7.5.0, when building gdb with +-O2 -g -flto=auto, I run into: +... +FAIL: gdb.gdb/python-helper.exp: hit breakpoint in outer gdb +FAIL: gdb.gdb/python-helper.exp: print integer from DWARF info +FAIL: gdb.gdb/python-helper.exp: print *type->main_type +... + +Fix the first two FAILs by using $bkptno_numopt_re. + +The last FAIL is due to: +... +(outer-gdb) print *type->main_type^M +A syntax error in expression, near `->main_type'.^M +(outer-gdb) FAIL: gdb.gdb/python-helper.exp: print *type->main_type +... +because: +... +(outer-gdb) print type^M +Attempt to use a type name as an expression^M +... + +Fix this by making the test unresolved if "print type" or +"print type->main_type" doesn't succeed. + +On openSUSE Tumbleweed, with gcc 13.0.1, when building gdb with +-O2 -g -flto=auto, I run into timeouts due to the breakpoint in c_print_type +not hitting. Fix this by detecting the situation and bailing out. + +Tested on x86_64-linux. +--- + gdb/testsuite/gdb.gdb/python-helper.exp | 77 +++++++++++++++++++------ + 1 file changed, 58 insertions(+), 19 deletions(-) + +diff --git a/gdb/testsuite/gdb.gdb/python-helper.exp b/gdb/testsuite/gdb.gdb/python-helper.exp +index 8afbc0f219b..0520d5800fb 100644 +--- a/gdb/testsuite/gdb.gdb/python-helper.exp ++++ b/gdb/testsuite/gdb.gdb/python-helper.exp +@@ -127,7 +127,9 @@ proc test_python_helper {} { + # GDB, this should result in the outer GDB stopping at one of the + # breakpoints we created.. + send_inferior "print 1\n" +- gdb_test -prompt $outer_prompt_re "" "Breakpoint $decimal, value_print.*" "hit breakpoint in outer gdb" ++ gdb_test -prompt $outer_prompt_re "" \ ++ "Breakpoint $bkptno_numopt_re, value_print.*" \ ++ "hit breakpoint in outer gdb" + + # Now inspect the type of parameter VAL, this should trigger the + # pretty printers. +@@ -165,8 +167,10 @@ proc test_python_helper {} { + # information, this will include the TYPE_SPECIFIC_INT + # information. + send_inferior "print global_c.m_val\n" +- gdb_test -prompt $outer_prompt_re "" "Breakpoint $decimal, value_print.*" "print integer from DWARF info" +- ++ gdb_test -prompt $outer_prompt_re "" \ ++ "Breakpoint $bkptno_numopt_re, value_print.*" \ ++ "print integer from DWARF info" ++ + set answer [multi_line \ + "$decimal = " \ + "{name = $hex \"int\"," \ +@@ -190,23 +194,58 @@ proc test_python_helper {} { + # Send a command to the inner GDB, this should result in the outer + # GDB stopping at the value_print breakpoint again. + send_inferior "ptype global_c\n" +- gdb_test -prompt $outer_prompt_re "" "Breakpoint $bkptno_numopt_re, c_print_type.*" "hit breakpoint in outer gdb again" ++ set test "hit breakpoint in outer gdb again" ++ set in_outer_gdb 0 ++ gdb_test_multiple "" $test -prompt $outer_prompt_re { ++ -re "Breakpoint $bkptno_numopt_re, c_print_type.*\r\n$outer_prompt_re" { ++ pass $gdb_test_name ++ set in_outer_gdb 1 ++ } ++ -re "\r\n$gdb_prompt $" { ++ unsupported $gdb_test_name ++ } ++ } + +- set answer [multi_line \ +- "$decimal = " \ +- "{name = $hex \"CC\"," \ +- " code = TYPE_CODE_STRUCT," \ +- " flags = \[^\r\n\]+," \ +- " owner = $hex \\(objfile\\)," \ +- " target_type = 0x0," \ +- " flds_bnds\\.fields\\\[0\\\]:" \ +- " {m_name = $hex \"m_val\"," \ +- " m_type = $hex," \ +- " m_loc_kind = FIELD_LOC_KIND_BITPOS," \ +- " bitsize = 0," \ +- " bitpos = 0}," \ +- " cplus_stuff = $hex}"] +- gdb_test -prompt $outer_prompt_re "print *type->main_type" $answer ++ if { ! $in_outer_gdb } { ++ return 0 ++ } ++ ++ set cmd "print *type->main_type" ++ set cmd_supported 1 ++ foreach sub_expr { type type->main_type } { ++ set ok 0 ++ gdb_test_multiple "print $sub_expr" "" -prompt $outer_prompt_re { ++ -re " = \\(\[^\r\n\]+ \\*\\) $hex\r\n$outer_prompt_re" { ++ set ok 1 ++ } ++ -re "\r\n$outer_prompt_re" { ++ } ++ } ++ if { ! $ok } { ++ set cmd_supported 0 ++ break ++ } ++ } ++ ++ if { $cmd_supported } { ++ set answer [multi_line \ ++ "$decimal = " \ ++ "{name = $hex \"CC\"," \ ++ " code = TYPE_CODE_STRUCT," \ ++ " flags = \[^\r\n\]+," \ ++ " owner = $hex \\(objfile\\)," \ ++ " target_type = 0x0," \ ++ " flds_bnds\\.fields\\\[0\\\]:" \ ++ " {m_name = $hex \"m_val\"," \ ++ " m_type = $hex," \ ++ " m_loc_kind = FIELD_LOC_KIND_BITPOS," \ ++ " bitsize = 0," \ ++ " bitpos = 0}," \ ++ " cplus_stuff = $hex}"] ++ gdb_test -prompt $outer_prompt_re $cmd $answer ++ } else { ++ unsupported $cmd ++ } + + return 0 + } +-- +2.35.3 + diff --git a/gdb-testsuite-fix-gdb.mi-mi-sym-info.exp-on-opensuse-tumbleweed.patch b/gdb-testsuite-fix-gdb.mi-mi-sym-info.exp-on-opensuse-tumbleweed.patch deleted file mode 100644 index 81d47eb..0000000 --- a/gdb-testsuite-fix-gdb.mi-mi-sym-info.exp-on-opensuse-tumbleweed.patch +++ /dev/null @@ -1,39 +0,0 @@ -[gdb/testsuite] Fix gdb.mi/mi-sym-info.exp on openSUSE Tumbleweed - -On openSUSE Tumbleweed, I run into: -... -FAIL: gdb.mi/mi-sym-info.exp: List all functions from debug information only -... - -The problem is in matching this string: -... -{name="_start",type="void (void)",description="void _start(void);"} -... -using regexp fun_re, which requires a line field: -... -set fun_re \ - "\{line=\"$decimal\",name=${qstr},type=${qstr},description=${qstr}\}" -... - -Fix this by making the line field optional in fun_re. - -Tested on x86_64-linux. - ---- - gdb/testsuite/gdb.mi/mi-sym-info.exp | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/gdb/testsuite/gdb.mi/mi-sym-info.exp b/gdb/testsuite/gdb.mi/mi-sym-info.exp -index 7b936061759..2f723ece882 100644 ---- a/gdb/testsuite/gdb.mi/mi-sym-info.exp -+++ b/gdb/testsuite/gdb.mi/mi-sym-info.exp -@@ -38,7 +38,8 @@ mi_clean_restart $binfile - mi_runto_main - - set qstr "\"\[^\"\]+\"" --set fun_re "\{line=\"$decimal\",name=${qstr},type=${qstr},description=${qstr}\}" -+set fun_re \ -+ "\{(?:line=\"$decimal\",)?name=${qstr},type=${qstr},description=${qstr}\}" - set type_re "\{(?:line=\"$decimal\",)*name=${qstr}\}" - set sym_list "\\\[${fun_re}(?:,$fun_re)*\\\]" - set type_sym_list "\\\[${type_re}(?:,$type_re)*\\\]" diff --git a/gdb-testsuite-fix-gdb.opt-clobbered-registers-o2.exp-with-gcc-12.patch b/gdb-testsuite-fix-gdb.opt-clobbered-registers-o2.exp-with-gcc-12.patch deleted file mode 100644 index 446ef0f..0000000 --- a/gdb-testsuite-fix-gdb.opt-clobbered-registers-o2.exp-with-gcc-12.patch +++ /dev/null @@ -1,52 +0,0 @@ -[gdb/testsuite] Fix gdb.opt/clobbered-registers-O2.exp with gcc-12 - -When running test-case gdb.opt/clobbered-registers-O2.exp with gcc-12, I run -into: -... -(gdb) PASS: gdb.opt/clobbered-registers-O2.exp: backtracing -print operand0^M -$1 = (unsigned int *) 0x7fffffffd070^M -(gdb) print *operand0^M -$2 = 4195541^M -(gdb) FAIL: gdb.opt/clobbered-registers-O2.exp: print operand0 -... - -The problem is that starting gcc-12, the assignments to x and y in main are -optimized away: -... -int main(void) -{ - unsigned x, y; - - x = 13; - y = 14; - return (int)gen_movsd (&x, &y); -... - -Fix this by making x and y volatile. - -Note that the test-case intends to check the handling of debug info for -optimized code in function gen_movsd, so inhibiting optimization in main -doesn't interfere with that. - -Tested on x86_64-linux. - -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29161 - ---- - gdb/testsuite/gdb.opt/clobbered-registers-O2.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gdb/testsuite/gdb.opt/clobbered-registers-O2.c b/gdb/testsuite/gdb.opt/clobbered-registers-O2.c -index 7776024eb90..83cf2267d1e 100644 ---- a/gdb/testsuite/gdb.opt/clobbered-registers-O2.c -+++ b/gdb/testsuite/gdb.opt/clobbered-registers-O2.c -@@ -33,7 +33,7 @@ gen_movsd (unsigned * operand0, unsigned * operand1) - - int main(void) - { -- unsigned x, y; -+ volatile unsigned x, y; - - x = 13; - y = 14; diff --git a/gdb-testsuite-fix-gdb.python-py-breakpoint.exp-timeo.patch b/gdb-testsuite-fix-gdb.python-py-breakpoint.exp-timeo.patch new file mode 100644 index 0000000..9880746 --- /dev/null +++ b/gdb-testsuite-fix-gdb.python-py-breakpoint.exp-timeo.patch @@ -0,0 +1,73 @@ +From 911a6999884d94959551aa8e02858b6b8429f275 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 28 Feb 2023 15:50:23 +0100 +Subject: [PATCH 4/9] [gdb/testsuite] Fix gdb.python/py-breakpoint.exp timeouts + +On powerpc64le-linux, I run into two timeouts: +... +FAIL: gdb.python/py-breakpoint.exp: test_watchpoints: \ + Test watchpoint write (timeout) +FAIL: gdb.python/py-breakpoint.exp: test_bkpt_internal: \ + Test watchpoint write (timeout) +... + +In this case, hw watchpoints are not supported, and using sw watchpoints +is slow. + +Most of the time is spent in handling a try-catch, which triggers a malloc. I +think this bit is more relevant for the "catch throw" part of the test-case, +so fix the timeouts by setting the watchpoints after the try-catch. + +Tested on x86_64-linux and powerpc64le-linux. +--- + gdb/testsuite/gdb.python/py-breakpoint.c | 2 ++ + gdb/testsuite/gdb.python/py-breakpoint.exp | 6 ++++-- + 2 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/gdb/testsuite/gdb.python/py-breakpoint.c b/gdb/testsuite/gdb.python/py-breakpoint.c +index 0f791da9c27..1fb341660e9 100644 +--- a/gdb/testsuite/gdb.python/py-breakpoint.c ++++ b/gdb/testsuite/gdb.python/py-breakpoint.c +@@ -60,6 +60,8 @@ int main (int argc, char *argv[]) + /* Nothing. */ + } + ++ i = -1; /* Past throw-catch. */ ++ + for (i = 0; i < 10; i++) + { + result += multiply (foo); /* Break at multiply. */ +diff --git a/gdb/testsuite/gdb.python/py-breakpoint.exp b/gdb/testsuite/gdb.python/py-breakpoint.exp +index 397e4b31309..9ba6b837a41 100644 +--- a/gdb/testsuite/gdb.python/py-breakpoint.exp ++++ b/gdb/testsuite/gdb.python/py-breakpoint.exp +@@ -37,6 +37,8 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} ${options}] + # Skip all tests if Python scripting is not enabled. + if { [skip_python_tests] } { continue } + ++set past_throw_catch_line [gdb_get_line_number "Past throw-catch."] ++ + proc_with_prefix test_bkpt_basic { } { + global srcfile testfile hex decimal + +@@ -293,7 +295,7 @@ proc_with_prefix test_watchpoints { } { + gdb_test_no_output "set can-use-hw-watchpoints 0" "" + } + +- if {![runto_main]} { ++ if {![runto $srcfile:$::past_throw_catch_line]} { + return 0 + } + +@@ -316,7 +318,7 @@ proc_with_prefix test_bkpt_internal { } { + if {$skip_hw_watchpoint_tests_p} { + gdb_test_no_output "set can-use-hw-watchpoints 0" "" + } +- if {![runto_main]} { ++ if {![runto $srcfile:$::past_throw_catch_line]} { + return 0 + } + delete_breakpoints +-- +2.35.3 + diff --git a/gdb-testsuite-fix-gdb.reverse-i387-env-reverse.exp-for-pie.patch b/gdb-testsuite-fix-gdb.reverse-i387-env-reverse.exp-for-pie.patch deleted file mode 100644 index ddf448d..0000000 --- a/gdb-testsuite-fix-gdb.reverse-i387-env-reverse.exp-for-pie.patch +++ /dev/null @@ -1,34 +0,0 @@ -[gdb/testsuite] Fix gdb.reverse/i387-env-reverse.exp for -pie - -When running test-case gdb.reverse/i387-env-reverse.exp for x86_64-linux with -target board unix/-m32/-fPIE/-pie, we run into: -... -(gdb) PASS: gdb.reverse/i387-env-reverse.exp: push st0 -info register eax^M -eax 0x56550000 1448411136^M -(gdb) FAIL: gdb.reverse/i387-env-reverse.exp: verify eax == 0x8040000 -... - -The problem is that the tested instruction (fstsw) only sets $ax, not $eax. - -Fix this by verifying $ax instead of $eax. - -Tested on x86_64-linux with target boards unix/-m32 and unix/-m32/-fPIE/-pie. - ---- - gdb/testsuite/gdb.reverse/i387-env-reverse.exp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gdb/testsuite/gdb.reverse/i387-env-reverse.exp b/gdb/testsuite/gdb.reverse/i387-env-reverse.exp -index a0a79c22ed0..53fee0986df 100644 ---- a/gdb/testsuite/gdb.reverse/i387-env-reverse.exp -+++ b/gdb/testsuite/gdb.reverse/i387-env-reverse.exp -@@ -64,7 +64,7 @@ with_test_prefix "forward" { - gdb_test "n" "asm.*fstsw.*" "store status word in EAX" - gdb_test "n" "asm.*fld1.*" "push st0" - -- gdb_test "info register eax" "eax *0x8040000.*\[ \t\]+.*" "verify eax == 0x8040000" -+ gdb_test "info register ax" "ax *0x0.*\[ \t\]+.*" "verify eax == 0x0" - gdb_test "info register fstat" "fstat *0.*\[ \t\]+.*" "verify fstat == 0" - gdb_test "info register ftag" "ftag *0xffff.*\[ \t\]+.*" "verify ftag == 0xffff" - diff --git a/gdb-testsuite-fix-gdb.reverse-test_ioctl_tcsetsw.exp-with-libc-debuginfo.patch b/gdb-testsuite-fix-gdb.reverse-test_ioctl_tcsetsw.exp-with-libc-debuginfo.patch deleted file mode 100644 index 71aaa3c..0000000 --- a/gdb-testsuite-fix-gdb.reverse-test_ioctl_tcsetsw.exp-with-libc-debuginfo.patch +++ /dev/null @@ -1,37 +0,0 @@ -[gdb/testsuite] Fix gdb.reverse/test_ioctl_TCSETSW.exp with libc debuginfo - -When running test-case gdb.reverse/test_ioctl_TCSETSW.exp with glibc debuginfo -installed, I run into: -... -(gdb) PASS: gdb.reverse/test_ioctl_TCSETSW.exp: at TCSETSW call -step^M -__tcsetattr (fd=0, optional_actions=1, termios_p=0x7fffffffcf50) at \ - ../sysdeps/unix/sysv/linux/tcsetattr.c:45^M -45 {^M -(gdb) FAIL: gdb.reverse/test_ioctl_TCSETSW.exp: handle TCSETSW -... - -The problem is that the step is expected to step over the call to tcsetattr, -but due to glibc debuginfo being installed, we step into the call. - -Fix this by using next instead of step. - -Tested on x86_64-linux. - ---- - gdb/testsuite/gdb.reverse/test_ioctl_TCSETSW.exp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gdb/testsuite/gdb.reverse/test_ioctl_TCSETSW.exp b/gdb/testsuite/gdb.reverse/test_ioctl_TCSETSW.exp -index 86a62ebe5e5..4a81a618efc 100644 ---- a/gdb/testsuite/gdb.reverse/test_ioctl_TCSETSW.exp -+++ b/gdb/testsuite/gdb.reverse/test_ioctl_TCSETSW.exp -@@ -35,7 +35,7 @@ gdb_test "break $stop" ".*Breakpoint .*" "stop at TCSETSW" - gdb_test "continue" ".*Breakpoint .*" "at TCSETSW call" - - set test "handle TCSETSW" --gdb_test_multiple "step" $test { -+gdb_test_multiple "next" $test { - -re "Process record and replay target doesn't support ioctl request 0x.*$gdb_prompt $" { - fail $test - } diff --git a/gdb-testsuite-fix-gdb.rust-watch.exp-on-ppc64le.patch b/gdb-testsuite-fix-gdb.rust-watch.exp-on-ppc64le.patch new file mode 100644 index 0000000..1860a0d --- /dev/null +++ b/gdb-testsuite-fix-gdb.rust-watch.exp-on-ppc64le.patch @@ -0,0 +1,42 @@ +From 0eade9c77cd7582fd6fe23cee3ed569a9115a6ba Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 28 Feb 2023 13:32:23 +0100 +Subject: [PATCH 2/9] [gdb/testsuite] Fix gdb.rust/watch.exp on ppc64le + +On x86_64-linux, I have: +... +(gdb) watch -location y^M +Hardware watchpoint 2: -location y^M +(gdb) PASS: gdb.rust/watch.exp: watch -location y +... +but on powerpc64le-linux, I run into: +... +(gdb) watch -location y^M +Watchpoint 2: -location y^M +(gdb) FAIL: gdb.rust/watch.exp: watch -location y +... +due to the regexp matching "Hardware watchpoint" but not "Watchpoint": +... +gdb_test "watch -location y" ".*watchpoint .* -location .*" +... + +Fix this by making the regexp less restrictive. + +Tested on x86_64-linux and powerpc64le-linux. +--- + gdb/testsuite/gdb.rust/watch.exp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.rust/watch.exp b/gdb/testsuite/gdb.rust/watch.exp +index b709c00e394..5c4636ef7a8 100644 +--- a/gdb/testsuite/gdb.rust/watch.exp ++++ b/gdb/testsuite/gdb.rust/watch.exp +@@ -32,4 +32,4 @@ if {![runto ${srcfile}:$line]} { + } + + # Just setting a watchpoint was enough to trigger the bug. +-gdb_test "watch -location y" ".*watchpoint .* -location .*" ++gdb_test "watch -location y" ".*\[wW\]atchpoint .* -location .*" +-- +2.35.3 + diff --git a/gdb-testsuite-fix-gdb.threads-killed-outside.exp-on-aarch64.patch b/gdb-testsuite-fix-gdb.threads-killed-outside.exp-on-aarch64.patch deleted file mode 100644 index 9c25440..0000000 --- a/gdb-testsuite-fix-gdb.threads-killed-outside.exp-on-aarch64.patch +++ /dev/null @@ -1,44 +0,0 @@ -[gdb/testsuite] Fix gdb.threads/killed-outside.exp on aarch64 - -On aarch64 (and likewise on arm), I run into: -... -(gdb) PASS: gdb.threads/killed-outside.exp: get pid of inferior -Executing on target: kill -9 11516 (timeout = 300) -builtin_spawn -ignore SIGHUP kill -9 11516^M -continue^M -Continuing.^M -Unable to fetch general registers: No such process.^M -(gdb) [Thread 0xfffff7d511e0 (LWP 11518) exited]^M -^M -Program terminated with signal SIGKILL, Killed.^M -The program no longer exists.^M -FAIL: gdb.threads/killed-outside.exp: prompt after first continue (timeout) -... -due to a mismatch between the actual "No such process" line and the expected -one: -... -set no_such_process_msg "Couldn't get registers: No such process\." -... - -Fix this by updating the regexp. - -Tested on aarch64-linux, and x86_64-linux. - ---- - gdb/testsuite/gdb.threads/killed-outside.exp | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/gdb/testsuite/gdb.threads/killed-outside.exp b/gdb/testsuite/gdb.threads/killed-outside.exp -index 3d4543e088c..7fa6b26c685 100644 ---- a/gdb/testsuite/gdb.threads/killed-outside.exp -+++ b/gdb/testsuite/gdb.threads/killed-outside.exp -@@ -37,7 +37,8 @@ remote_exec target "kill -9 ${testpid}" - # Give it some time to die. - sleep 2 - --set no_such_process_msg "Couldn't get registers: No such process\." -+set regs_msg "(Couldn't get registers|Unable to fetch general registers.)" -+set no_such_process_msg "$regs_msg: No such process\." - set killed_msg "Program terminated with signal SIGKILL, Killed\." - set no_longer_exists_msg "The program no longer exists\." - set not_being_run_msg "The program is not being run\." diff --git a/gdb-testsuite-fix-have_mpx-test.patch b/gdb-testsuite-fix-have_mpx-test.patch deleted file mode 100644 index bb1b7cf..0000000 --- a/gdb-testsuite-fix-have_mpx-test.patch +++ /dev/null @@ -1,41 +0,0 @@ -[gdb/testsuite] Fix have_mpx test - -When testing on openSUSE Leap 15.4 I ran into this FAIL: -... -FAIL: gdb.arch/i386-mpx-map.exp: NULL address of the pointer -... -and likewise for all the other mpx tests. - -The problem is that have_mpx is supposed to return 0, but it doesn't because -it tries to match this output: -... -builtin_spawn -ignore SIGHUP temp/20294/have_mpx-2-20294.x^M -No MPX support^M -No MPX support^M -... -using: -... - && ![string equal $output "No MPX support\r\n"]] -... - -Fix this by matching using a regexp instead. - -Tested on x86_64-linux. - ---- - gdb/testsuite/lib/gdb.exp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp -index 3bfd59109bc..25c1572a53a 100644 ---- a/gdb/testsuite/lib/gdb.exp -+++ b/gdb/testsuite/lib/gdb.exp -@@ -8364,7 +8364,7 @@ gdb_caching_proc have_mpx { - set status [lindex $result 0] - set output [lindex $result 1] - set status [expr ($status == 0) \ -- && ![string equal $output "No MPX support\r\n"]] -+ && ![regexp "^No MPX support\r\n" $output]] - - remote_file build delete $obj - diff --git a/gdb-testsuite-fix-occasional-failure-in-gdb.mi-mi-multi-commands.exp.patch b/gdb-testsuite-fix-occasional-failure-in-gdb.mi-mi-multi-commands.exp.patch deleted file mode 100644 index 27833b6..0000000 --- a/gdb-testsuite-fix-occasional-failure-in-gdb.mi-mi-multi-commands.exp.patch +++ /dev/null @@ -1,39 +0,0 @@ -gdb/testsuite: fix occasional failure in gdb.mi/mi-multi-commands.exp - -In bug PR gdb/29036, another failure was reported for the test -gdb.mi/mi-multi-commands.exp. This test sends two commands to GDB as -a single write, and then checks that both commands are executed. - -The problem that was encountered here is that the output of the first -command, which looks like this: - - ^done,value="\"FIRST COMMAND\"" - -Is actually produced in parts, first the '^done' is printed, then the -',value="\"FIRST COMMAND\"" is printed. - -What was happening is that some characters from the second command -were being echoed after the '^done' had been printed, but before the -value part had been printed. To avoid this issue I've relaxed the -pattern that checks for the first command a little. With this fix in -place the occasional failure in this test is no longer showing up. - -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29036 - ---- - gdb/testsuite/gdb.mi/mi-multi-commands.exp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gdb/testsuite/gdb.mi/mi-multi-commands.exp b/gdb/testsuite/gdb.mi/mi-multi-commands.exp -index d00e0aaea8b..58187b15815 100644 ---- a/gdb/testsuite/gdb.mi/mi-multi-commands.exp -+++ b/gdb/testsuite/gdb.mi/mi-multi-commands.exp -@@ -100,7 +100,7 @@ proc run_test { args } { - set seen_second_message false - - gdb_test_multiple "" "look for first command output, command length $i" -prompt "$mi_gdb_prompt" { -- -re "\\^done,value=\"\\\\\"FIRST COMMAND\\\\\"\"" { -+ -re "\\^done.*,value=\"\\\\\"FIRST COMMAND\\\\\"\"" { - set seen_first_message true - exp_continue - } diff --git a/gdb-testsuite-fix-test-failure-when-building-against-readline-v7.patch b/gdb-testsuite-fix-test-failure-when-building-against-readline-v7.patch deleted file mode 100644 index ef51b6f..0000000 --- a/gdb-testsuite-fix-test-failure-when-building-against-readline-v7.patch +++ /dev/null @@ -1,50 +0,0 @@ -gdb/testsuite: fix test failure when building against readline v7 - -The test added in the commit: - - commit a6b413d24ccc5d76179bab866834e11fd6fec294 - Date: Fri Mar 11 14:44:03 2022 +0000 - - gdb: work around prompt corruption caused by bracketed-paste-mode - -Was not written with readline 7 in mind, only readline 8+. Between -readline 7 and 8 the escape sequence used to disable bracketed paste -mode changed, an additional '\r' character was added to the end. In -fact, it was the addition of this '\r' character that triggered the -issue for which the above commit is part of the solution. - -Anyway, the test tries to spot the case where the output from GDB is -not perfect, but does have the above work around applied. However, -the pattern in the test assumes that the problematic '\r' will be -present, and this is only true for readline 8+. With readline 7 the -test was failing. - -In this commit I generalise the pattern a little so that the test will -still KFAIL with readline 7. - -It's a little unfortunate that the test is KFAILing with readline 7, -as without the problematic '\r' there's actually no reason that GDB -couldn't "do the right thing" in this case, in which case, the test -would PASS, but that would require changes within GDB itself. - -My preference then is that initially we patch the test to get it -KFAILing, then in a separate commit I can modify GDB so that it can -PASS with readline 7. - ---- - gdb/testsuite/gdb.base/eof-exit.exp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gdb/testsuite/gdb.base/eof-exit.exp b/gdb/testsuite/gdb.base/eof-exit.exp -index 53a3b56dce8..c88aced9f35 100644 ---- a/gdb/testsuite/gdb.base/eof-exit.exp -+++ b/gdb/testsuite/gdb.base/eof-exit.exp -@@ -56,7 +56,7 @@ proc run_test {} { - -re "$::gdb_prompt \[^\n\]*\r\[^\n\]*quit" { - fail "$gdb_test_name (misplaced \\r)" - } -- -re "$::gdb_prompt \[^\n\]*\r\[^\n\]*\r\nquit\r\n" { -+ -re "$::gdb_prompt (?:\[^\n\]*\r)?\[^\n\]*\r\nquit\r\n" { - # For versions of readline that don't include the - # RL_STATE_EOF patch, then the 'quit' is printed on the - # subsequent line. diff --git a/gdb-testsuite-handle-init-errors-in-gdb.mi-user-selected-context-sync.exp.patch b/gdb-testsuite-handle-init-errors-in-gdb.mi-user-selected-context-sync.exp.patch deleted file mode 100644 index af95ddf..0000000 --- a/gdb-testsuite-handle-init-errors-in-gdb.mi-user-selected-context-sync.exp.patch +++ /dev/null @@ -1,45 +0,0 @@ -Index: gdb-12.1/gdb/testsuite/gdb.mi/user-selected-context-sync.exp -=================================================================== ---- gdb-12.1.orig/gdb/testsuite/gdb.mi/user-selected-context-sync.exp -+++ gdb-12.1/gdb/testsuite/gdb.mi/user-selected-context-sync.exp -@@ -393,7 +393,7 @@ proc_with_prefix test_setup { mode } { - } - - if { [mi_gdb_start "separate-mi-tty"] != 0 } { -- return -+ return -1 - } - } - -@@ -402,7 +402,7 @@ proc_with_prefix test_setup { mode } { - mi_gdb_load $binfile - - if { [mi_runto_main] < 0 } { -- return -+ return -1 - } - - # When using mi_expect_stop, we don't expect a prompt after the *stopped -@@ -443,6 +443,8 @@ proc_with_prefix test_setup { mode } { - # Prepare the second inferior for the test. - test_continue_to_start $mode 2 - } -+ -+ return 0 - } - - # Reset the selection to frame #0 of thread THREAD. -@@ -1300,7 +1302,12 @@ proc_with_prefix test_cli_in_mi_frame { - } - - foreach_with_prefix mode { "all-stop" "non-stop" } { -- test_setup $mode -+ set test "setup done" -+ if { [test_setup $mode] == -1 } { -+ fail $test -+ continue -+ } -+ pass $test - - # Test selecting inferior, thread and frame from CLI - diff --git a/gdb-testsuite-handle-missing-.note.gnu-stack.patch b/gdb-testsuite-handle-missing-.note.gnu-stack.patch deleted file mode 100644 index 2f83592..0000000 --- a/gdb-testsuite-handle-missing-.note.gnu-stack.patch +++ /dev/null @@ -1,1404 +0,0 @@ -From dbcbd103d4cf39c2b7a87cf4caaf9c297580ec69 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Tue, 25 Oct 2022 14:14:34 +0200 -Subject: [PATCH 05/11] [gdb/testsuite] Handle missing .note.GNU-stack - -On openSUSE Tumbleweed I run into this for the dwarf assembly test-cases, and -some hardcoded assembly test-cases: -... - Running gdb.dwarf2/fission-absolute-dwo.exp ... - gdb compile failed, ld: warning: fission-absolute-dwo.o: \ - missing .note.GNU-stack section implies executable stack - ld: NOTE: This behaviour is deprecated and will be removed in a future \ - version of the linker - - === gdb Summary === - - # of untested testcases 1 -... - -Fix the dwarf assembly test-cases by adding the missing .note.GNU-stack in -proc Dwarf::assemble. - -Fix the hard-coded test-cases using this command: -... -$ for f in $(find gdb/testsuite/gdb.* -name *.S); do - if ! grep -q note.GNU-stack $f; then - echo -e "\t.section\t.note.GNU-stack,\"\",@progbits" >> $f; - fi; - done -... - -Likewise for .s files, and gdb/testsuite/lib/my-syscalls.S. - -The idiom for arm seems to be to use %progbits instead, see commit 9a5911c08be -("gdb/testsuite/gdb.dwarf2: Replace @ with % for ARM compatability"), so -hand-edit gdb/testsuite/gdb.arch/arm-disp-step.S to use %progbits instead. - -Note that dwarf assembly testcases use %progbits as decided by proc _section. - -Tested on x86_64-linux. - -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29674 ---- - gdb/testsuite/gdb.arch/amd64-break-on-asm-line.S | 1 + - gdb/testsuite/gdb.arch/amd64-disp-step-avx.S | 1 + - gdb/testsuite/gdb.arch/amd64-disp-step.S | 1 + - gdb/testsuite/gdb.arch/amd64-i386-address.S | 1 + - gdb/testsuite/gdb.arch/amd64-init-x87-values.S | 1 + - gdb/testsuite/gdb.arch/amd64-prologue-skip.S | 1 + - gdb/testsuite/gdb.arch/amd64-stap-expressions.S | 1 + - gdb/testsuite/gdb.arch/amd64-stap-optional-prefix.S | 1 + - gdb/testsuite/gdb.arch/amd64-stap-wrong-subexp.S | 1 + - gdb/testsuite/gdb.arch/amd64-tailcall-self.S | 1 + - gdb/testsuite/gdb.arch/arc-analyze-prologue.S | 1 + - gdb/testsuite/gdb.arch/arc-decode-insn.S | 1 + - gdb/testsuite/gdb.arch/arc-disassembler-options.s | 1 + - gdb/testsuite/gdb.arch/arm-disp-step.S | 1 + - gdb/testsuite/gdb.arch/gdb1291.s | 1 + - gdb/testsuite/gdb.arch/gdb1431.s | 1 + - gdb/testsuite/gdb.arch/i386-cfi-notcurrent.S | 1 + - gdb/testsuite/gdb.arch/i386-disp-step.S | 1 + - gdb/testsuite/gdb.arch/i386-float.S | 1 + - gdb/testsuite/gdb.arch/i386-permbkpt.S | 1 + - gdb/testsuite/gdb.arch/mips-disassembler-options.s | 1 + - gdb/testsuite/gdb.arch/pa-nullify.s | 1 + - gdb/testsuite/gdb.arch/pa64-nullify.s | 1 + - gdb/testsuite/gdb.arch/powerpc-addpcis.s | 1 + - gdb/testsuite/gdb.arch/powerpc-altivec.s | 1 + - gdb/testsuite/gdb.arch/powerpc-altivec2.s | 1 + - gdb/testsuite/gdb.arch/powerpc-altivec3.s | 1 + - gdb/testsuite/gdb.arch/powerpc-lnia.s | 1 + - gdb/testsuite/gdb.arch/powerpc-plxv-nonrel.s | 1 + - gdb/testsuite/gdb.arch/powerpc-power10.s | 2 ++ - gdb/testsuite/gdb.arch/powerpc-power7.s | 1 + - gdb/testsuite/gdb.arch/powerpc-power8.s | 1 + - gdb/testsuite/gdb.arch/powerpc-power9.s | 1 + - gdb/testsuite/gdb.arch/powerpc-prologue-frame.S | 1 + - gdb/testsuite/gdb.arch/powerpc-stackless.S | 1 + - gdb/testsuite/gdb.arch/powerpc-trap.s | 1 + - gdb/testsuite/gdb.arch/powerpc-vsx.s | 1 + - gdb/testsuite/gdb.arch/powerpc-vsx2.s | 1 + - gdb/testsuite/gdb.arch/powerpc-vsx3.s | 1 + - gdb/testsuite/gdb.arch/powerpc64-trap.s | 1 + - gdb/testsuite/gdb.arch/ppc64-atomic-inst.S | 1 + - gdb/testsuite/gdb.arch/ppc64-isa207-atomic-inst.S | 1 + - gdb/testsuite/gdb.arch/pr25124.S | 1 + - gdb/testsuite/gdb.arch/riscv64-unwind-prologue-with-ld-lw-foo.s | 1 + - gdb/testsuite/gdb.arch/riscv64-unwind-prologue-with-mv.s | 1 + - gdb/testsuite/gdb.arch/s390-stackless.S | 1 + - gdb/testsuite/gdb.arch/sparc64-regs.S | 1 + - gdb/testsuite/gdb.arch/thumb-bx-pc.S | 1 + - gdb/testsuite/gdb.arch/thumb-singlestep.S | 1 + - gdb/testsuite/gdb.arch/thumb2-it.S | 1 + - gdb/testsuite/gdb.asm/asmsrc1.s | 1 + - gdb/testsuite/gdb.asm/asmsrc2.s | 1 + - gdb/testsuite/gdb.base/dup-sect.S | 1 + - gdb/testsuite/gdb.btrace/instruction_history.S | 1 + - gdb/testsuite/gdb.btrace/x86-tsx.S | 1 + - gdb/testsuite/gdb.compile/compile-constvar.S | 1 + - gdb/testsuite/gdb.disasm/am33.s | 1 + - gdb/testsuite/gdb.disasm/h8300s.s | 1 + - gdb/testsuite/gdb.disasm/hppa.s | 1 + - gdb/testsuite/gdb.disasm/mn10200.s | 1 + - gdb/testsuite/gdb.disasm/mn10300.s | 1 + - gdb/testsuite/gdb.disasm/sh3.s | 1 + - gdb/testsuite/gdb.disasm/t01_mov.s | 1 + - gdb/testsuite/gdb.disasm/t02_mova.s | 1 + - gdb/testsuite/gdb.disasm/t03_add.s | 1 + - gdb/testsuite/gdb.disasm/t04_sub.s | 1 + - gdb/testsuite/gdb.disasm/t05_cmp.s | 1 + - gdb/testsuite/gdb.disasm/t06_ari2.s | 1 + - gdb/testsuite/gdb.disasm/t07_ari3.s | 1 + - gdb/testsuite/gdb.disasm/t08_or.s | 1 + - gdb/testsuite/gdb.disasm/t09_xor.s | 1 + - gdb/testsuite/gdb.disasm/t10_and.s | 1 + - gdb/testsuite/gdb.disasm/t11_logs.s | 1 + - gdb/testsuite/gdb.disasm/t12_bit.s | 1 + - gdb/testsuite/gdb.disasm/t13_otr.s | 1 + - gdb/testsuite/gdb.dwarf2/dup-psym.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc-hello-dbg.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc-world-dbg.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-ada-ffffffff.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-anon-mptr.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-anonymous-func.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-bad-elf-other.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-bad-parameter-type.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-basic.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-canonicalize-type.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-case-insensitive-debug.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-compdir-oldgcc.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-compressed.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-const.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-cu-size.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-dos-drive.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-double-set-die-type.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-dummy-cu.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-empty-namespace.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-empty-pc-range.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-entry-value.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-filename.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-icycle.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-inheritance.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-inline-param.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-intercu.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-intermix.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-modula2-self-type.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-noloc.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-inner.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-outer.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-op-call.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-op-out-param.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-param-error.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-producer.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-restore.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-simple-locdesc.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-strp.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-unresolved.S | 1 + - gdb/testsuite/gdb.dwarf2/dw2-var-zero-addr.S | 1 + - gdb/testsuite/gdb.dwarf2/dw4-sig-type-unused.S | 1 + - gdb/testsuite/gdb.dwarf2/fission-reread.S | 1 + - gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.S | 1 + - gdb/testsuite/gdb.dwarf2/mac-fileno.S | 1 + - gdb/testsuite/gdb.dwarf2/pr11465.S | 1 + - gdb/testsuite/gdb.dwarf2/pr13961.S | 1 + - gdb/testsuite/gdb.linespec/break-asm-file0.s | 1 + - gdb/testsuite/gdb.linespec/break-asm-file1.s | 1 + - gdb/testsuite/gdb.mi/dw2-ref-missing-frame.S | 1 + - gdb/testsuite/gdb.tui/tui-layout-asm-short-prog.S | 1 + - gdb/testsuite/lib/dwarf.exp | 2 ++ - gdb/testsuite/lib/my-syscalls.S | 2 ++ - 135 files changed, 138 insertions(+) - -diff --git a/gdb/testsuite/gdb.arch/amd64-break-on-asm-line.S b/gdb/testsuite/gdb.arch/amd64-break-on-asm-line.S -index 99fa834adca..9af6c8ea5d0 100644 ---- a/gdb/testsuite/gdb.arch/amd64-break-on-asm-line.S -+++ b/gdb/testsuite/gdb.arch/amd64-break-on-asm-line.S -@@ -33,3 +33,4 @@ test: - nop /* Incorrect. */ - nop - nop -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/amd64-disp-step-avx.S b/gdb/testsuite/gdb.arch/amd64-disp-step-avx.S -index 32e5fc77be8..924deef224f 100644 ---- a/gdb/testsuite/gdb.arch/amd64-disp-step-avx.S -+++ b/gdb/testsuite/gdb.arch/amd64-disp-step-avx.S -@@ -75,3 +75,4 @@ done: - var128: - .8byte 0xaa55aa55aa55aa55 - .8byte 0x55aa55aa55aa55aa -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/amd64-disp-step.S b/gdb/testsuite/gdb.arch/amd64-disp-step.S -index c2249629a7a..cdf36cbc580 100644 ---- a/gdb/testsuite/gdb.arch/amd64-disp-step.S -+++ b/gdb/testsuite/gdb.arch/amd64-disp-step.S -@@ -179,3 +179,4 @@ test_abs_jmp_end: - test_rep_ret: - repz - ret -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/amd64-i386-address.S b/gdb/testsuite/gdb.arch/amd64-i386-address.S -index cec9898a2f5..fbc7ceadf66 100644 ---- a/gdb/testsuite/gdb.arch/amd64-i386-address.S -+++ b/gdb/testsuite/gdb.arch/amd64-i386-address.S -@@ -22,3 +22,4 @@ _start: .globl _start - int3 - nop - nop -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/amd64-init-x87-values.S b/gdb/testsuite/gdb.arch/amd64-init-x87-values.S -index 8b6dc02d005..de8607c84cf 100644 ---- a/gdb/testsuite/gdb.arch/amd64-init-x87-values.S -+++ b/gdb/testsuite/gdb.arch/amd64-init-x87-values.S -@@ -29,3 +29,4 @@ main: - nop - fld1 - nop -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/amd64-prologue-skip.S b/gdb/testsuite/gdb.arch/amd64-prologue-skip.S -index 096745e3311..1e18150bdf7 100644 ---- a/gdb/testsuite/gdb.arch/amd64-prologue-skip.S -+++ b/gdb/testsuite/gdb.arch/amd64-prologue-skip.S -@@ -26,3 +26,4 @@ pushrbp: .globl pushrbp - #define MINSYM nop; .globl minsym; minsym: nop - /*8*/ MINSYM - /*a*/ hlt -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/amd64-stap-expressions.S b/gdb/testsuite/gdb.arch/amd64-stap-expressions.S -index 0f0dfee84d6..05ba8fc593a 100644 ---- a/gdb/testsuite/gdb.arch/amd64-stap-expressions.S -+++ b/gdb/testsuite/gdb.arch/amd64-stap-expressions.S -@@ -41,3 +41,4 @@ main: - - xor %rax,%rax - ret -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/amd64-stap-optional-prefix.S b/gdb/testsuite/gdb.arch/amd64-stap-optional-prefix.S -index 5bc8858d3c2..592a875d0fd 100644 ---- a/gdb/testsuite/gdb.arch/amd64-stap-optional-prefix.S -+++ b/gdb/testsuite/gdb.arch/amd64-stap-optional-prefix.S -@@ -40,3 +40,4 @@ main: - STAP_PROBE1(probe, fail2_probe, 23-@$16) - xor %rax,%rax - ret -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/amd64-stap-wrong-subexp.S b/gdb/testsuite/gdb.arch/amd64-stap-wrong-subexp.S -index fcf0b73d6e1..1545ff9d673 100644 ---- a/gdb/testsuite/gdb.arch/amd64-stap-wrong-subexp.S -+++ b/gdb/testsuite/gdb.arch/amd64-stap-wrong-subexp.S -@@ -25,3 +25,4 @@ main: - STAP_PROBE2(probe, bar, -4@-($4), -4@$-3+($22/$2)-$16) - xor %rax,%rax - ret -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/amd64-tailcall-self.S b/gdb/testsuite/gdb.arch/amd64-tailcall-self.S -index f1a3404e865..676875288cd 100644 ---- a/gdb/testsuite/gdb.arch/amd64-tailcall-self.S -+++ b/gdb/testsuite/gdb.arch/amd64-tailcall-self.S -@@ -612,3 +612,4 @@ die10a: - .LASF2: - .string "argv" - .ident "GCC: (GNU) 4.9.2 20150212 (Red Hat 4.9.2-6)" -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/arc-analyze-prologue.S b/gdb/testsuite/gdb.arch/arc-analyze-prologue.S -index de6973f905c..ae7b71e7572 100644 ---- a/gdb/testsuite/gdb.arch/arc-analyze-prologue.S -+++ b/gdb/testsuite/gdb.arch/arc-analyze-prologue.S -@@ -901,3 +901,4 @@ main: - j_s [blink] - - .align 4 -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/arc-decode-insn.S b/gdb/testsuite/gdb.arch/arc-decode-insn.S -index 4228515684a..9f2ed9fb9df 100644 ---- a/gdb/testsuite/gdb.arch/arc-decode-insn.S -+++ b/gdb/testsuite/gdb.arch/arc-decode-insn.S -@@ -1000,3 +1000,4 @@ start_branch_tests: - - .Lend: - -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/arc-disassembler-options.s b/gdb/testsuite/gdb.arch/arc-disassembler-options.s -index cb226996360..5e063b957a4 100644 ---- a/gdb/testsuite/gdb.arch/arc-disassembler-options.s -+++ b/gdb/testsuite/gdb.arch/arc-disassembler-options.s -@@ -19,3 +19,4 @@ - foo: - lr r0, [tlbpd0] - .end foo -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/arm-disp-step.S b/gdb/testsuite/gdb.arch/arm-disp-step.S -index b67e83e56e0..9f687cd6024 100644 ---- a/gdb/testsuite/gdb.arch/arm-disp-step.S -+++ b/gdb/testsuite/gdb.arch/arm-disp-step.S -@@ -391,3 +391,4 @@ test_add_rn_pc_end: - bx lr - .size test_add_rn_pc, .-test_add_rn_pc - #endif -+ .section .note.GNU-stack,"",%progbits -diff --git a/gdb/testsuite/gdb.arch/gdb1291.s b/gdb/testsuite/gdb.arch/gdb1291.s -index 5efe33be200..9ee2b452de9 100644 ---- a/gdb/testsuite/gdb.arch/gdb1291.s -+++ b/gdb/testsuite/gdb.arch/gdb1291.s -@@ -126,3 +126,4 @@ _sub2: - .short 260 - .size _sub2, .-_sub2 - .ident "GCC: (GNU) 3.5.0 20040204 (experimental)" -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/gdb1431.s b/gdb/testsuite/gdb.arch/gdb1431.s -index 0b90f633c90..d373c47b14c 100644 ---- a/gdb/testsuite/gdb.arch/gdb1431.s -+++ b/gdb/testsuite/gdb.arch/gdb1431.s -@@ -126,3 +126,4 @@ _sub2: - .short 260 - .size _sub2, .-_sub2 - .ident "GCC: (GNU) 3.5.0 20040204 (experimental)" -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/i386-cfi-notcurrent.S b/gdb/testsuite/gdb.arch/i386-cfi-notcurrent.S -index 3ed983c96d4..97640530dff 100644 ---- a/gdb/testsuite/gdb.arch/i386-cfi-notcurrent.S -+++ b/gdb/testsuite/gdb.arch/i386-cfi-notcurrent.S -@@ -74,3 +74,4 @@ main: - .cfi_endproc - .LFE2: - .size main, .-main -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/i386-disp-step.S b/gdb/testsuite/gdb.arch/i386-disp-step.S -index af1ac54c9d1..e5f6a4c3669 100644 ---- a/gdb/testsuite/gdb.arch/i386-disp-step.S -+++ b/gdb/testsuite/gdb.arch/i386-disp-step.S -@@ -121,3 +121,4 @@ test_call_end: - .global test_ret - test_ret: - ret -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/i386-float.S b/gdb/testsuite/gdb.arch/i386-float.S -index 82c7902d08a..13bd2c3d77b 100644 ---- a/gdb/testsuite/gdb.arch/i386-float.S -+++ b/gdb/testsuite/gdb.arch/i386-float.S -@@ -36,3 +36,4 @@ SYMBOL(main): - val: .byte 0x00,0x00,0x45,0x07,0x11,0x19,0x22,0xe9,0xfe,0xbf - smallval: .byte 0xe9,0xd0,0xd7,0x65,0x81,0xb7,0x43,0xc6,0x5c,0x6a - bigval: .byte 0x6a,0x45,0x90,0xdc,0x03,0xc1,0xf8,0xc6,0xe5,0x03 -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/i386-permbkpt.S b/gdb/testsuite/gdb.arch/i386-permbkpt.S -index 1a17b2216b3..bdacfbda4a5 100644 ---- a/gdb/testsuite/gdb.arch/i386-permbkpt.S -+++ b/gdb/testsuite/gdb.arch/i386-permbkpt.S -@@ -28,3 +28,4 @@ - SYMBOL(main): - int3 - ret -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/mips-disassembler-options.s b/gdb/testsuite/gdb.arch/mips-disassembler-options.s -index bb7f95dd94c..7fc7cd5a8bd 100644 ---- a/gdb/testsuite/gdb.arch/mips-disassembler-options.s -+++ b/gdb/testsuite/gdb.arch/mips-disassembler-options.s -@@ -28,3 +28,4 @@ foo: - bar: - move $2, $8 - .end bar -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/pa-nullify.s b/gdb/testsuite/gdb.arch/pa-nullify.s -index 8b756bd9836..384a5f58502 100644 ---- a/gdb/testsuite/gdb.arch/pa-nullify.s -+++ b/gdb/testsuite/gdb.arch/pa-nullify.s -@@ -56,3 +56,4 @@ main: - bv,n %r0(%r2) - .EXIT - .PROCEND -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/pa64-nullify.s b/gdb/testsuite/gdb.arch/pa64-nullify.s -index f297699ed7a..6d253828ce0 100644 ---- a/gdb/testsuite/gdb.arch/pa64-nullify.s -+++ b/gdb/testsuite/gdb.arch/pa64-nullify.s -@@ -68,3 +68,4 @@ main: - bve,n (%r2) - .EXIT - .PROCEND -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/powerpc-addpcis.s b/gdb/testsuite/gdb.arch/powerpc-addpcis.s -index dfc922c27fb..84484ec6960 100644 ---- a/gdb/testsuite/gdb.arch/powerpc-addpcis.s -+++ b/gdb/testsuite/gdb.arch/powerpc-addpcis.s -@@ -33,3 +33,4 @@ main: - blr - - -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/powerpc-altivec.s b/gdb/testsuite/gdb.arch/powerpc-altivec.s -index 25400ddaf99..d9d66fd16df 100644 ---- a/gdb/testsuite/gdb.arch/powerpc-altivec.s -+++ b/gdb/testsuite/gdb.arch/powerpc-altivec.s -@@ -213,3 +213,4 @@ func: - .long 0x11e0e28e /* vupklsb v15,v28 */ - .long 0x110042ce /* vupklsh v8,v8 */ - .long 0x13201cc4 /* vxor v25,v0,v3 */ -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/powerpc-altivec2.s b/gdb/testsuite/gdb.arch/powerpc-altivec2.s -index f01e9a02ad9..4e74044df45 100644 ---- a/gdb/testsuite/gdb.arch/powerpc-altivec2.s -+++ b/gdb/testsuite/gdb.arch/powerpc-altivec2.s -@@ -133,3 +133,4 @@ func: - .long 0x11e0f7c3 /* vpopcntd v15,v30 */ - .long 0x105f36c7 /* vcmpgtud. v2,v31,v6 */ - .long 0x128f17c7 /* vcmpgtsd. v20,v15,v2 */ -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/powerpc-altivec3.s b/gdb/testsuite/gdb.arch/powerpc-altivec3.s -index ae9571c7372..843a6e8c05f 100644 ---- a/gdb/testsuite/gdb.arch/powerpc-altivec3.s -+++ b/gdb/testsuite/gdb.arch/powerpc-altivec3.s -@@ -86,3 +86,4 @@ func: - .long 0x11e90f4d /* vextuhrx r15,r9,v1 */ - .long 0x12b1878d /* vextuwrx r21,r17,v16 */ - .long 0x1295b5e3 /* vmsumudm v20,v21,v22,v23 */ -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/powerpc-lnia.s b/gdb/testsuite/gdb.arch/powerpc-lnia.s -index d81607d1043..86fd319ccb2 100644 ---- a/gdb/testsuite/gdb.arch/powerpc-lnia.s -+++ b/gdb/testsuite/gdb.arch/powerpc-lnia.s -@@ -31,3 +31,4 @@ main: - lnia 9 # /* set r9 */ - blr - -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/powerpc-plxv-nonrel.s b/gdb/testsuite/gdb.arch/powerpc-plxv-nonrel.s -index d39ec23bffe..ede6dc936a4 100644 ---- a/gdb/testsuite/gdb.arch/powerpc-plxv-nonrel.s -+++ b/gdb/testsuite/gdb.arch/powerpc-plxv-nonrel.s -@@ -43,3 +43,4 @@ mydata: - .long 0xabbbcbdb # <<- loaded into vs7 - .long 0xacbcccdc # <<- - -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/powerpc-power10.s b/gdb/testsuite/gdb.arch/powerpc-power10.s -index 67ccdb42182..9a933d083ff 100644 ---- a/gdb/testsuite/gdb.arch/powerpc-power10.s -+++ b/gdb/testsuite/gdb.arch/powerpc-power10.s -@@ -637,3 +637,5 @@ func: - .quad 0x8006000105000000 /* xxspltiw vs0,0 */ - .quad 0x8006000305000000 /* xxspltiw vs0,3 */ - .quad 0x8006000805000000 /* xxspltiw vs0,8 */ -+ .section .note.GNU-stack,"",@progbits -+ -diff --git a/gdb/testsuite/gdb.arch/powerpc-power7.s b/gdb/testsuite/gdb.arch/powerpc-power7.s -index 92e9bc50eb8..329ed5e7a8a 100644 ---- a/gdb/testsuite/gdb.arch/powerpc-power7.s -+++ b/gdb/testsuite/gdb.arch/powerpc-power7.s -@@ -108,3 +108,4 @@ func: - .long 0x7d80e3a6 /* mtppr r12 */ - .long 0x7da2e3a6 /* mtppr32 r13 */ - .long 0x7d605264 /* tlbie r10,r11 */ -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/powerpc-power8.s b/gdb/testsuite/gdb.arch/powerpc-power8.s -index 4367a6f6e52..6a8dcc47a77 100644 ---- a/gdb/testsuite/gdb.arch/powerpc-power8.s -+++ b/gdb/testsuite/gdb.arch/powerpc-power8.s -@@ -185,3 +185,4 @@ func: - .long 0x7d81492d /* stwcx. r12,r1,r9 */ - .long 0x7da051ad /* stdcx. r13,0,r10 */ - .long 0x7da151ad /* stdcx. r13,r1,r10 */ -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/powerpc-power9.s b/gdb/testsuite/gdb.arch/powerpc-power9.s -index d15af59d279..09dcb38183a 100644 ---- a/gdb/testsuite/gdb.arch/powerpc-power9.s -+++ b/gdb/testsuite/gdb.arch/powerpc-power9.s -@@ -384,3 +384,4 @@ func: - .long 0xffd7048e /* mffscrni f30,0 */ - .long 0xffd71c8e /* mffscrni f30,3 */ - .long 0xfff8048e /* mffsl f31 */ -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/powerpc-prologue-frame.S b/gdb/testsuite/gdb.arch/powerpc-prologue-frame.S -index dd60fcac4e1..d7424ffc9b0 100644 ---- a/gdb/testsuite/gdb.arch/powerpc-prologue-frame.S -+++ b/gdb/testsuite/gdb.arch/powerpc-prologue-frame.S -@@ -33,3 +33,4 @@ FUNC_START(foo) - mr 1,11 - blr - FUNC_END(foo) -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/powerpc-stackless.S b/gdb/testsuite/gdb.arch/powerpc-stackless.S -index 29c16c147dc..452c2b8247b 100644 ---- a/gdb/testsuite/gdb.arch/powerpc-stackless.S -+++ b/gdb/testsuite/gdb.arch/powerpc-stackless.S -@@ -22,3 +22,4 @@ FUNC_START(main) - mtlr sp - blr - FUNC_END(main) -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/powerpc-trap.s b/gdb/testsuite/gdb.arch/powerpc-trap.s -index cc427911529..8e31c02a000 100644 ---- a/gdb/testsuite/gdb.arch/powerpc-trap.s -+++ b/gdb/testsuite/gdb.arch/powerpc-trap.s -@@ -29,3 +29,4 @@ main: - li 3, 0 - blr - -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/powerpc-vsx.s b/gdb/testsuite/gdb.arch/powerpc-vsx.s -index 7604b4a82a5..5ac2cace4fe 100644 ---- a/gdb/testsuite/gdb.arch/powerpc-vsx.s -+++ b/gdb/testsuite/gdb.arch/powerpc-vsx.s -@@ -170,3 +170,4 @@ func: - .long 0xf102e293 /* xxspltw vs40,vs60,2 */ - .long 0x7d00a699 /* lxvd2x vs40,0,r20 */ - .long 0x7d00a799 /* stxvd2x vs40,0,r20 */ -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/powerpc-vsx2.s b/gdb/testsuite/gdb.arch/powerpc-vsx2.s -index aa3dff6b7dc..71d9cf7af8f 100644 ---- a/gdb/testsuite/gdb.arch/powerpc-vsx2.s -+++ b/gdb/testsuite/gdb.arch/powerpc-vsx2.s -@@ -63,3 +63,4 @@ func: - .long 0xf360d52d /* xscvspdpn vs59,vs26 */ - .long 0xff0e168c /* fmrgow f24,f14,f2 */ - .long 0xfec72f8c /* fmrgew f22,f7,f5 */ -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/powerpc-vsx3.s b/gdb/testsuite/gdb.arch/powerpc-vsx3.s -index 8dd344dd78f..1e66d21f431 100644 ---- a/gdb/testsuite/gdb.arch/powerpc-vsx3.s -+++ b/gdb/testsuite/gdb.arch/powerpc-vsx3.s -@@ -139,3 +139,4 @@ func: - .long 0xfe766688 /* xscvdpqp v19,v12 */ - .long 0xfdb92688 /* xscvqpsdz v13,v4 */ - .long 0xfcf83ec8 /* xsiexpqp v7,v24,v7 */ -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/powerpc64-trap.s b/gdb/testsuite/gdb.arch/powerpc64-trap.s -index 6b20e7648aa..75c37afebe1 100644 ---- a/gdb/testsuite/gdb.arch/powerpc64-trap.s -+++ b/gdb/testsuite/gdb.arch/powerpc64-trap.s -@@ -31,3 +31,4 @@ main: - li 3, 0 - blr - -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/ppc64-atomic-inst.S b/gdb/testsuite/gdb.arch/ppc64-atomic-inst.S -index 0dbb25d84d3..9d6b4fed672 100644 ---- a/gdb/testsuite/gdb.arch/ppc64-atomic-inst.S -+++ b/gdb/testsuite/gdb.arch/ppc64-atomic-inst.S -@@ -59,3 +59,4 @@ main: - #else - .size .main,.-.main - #endif -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/ppc64-isa207-atomic-inst.S b/gdb/testsuite/gdb.arch/ppc64-isa207-atomic-inst.S -index 873a45af82a..db56803c3ff 100644 ---- a/gdb/testsuite/gdb.arch/ppc64-isa207-atomic-inst.S -+++ b/gdb/testsuite/gdb.arch/ppc64-isa207-atomic-inst.S -@@ -98,3 +98,4 @@ test_atomic_sequences: - #else - .size .test_atomic_sequences,.-.test_atomic_sequences - #endif -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/pr25124.S b/gdb/testsuite/gdb.arch/pr25124.S -index 1f54cfd585c..7ed0a62ce5c 100644 ---- a/gdb/testsuite/gdb.arch/pr25124.S -+++ b/gdb/testsuite/gdb.arch/pr25124.S -@@ -33,3 +33,4 @@ main: - mov r0, #0 - bx lr - .size main, .-main -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/riscv64-unwind-prologue-with-ld-lw-foo.s b/gdb/testsuite/gdb.arch/riscv64-unwind-prologue-with-ld-lw-foo.s -index e0c538f8c3e..c12c16eab89 100644 ---- a/gdb/testsuite/gdb.arch/riscv64-unwind-prologue-with-ld-lw-foo.s -+++ b/gdb/testsuite/gdb.arch/riscv64-unwind-prologue-with-ld-lw-foo.s -@@ -72,3 +72,4 @@ foo: - addi sp,sp,32 - jr ra - .size foo, .-foo -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/riscv64-unwind-prologue-with-mv.s b/gdb/testsuite/gdb.arch/riscv64-unwind-prologue-with-mv.s -index aead673f09a..dfb0f361f99 100644 ---- a/gdb/testsuite/gdb.arch/riscv64-unwind-prologue-with-mv.s -+++ b/gdb/testsuite/gdb.arch/riscv64-unwind-prologue-with-mv.s -@@ -45,3 +45,4 @@ foo: - addi sp,sp,32 - jr ra - .size foo, .-foo -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/s390-stackless.S b/gdb/testsuite/gdb.arch/s390-stackless.S -index 9763e1fc8d5..7d2265dcb3a 100644 ---- a/gdb/testsuite/gdb.arch/s390-stackless.S -+++ b/gdb/testsuite/gdb.arch/s390-stackless.S -@@ -31,3 +31,4 @@ main: la %r15,3(0,0) - .byte 0,1 - 1: st %r15,0(%r15) - br %r14 -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/sparc64-regs.S b/gdb/testsuite/gdb.arch/sparc64-regs.S -index cd9301baaa5..ff3c7411946 100644 ---- a/gdb/testsuite/gdb.arch/sparc64-regs.S -+++ b/gdb/testsuite/gdb.arch/sparc64-regs.S -@@ -134,3 +134,4 @@ test_fsr: - .align 8 - flags: .xword 0x0000000000000000 - .size flags, .-flags -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/thumb-bx-pc.S b/gdb/testsuite/gdb.arch/thumb-bx-pc.S -index d97c4bf865f..6d72265e4a7 100644 ---- a/gdb/testsuite/gdb.arch/thumb-bx-pc.S -+++ b/gdb/testsuite/gdb.arch/thumb-bx-pc.S -@@ -32,3 +32,4 @@ main: - mov r0, #0 - bx lr - .size main, .-main -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/thumb-singlestep.S b/gdb/testsuite/gdb.arch/thumb-singlestep.S -index 2a2e8e340e3..c0291a036f9 100644 ---- a/gdb/testsuite/gdb.arch/thumb-singlestep.S -+++ b/gdb/testsuite/gdb.arch/thumb-singlestep.S -@@ -38,3 +38,4 @@ main: - pop {r3, pc} - .size main, .-main - -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/thumb2-it.S b/gdb/testsuite/gdb.arch/thumb2-it.S -index 0b06c82f672..892c562d2eb 100644 ---- a/gdb/testsuite/gdb.arch/thumb2-it.S -+++ b/gdb/testsuite/gdb.arch/thumb2-it.S -@@ -180,3 +180,4 @@ it_breakpoints: - bx lr - - #endif /* __thumb2__ */ -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.asm/asmsrc1.s b/gdb/testsuite/gdb.asm/asmsrc1.s -index ddf87900842..35b39ca7e1a 100644 ---- a/gdb/testsuite/gdb.asm/asmsrc1.s -+++ b/gdb/testsuite/gdb.asm/asmsrc1.s -@@ -85,3 +85,4 @@ - gdbasm_datavar staticvar 5 - - .include "note.inc" -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.asm/asmsrc2.s b/gdb/testsuite/gdb.asm/asmsrc2.s -index e585ee22c3a..288b708f1f7 100644 ---- a/gdb/testsuite/gdb.asm/asmsrc2.s -+++ b/gdb/testsuite/gdb.asm/asmsrc2.s -@@ -19,3 +19,4 @@ - comment "mark: foo2 leave" - gdbasm_leave - gdbasm_end foo2 -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.base/dup-sect.S b/gdb/testsuite/gdb.base/dup-sect.S -index b33378ec454..2af269fffdf 100644 ---- a/gdb/testsuite/gdb.base/dup-sect.S -+++ b/gdb/testsuite/gdb.base/dup-sect.S -@@ -20,3 +20,4 @@ var1: .byte 1 - - .section sect2, "a" - var2: .byte 2 -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.btrace/instruction_history.S b/gdb/testsuite/gdb.btrace/instruction_history.S -index 8f9b8343453..23901a34446 100644 ---- a/gdb/testsuite/gdb.btrace/instruction_history.S -+++ b/gdb/testsuite/gdb.btrace/instruction_history.S -@@ -30,3 +30,4 @@ loop: - jmp .L1 - .L2: - ret /* bp.2 */ -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.btrace/x86-tsx.S b/gdb/testsuite/gdb.btrace/x86-tsx.S -index bc4009d0c23..0cfc329342e 100644 ---- a/gdb/testsuite/gdb.btrace/x86-tsx.S -+++ b/gdb/testsuite/gdb.btrace/x86-tsx.S -@@ -27,3 +27,4 @@ test: - .Lhandler: - mov $1, %eax - ret -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.compile/compile-constvar.S b/gdb/testsuite/gdb.compile/compile-constvar.S -index 83644cb4a5d..b2e178c952d 100644 ---- a/gdb/testsuite/gdb.compile/compile-constvar.S -+++ b/gdb/testsuite/gdb.compile/compile-constvar.S -@@ -93,3 +93,4 @@ - .LASF0: - .string "GNU C 4.8.2 20131212 (Red Hat 4.8.2-7) -mtune=generic -march=x86-64 -g" - .ident "GCC: (GNU) 4.8.2 20131212 (Red Hat 4.8.2-7)" -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.disasm/am33.s b/gdb/testsuite/gdb.disasm/am33.s -index a686cef2f74..e699bcffdeb 100644 ---- a/gdb/testsuite/gdb.disasm/am33.s -+++ b/gdb/testsuite/gdb.disasm/am33.s -@@ -522,3 +522,4 @@ dsp_autoincrement_tests: - mov_leq (r1+,4),r2 - mov_lne (r1+,4),r2 - mov_lra (r1+,4),r2 -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.disasm/h8300s.s b/gdb/testsuite/gdb.disasm/h8300s.s -index 6510d40ef4e..0fd86564267 100644 ---- a/gdb/testsuite/gdb.disasm/h8300s.s -+++ b/gdb/testsuite/gdb.disasm/h8300s.s -@@ -354,3 +354,4 @@ system_control_tests: - block_data_transfer_tests: - eepmov.b - eepmov.w -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.disasm/hppa.s b/gdb/testsuite/gdb.disasm/hppa.s -index 593d8bfefee..12ace7d3f15 100644 ---- a/gdb/testsuite/gdb.disasm/hppa.s -+++ b/gdb/testsuite/gdb.disasm/hppa.s -@@ -1736,3 +1736,4 @@ fmemLRbug_tests_4 - bv,n 0(%r2) - .EXIT - .PROCEND -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.disasm/mn10200.s b/gdb/testsuite/gdb.disasm/mn10200.s -index 32357b0401b..c48dd6431fd 100644 ---- a/gdb/testsuite/gdb.disasm/mn10200.s -+++ b/gdb/testsuite/gdb.disasm/mn10200.s -@@ -215,3 +215,4 @@ sub_tests: - sub 32767,a2 - sub 131071,a2 - subc d1,d2 -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.disasm/mn10300.s b/gdb/testsuite/gdb.disasm/mn10300.s -index 3ad6c95e6a1..e7ab6e4cd85 100644 ---- a/gdb/testsuite/gdb.disasm/mn10300.s -+++ b/gdb/testsuite/gdb.disasm/mn10300.s -@@ -298,3 +298,4 @@ sub_tests: - sub 131071,a1 - subc d1,d2 - -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.disasm/sh3.s b/gdb/testsuite/gdb.disasm/sh3.s -index e5969f5ea1a..ab70da38758 100644 ---- a/gdb/testsuite/gdb.disasm/sh3.s -+++ b/gdb/testsuite/gdb.disasm/sh3.s -@@ -52,3 +52,4 @@ _fp_misc_tests: - sts fpscr,r3 - sts.l fpscr,@-r3 - -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.disasm/t01_mov.s b/gdb/testsuite/gdb.disasm/t01_mov.s -index 6848304693f..d79d8aa70f7 100644 ---- a/gdb/testsuite/gdb.disasm/t01_mov.s -+++ b/gdb/testsuite/gdb.disasm/t01_mov.s -@@ -1105,3 +1105,4 @@ label: - - .end - -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.disasm/t02_mova.s b/gdb/testsuite/gdb.disasm/t02_mova.s -index 4615bcc0e0b..b16da0233e4 100644 ---- a/gdb/testsuite/gdb.disasm/t02_mova.s -+++ b/gdb/testsuite/gdb.disasm/t02_mova.s -@@ -236,3 +236,4 @@ _start: - mova/l.l @(0x12345678:32,@0x9ABCDEF0:32.w),er1 ;015F48D99ABCDEF012345678 - - .end -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.disasm/t03_add.s b/gdb/testsuite/gdb.disasm/t03_add.s -index 2b832475ba7..024ae61a2b7 100644 ---- a/gdb/testsuite/gdb.disasm/t03_add.s -+++ b/gdb/testsuite/gdb.disasm/t03_add.s -@@ -976,3 +976,4 @@ _start: - add.l @0x12345678:32,@0x9abcdef0:32 ;01046b2c1234567848109abcdef0 - - .end -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.disasm/t04_sub.s b/gdb/testsuite/gdb.disasm/t04_sub.s -index d851760d8ae..066f0236436 100644 ---- a/gdb/testsuite/gdb.disasm/t04_sub.s -+++ b/gdb/testsuite/gdb.disasm/t04_sub.s -@@ -975,3 +975,4 @@ _start: - sub.l @0x12345678:32,@0x9abcdef0:32 ;01046b2c1234567848309abcdef0 - - .end -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.disasm/t05_cmp.s b/gdb/testsuite/gdb.disasm/t05_cmp.s -index ee034f097c4..8d5b393dcbd 100644 ---- a/gdb/testsuite/gdb.disasm/t05_cmp.s -+++ b/gdb/testsuite/gdb.disasm/t05_cmp.s -@@ -919,3 +919,4 @@ _start: - cmp.l @0x12345678:32,@0x9abcdef0:32 ;01046b2c1234567848209abcdef0 - - .end -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.disasm/t06_ari2.s b/gdb/testsuite/gdb.disasm/t06_ari2.s -index 75a919510b4..dd0e3145547 100644 ---- a/gdb/testsuite/gdb.disasm/t06_ari2.s -+++ b/gdb/testsuite/gdb.disasm/t06_ari2.s -@@ -186,3 +186,4 @@ _start: - divs.l er3,er1 ;01d25331 - - .end -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.disasm/t07_ari3.s b/gdb/testsuite/gdb.disasm/t07_ari3.s -index 6ad7128d3ff..a4afef438be 100644 ---- a/gdb/testsuite/gdb.disasm/t07_ari3.s -+++ b/gdb/testsuite/gdb.disasm/t07_ari3.s -@@ -171,3 +171,4 @@ _start: - exts.l #2,@0x12345678:32 ;01046b281234567817e0 - - .end -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.disasm/t08_or.s b/gdb/testsuite/gdb.disasm/t08_or.s -index da4e216c58b..0fa35abb75e 100644 ---- a/gdb/testsuite/gdb.disasm/t08_or.s -+++ b/gdb/testsuite/gdb.disasm/t08_or.s -@@ -970,3 +970,4 @@ _start: - or.l @0x12345678:32,@0x9abcdef0:32 ;01046b2c1234567848409abcdef0 - - .end -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.disasm/t09_xor.s b/gdb/testsuite/gdb.disasm/t09_xor.s -index ccd479cb20a..05e75105f4d 100644 ---- a/gdb/testsuite/gdb.disasm/t09_xor.s -+++ b/gdb/testsuite/gdb.disasm/t09_xor.s -@@ -970,3 +970,4 @@ _start: - xor.l @0x12345678:32,@0x9abcdef0:32 ;01046b2c1234567848509abcdef0 - - .end -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.disasm/t10_and.s b/gdb/testsuite/gdb.disasm/t10_and.s -index 0459c109f5d..457b67e2483 100644 ---- a/gdb/testsuite/gdb.disasm/t10_and.s -+++ b/gdb/testsuite/gdb.disasm/t10_and.s -@@ -970,3 +970,4 @@ _start: - and.l @0x12345678:32,@0x9abcdef0:32 ;01046b2c1234567848609abcdef0 - - .end -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.disasm/t11_logs.s b/gdb/testsuite/gdb.disasm/t11_logs.s -index 4768591dd7e..228a6740c53 100644 ---- a/gdb/testsuite/gdb.disasm/t11_logs.s -+++ b/gdb/testsuite/gdb.disasm/t11_logs.s -@@ -1175,3 +1175,4 @@ _start: - rotr.l #2,@0x12345678:32 ;01046b281234567813f0 - - .end -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.disasm/t12_bit.s b/gdb/testsuite/gdb.disasm/t12_bit.s -index 4c45b2a02a1..2664a75ad6f 100644 ---- a/gdb/testsuite/gdb.disasm/t12_bit.s -+++ b/gdb/testsuite/gdb.disasm/t12_bit.s -@@ -174,3 +174,4 @@ _start: - bfst r3h,#0x34:8,@0x12345678:32 ;6a3812345678f334 - - .end -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.disasm/t13_otr.s b/gdb/testsuite/gdb.disasm/t13_otr.s -index 69db411ac52..812cbcf3306 100644 ---- a/gdb/testsuite/gdb.disasm/t13_otr.s -+++ b/gdb/testsuite/gdb.disasm/t13_otr.s -@@ -157,3 +157,4 @@ _start: - nop ;0000 - - .end -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dup-psym.S b/gdb/testsuite/gdb.dwarf2/dup-psym.S -index 6bffeab9d3c..d8932673cb5 100644 ---- a/gdb/testsuite/gdb.dwarf2/dup-psym.S -+++ b/gdb/testsuite/gdb.dwarf2/dup-psym.S -@@ -197,3 +197,4 @@ func_cu1: - .byte 1 - - .Lline1_end: -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc-hello-dbg.S b/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc-hello-dbg.S -index 742bf5245cb..7a9e6168b12 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc-hello-dbg.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc-hello-dbg.S -@@ -149,3 +149,4 @@ LELTP: - .uleb128 0x1 - .byte 0x1 - LELT: -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc-world-dbg.S b/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc-world-dbg.S -index cb875da2c4c..1771593b7e5 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc-world-dbg.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc-world-dbg.S -@@ -149,3 +149,4 @@ LELTP: - .uleb128 0x1 - .byte 0x1 - LELT: -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ada-ffffffff.S b/gdb/testsuite/gdb.dwarf2/dw2-ada-ffffffff.S -index 5ce56921d4e..2a1d4b5bc28 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-ada-ffffffff.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-ada-ffffffff.S -@@ -53,3 +53,4 @@ debug_end: - .byte 0x0 - .byte 0x0 - .byte 0x0 -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-anon-mptr.S b/gdb/testsuite/gdb.dwarf2/dw2-anon-mptr.S -index 0b8e8ccada3..c79fd5c7cbc 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-anon-mptr.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-anon-mptr.S -@@ -375,3 +375,4 @@ - - .section .debug_line - .Ldebug_line0: -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-anonymous-func.S b/gdb/testsuite/gdb.dwarf2/dw2-anonymous-func.S -index 3aa369aa6a3..3833799d017 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-anonymous-func.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-anonymous-func.S -@@ -246,3 +246,4 @@ func_cu2: - .byte 1 - - .Lline1_end: -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-bad-elf-other.S b/gdb/testsuite/gdb.dwarf2/dw2-bad-elf-other.S -index 83d2147e8c3..3792e70a641 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-bad-elf-other.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-bad-elf-other.S -@@ -27,3 +27,4 @@ some_func: - .size some_func,.-some_func - some_func_end: - nop -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-bad-parameter-type.S b/gdb/testsuite/gdb.dwarf2/dw2-bad-parameter-type.S -index b4583716881..46178d58fad 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-bad-parameter-type.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-bad-parameter-type.S -@@ -71,3 +71,4 @@ debug_end: - .byte 0x0 - .byte 0x0 - .byte 0x0 -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-basic.S b/gdb/testsuite/gdb.dwarf2/dw2-basic.S -index 93eba201b8b..9be8b9963b5 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-basic.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-basic.S -@@ -197,3 +197,4 @@ func_cu1: - .byte 1 - - .Lline1_end: -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-canonicalize-type.S b/gdb/testsuite/gdb.dwarf2/dw2-canonicalize-type.S -index 2107d88b438..c74781b0de3 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-canonicalize-type.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-canonicalize-type.S -@@ -154,3 +154,4 @@ debug_end: - .byte 0x0 - .byte 0x0 - .byte 0x0 -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive-debug.S b/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive-debug.S -index e51a18186fd..f7dd7ca55e3 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive-debug.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive-debug.S -@@ -126,3 +126,4 @@ - - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-compdir-oldgcc.S b/gdb/testsuite/gdb.dwarf2/dw2-compdir-oldgcc.S -index 5128e252896..bc8317752e0 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-compdir-oldgcc.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-compdir-oldgcc.S -@@ -239,3 +239,4 @@ gcc43: .globl gcc43 - .uleb128 1 - .byte 1 - .Lgcc43_end: -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-compressed.S b/gdb/testsuite/gdb.dwarf2/dw2-compressed.S -index 00d7c3aa8fb..8c778423cd8 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-compressed.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-compressed.S -@@ -218,3 +218,4 @@ func_cu1: - .byte 0x9c - .byte 0x00 - .byte 0x92 -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-const.S b/gdb/testsuite/gdb.dwarf2/dw2-const.S -index 09263ff9b08..26fe111369c 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-const.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-const.S -@@ -249,3 +249,4 @@ func_cu1: - .byte 1 - - .Lline1_end: -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.S b/gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.S -index 20061ba23e6..8b35f999614 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.S -@@ -113,3 +113,4 @@ - - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-cu-size.S b/gdb/testsuite/gdb.dwarf2/dw2-cu-size.S -index 1aad8a5af35..de5759877d2 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-cu-size.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-cu-size.S -@@ -107,3 +107,4 @@ - - .byte 0x0 /* Terminator .debug_abbrev - section. */ -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-dos-drive.S b/gdb/testsuite/gdb.dwarf2/dw2-dos-drive.S -index 205b7645d54..9d8e400c6a0 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-dos-drive.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-dos-drive.S -@@ -74,3 +74,4 @@ dieb: - .byte 0x0 - - .byte 0x0 -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-double-set-die-type.S b/gdb/testsuite/gdb.dwarf2/dw2-double-set-die-type.S -index 6f0a0a80346..4a28b1f0d7b 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-double-set-die-type.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-double-set-die-type.S -@@ -648,3 +648,4 @@ - .byte 0x0 - .byte 0x0 - -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-dummy-cu.S b/gdb/testsuite/gdb.dwarf2/dw2-dummy-cu.S -index 298658fbdbf..9bf275f13b4 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-dummy-cu.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-dummy-cu.S -@@ -31,3 +31,4 @@ main_end: - .section .debug_abbrev - .Ldebug_abbrev0: - .byte 0x0 -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-empty-namespace.S b/gdb/testsuite/gdb.dwarf2/dw2-empty-namespace.S -index f6dbb91e14a..b2fb1fcb05c 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-empty-namespace.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-empty-namespace.S -@@ -106,3 +106,4 @@ var: .4byte 1 - - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-empty-pc-range.S b/gdb/testsuite/gdb.dwarf2/dw2-empty-pc-range.S -index 83cc71fb159..c9ad27b2b37 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-empty-pc-range.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-empty-pc-range.S -@@ -80,3 +80,4 @@ dieb: - .byte 0x0 - - .byte 0x0 -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-entry-value.S b/gdb/testsuite/gdb.dwarf2/dw2-entry-value.S -index 491a985823f..223044d7bf7 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-entry-value.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-entry-value.S -@@ -102,3 +102,4 @@ loclist: - .byte 0x0 - .byte 0x0 - .byte 0x0 -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-filename.S b/gdb/testsuite/gdb.dwarf2/dw2-filename.S -index 635577a2873..7895ab7a2bb 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-filename.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-filename.S -@@ -51,3 +51,4 @@ - - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.S b/gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.S -index 834b35e5f50..61e6e74d902 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.S -@@ -252,3 +252,4 @@ debug_info_seg3_end: - .byte 0x08 /* DW_FORM_string. */ - .2byte 0x0000 /* End abbrev. */ - .byte 0x00 /* End abbrev table. */ -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-icycle.S b/gdb/testsuite/gdb.dwarf2/dw2-icycle.S -index 4ccc7bb6947..e63966ccae6 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-icycle.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-icycle.S -@@ -246,3 +246,4 @@ p__top: - .Lline1_begin: - .byte 0 - -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inheritance.S b/gdb/testsuite/gdb.dwarf2/dw2-inheritance.S -index 9c4b576fd39..20b2a9f9c66 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-inheritance.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-inheritance.S -@@ -96,3 +96,4 @@ - - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-param.S b/gdb/testsuite/gdb.dwarf2/dw2-inline-param.S -index 1c79805c2b5..14958e6092d 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-inline-param.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-param.S -@@ -150,3 +150,4 @@ - - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-intercu.S b/gdb/testsuite/gdb.dwarf2/dw2-intercu.S -index 3c9abadb947..d8857fe675d 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-intercu.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-intercu.S -@@ -314,3 +314,4 @@ func_cu1: - .byte 1 - - .Lline1_end: -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-intermix.S b/gdb/testsuite/gdb.dwarf2/dw2-intermix.S -index a2dd41f0514..208a14fdb5f 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-intermix.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-intermix.S -@@ -198,3 +198,4 @@ func_cu1: - .byte 1 - - .Lline1_end: -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.S b/gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.S -index 8f23b3cc7bc..0b8aec84c39 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.S -@@ -132,3 +132,4 @@ c: .4byte 0 - - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.S b/gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.S -index 248908bb072..c87092c031a 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.S -@@ -115,3 +115,4 @@ func2: - - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-modula2-self-type.S b/gdb/testsuite/gdb.dwarf2/dw2-modula2-self-type.S -index f3fe651d92d..c55e86fb127 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-modula2-self-type.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-modula2-self-type.S -@@ -121,3 +121,4 @@ die221: - .string "GNU Modula-2 0.78 (20100402) grafted onto GCC 4.1.2" - .LASF2: - .string "" -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-noloc.S b/gdb/testsuite/gdb.dwarf2/dw2-noloc.S -index 988f0955041..5d7d326aa9f 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-noloc.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-noloc.S -@@ -324,3 +324,4 @@ resolvable: - - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-inner.S b/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-inner.S -index 80f62c38a84..e3a02e795b7 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-inner.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-inner.S -@@ -178,3 +178,4 @@ inner: - .byte 1 - - .Lline1_end: -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-outer.S b/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-outer.S -index a0bda9fa578..213b0bc3d9e 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-outer.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-outer.S -@@ -209,3 +209,4 @@ outer_after: - .byte 1 - - .Lline1_end: -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-op-call.S b/gdb/testsuite/gdb.dwarf2/dw2-op-call.S -index 3069f07ff78..60ef039314c 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-op-call.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-op-call.S -@@ -166,3 +166,4 @@ loclist: - - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-op-out-param.S b/gdb/testsuite/gdb.dwarf2/dw2-op-out-param.S -index 91657263288..51f9f09d1d7 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-op-out-param.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-op-out-param.S -@@ -675,3 +675,4 @@ int_param_two_reg_pieces: - .byte 0x0 - - .byte 0x0 -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.S b/gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.S -index 6c7ff185cfc..eff6467acbc 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.S -@@ -130,3 +130,4 @@ aa551234: .byte 0xaa, 0x55, 0x12, 0x34 - - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-param-error.S b/gdb/testsuite/gdb.dwarf2/dw2-param-error.S -index f22e6450848..a2a5a1d08a9 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-param-error.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-param-error.S -@@ -106,3 +106,4 @@ debug_end: - .byte 0x0 - .byte 0x0 - .byte 0x0 -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-producer.S b/gdb/testsuite/gdb.dwarf2/dw2-producer.S -index df83b67dfdd..011af698920 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-producer.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-producer.S -@@ -198,3 +198,4 @@ func_cu1: - .byte 1 - - .Lline1_end: -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.S b/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.S -index 38bbe013ddc..4780025dca5 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.S -@@ -149,3 +149,4 @@ - - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-restore.S b/gdb/testsuite/gdb.dwarf2/dw2-restore.S -index 8ac559f2c45..ad834e992df 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-restore.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-restore.S -@@ -47,3 +47,4 @@ foo: .cfi_startproc - jmp 1b - .cfi_endproc - .endfunc -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-simple-locdesc.S b/gdb/testsuite/gdb.dwarf2/dw2-simple-locdesc.S -index 90f5b8e3217..1da2a52e2dd 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-simple-locdesc.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-simple-locdesc.S -@@ -167,3 +167,4 @@ d: - .string "sizetype" - .LASF1: - .string "char" -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S b/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S -index b8a18f647b1..1245c1cf080 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S -@@ -397,3 +397,4 @@ loclist: - .byte 1 - - .Lline1_end: -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.S b/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.S -index dc392fe01d6..8bef4f062f1 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.S -@@ -66,3 +66,4 @@ debug_end: - .byte 0x0 - .byte 0x0 - .byte 0x0 -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-strp.S b/gdb/testsuite/gdb.dwarf2/dw2-strp.S -index 1857a2c10fa..f154b680f5f 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-strp.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-strp.S -@@ -176,3 +176,4 @@ - .string "hello world!\n" - .Lemptyname: - .string "" -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-unresolved.S b/gdb/testsuite/gdb.dwarf2/dw2-unresolved.S -index 2313e0c1c48..d1d78f15a05 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-unresolved.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-unresolved.S -@@ -178,3 +178,4 @@ SYMBOL(var): .byte 2 - - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-var-zero-addr.S b/gdb/testsuite/gdb.dwarf2/dw2-var-zero-addr.S -index d05e06c792c..5d402e9cbe7 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-var-zero-addr.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-var-zero-addr.S -@@ -90,3 +90,4 @@ - - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw4-sig-type-unused.S b/gdb/testsuite/gdb.dwarf2/dw4-sig-type-unused.S -index 38231f18f41..0d9ad40c82a 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw4-sig-type-unused.S -+++ b/gdb/testsuite/gdb.dwarf2/dw4-sig-type-unused.S -@@ -85,3 +85,4 @@ types_start: - .byte 0x0 - .byte 0x0 - .byte 0x0 -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/fission-reread.S b/gdb/testsuite/gdb.dwarf2/fission-reread.S -index c829fef32c7..92c6be49363 100644 ---- a/gdb/testsuite/gdb.dwarf2/fission-reread.S -+++ b/gdb/testsuite/gdb.dwarf2/fission-reread.S -@@ -460,3 +460,4 @@ SYMBOL(main): - .Ldebug_addr0: - .4byte .LFB0 /* DW_AT_low_pc */ - .4byte SYMBOL(baz) /* DW_AT_location */ -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.S b/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.S -index 268745275f4..5ec9c8c494b 100644 ---- a/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.S -+++ b/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.S -@@ -164,3 +164,4 @@ __start_high_pc: - - .global __cu_high_pc - __cu_high_pc: -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/mac-fileno.S b/gdb/testsuite/gdb.dwarf2/mac-fileno.S -index 462781495a1..ca70acb421f 100644 ---- a/gdb/testsuite/gdb.dwarf2/mac-fileno.S -+++ b/gdb/testsuite/gdb.dwarf2/mac-fileno.S -@@ -209,3 +209,4 @@ func_cu1: - .uleb128 0x0 /* Included from line number 0 */ - .uleb128 0x0 /* Filename we just started (bug: number too small) */ - .byte 0x0 /* end of CU's macro information */ -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/pr11465.S b/gdb/testsuite/gdb.dwarf2/pr11465.S -index 28155090f23..eaf2925a768 100644 ---- a/gdb/testsuite/gdb.dwarf2/pr11465.S -+++ b/gdb/testsuite/gdb.dwarf2/pr11465.S -@@ -360,3 +360,4 @@ die149: .uleb128 0x16 /* DW_TAG_variable */ - .LASF4: - .string "GNU C++ 4.4.2" - .ident "GCC: (GNU) 4.4.2" -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/pr13961.S b/gdb/testsuite/gdb.dwarf2/pr13961.S -index d3b4acee53f..aa34a0bafce 100644 ---- a/gdb/testsuite/gdb.dwarf2/pr13961.S -+++ b/gdb/testsuite/gdb.dwarf2/pr13961.S -@@ -378,3 +378,4 @@ SYMBOL(main): - .LASF3: - .string "main" - -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.linespec/break-asm-file0.s b/gdb/testsuite/gdb.linespec/break-asm-file0.s -index 94f0ec0daa3..c3beb38cba4 100644 ---- a/gdb/testsuite/gdb.linespec/break-asm-file0.s -+++ b/gdb/testsuite/gdb.linespec/break-asm-file0.s -@@ -231,3 +231,4 @@ func: - .byte 1 - - .Lline1_end: -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.linespec/break-asm-file1.s b/gdb/testsuite/gdb.linespec/break-asm-file1.s -index 0106394d997..ff97bb3f977 100644 ---- a/gdb/testsuite/gdb.linespec/break-asm-file1.s -+++ b/gdb/testsuite/gdb.linespec/break-asm-file1.s -@@ -257,3 +257,4 @@ func: - .byte 1 - - .Lline1_end: -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.mi/dw2-ref-missing-frame.S b/gdb/testsuite/gdb.mi/dw2-ref-missing-frame.S -index c93c1cdddbf..886c70d8746 100644 ---- a/gdb/testsuite/gdb.mi/dw2-ref-missing-frame.S -+++ b/gdb/testsuite/gdb.mi/dw2-ref-missing-frame.S -@@ -163,3 +163,4 @@ - - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.tui/tui-layout-asm-short-prog.S b/gdb/testsuite/gdb.tui/tui-layout-asm-short-prog.S -index 4ac9785a5d5..bd81bfd21e1 100644 ---- a/gdb/testsuite/gdb.tui/tui-layout-asm-short-prog.S -+++ b/gdb/testsuite/gdb.tui/tui-layout-asm-short-prog.S -@@ -20,3 +20,4 @@ _start: - .rept 5 - nop - .endr -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp -index 6e8b1ccbe7f..29151574c0d 100644 ---- a/gdb/testsuite/lib/dwarf.exp -+++ b/gdb/testsuite/lib/dwarf.exp -@@ -2910,6 +2910,8 @@ namespace eval Dwarf { - - _write_deferred_output - -+ _section .note.GNU-stack "" progbits -+ - catch {close $_output_file} - set _output_file {} - } -diff --git a/gdb/testsuite/lib/my-syscalls.S b/gdb/testsuite/lib/my-syscalls.S -index 5fc38948217..7f06f9c398b 100644 ---- a/gdb/testsuite/lib/my-syscalls.S -+++ b/gdb/testsuite/lib/my-syscalls.S -@@ -54,3 +54,5 @@ my_execve_syscall: - #else - # error "Unsupported architecture" - #endif -+ -+ .section .note.GNU-stack,"",@progbits --- -2.35.3 - diff --git a/gdb-testsuite-handle-missing-gdc-in-gdb.dlang-dlang-.patch b/gdb-testsuite-handle-missing-gdc-in-gdb.dlang-dlang-.patch new file mode 100644 index 0000000..da6c47f --- /dev/null +++ b/gdb-testsuite-handle-missing-gdc-in-gdb.dlang-dlang-.patch @@ -0,0 +1,77 @@ +From f53b5ad4cd27738387f22e067881a15a2327ba5b Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Mon, 27 Mar 2023 11:35:26 +0200 +Subject: [PATCH 3/6] [gdb/testsuite] Handle missing gdc in + gdb.dlang/dlang-start.exp + +On openSUSE Leap 15.4, I get: +... +Running gdb.dlang/dlang-start.exp ... +gdb compile failed, default_target_compile: Can't find gdc. +UNTESTED: gdb.dlang/dlang-start.exp: failed to prepare +... + +Fix this by: +- introducing a new proc can_compile, and +- requiring "can_compile d" in the test-case, +such that I have instead: +... +Running gdb.dlang/dlang-start.exp ... +UNSUPPORTED: gdb.dlang/dlang-start.exp: require failed: can_compile d +... + +Tested on x86_64-linux, on openSUSE Leap 15.4 and Fedora 37. +--- + gdb/testsuite/gdb.dlang/dlang-start.exp | 1 + + gdb/testsuite/lib/gdb.exp | 16 ++++++++++++++++ + 2 files changed, 17 insertions(+) + +diff --git a/gdb/testsuite/gdb.dlang/dlang-start.exp b/gdb/testsuite/gdb.dlang/dlang-start.exp +index 3e5b6050c07..413e8514968 100644 +--- a/gdb/testsuite/gdb.dlang/dlang-start.exp ++++ b/gdb/testsuite/gdb.dlang/dlang-start.exp +@@ -18,6 +18,7 @@ + load_lib d-support.exp + + if { [skip_d_tests] } { continue } ++if { ![can_compile d] } { continue } + + # This testcase verifies the behavior of the `start' command, which + # does not work when we use the gdb stub... +diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp +index 095d8930edb..b6e30204371 100644 +--- a/gdb/testsuite/lib/gdb.exp ++++ b/gdb/testsuite/lib/gdb.exp +@@ -2471,6 +2471,18 @@ proc skip_d_tests {} { + return 0 + } + ++# Return a 1 if we can compile source files in LANG. ++ ++proc can_compile { lang } { ++ ++ if { $lang == "d" } { ++ set src { void main() {} } ++ return [gdb_can_simple_compile can_compile_$lang $src executable {d}] ++ } ++ ++ error "can_compile doesn't support lang: $lang" ++} ++ + # Return 1 to skip Rust tests, 0 to try them. + proc skip_rust_tests {} { + if { ![isnative] } { +@@ -4632,6 +4644,10 @@ proc gdb_simple_compile {name code {type object} {compile_flags {}} {object obj} + set ext "go" + break + } ++ if { "$flag" eq "d" } { ++ set ext "d" ++ break ++ } + } + set src [standard_temp_file $name-[pid].$ext] + set obj [standard_temp_file $name-[pid].$postfix] +-- +2.35.3 + diff --git a/gdb-testsuite-handle-older-python-in-gdb.python-py-send-packet.py.patch b/gdb-testsuite-handle-older-python-in-gdb.python-py-send-packet.py.patch deleted file mode 100644 index fc546d9..0000000 --- a/gdb-testsuite-handle-older-python-in-gdb.python-py-send-packet.py.patch +++ /dev/null @@ -1,62 +0,0 @@ -[gdb/testsuite] Handle older python in gdb.python/py-send-packet.py - -With python 3.4, I run into: -... -Traceback (most recent call last):^M - File "", line 1, in ^M - File - "outputs/gdb.python/py-send-packet/py-send-packet.py", line 128, in \ - run_set_global_var_test^M - res = conn.send_packet(b"X%x,4:\x02\x02\x02\x02" % addr)^M -TypeError: Could not convert Python object: b'X%x,4:\x02\x02\x02\x02'.^M -Error while executing Python code.^M -... -while with python 3.6 this works fine. - -Fix this by avoiding the byte literal (with prefix b), and use instead: -... - bytes(("X%x,4:" % addr).encode('ascii') + bytearray([0x2, 0x2, 0x2, 0x2])). -... - ---- - gdb/testsuite/gdb.python/py-send-packet.py | 13 +++++++++++-- - 1 file changed, 11 insertions(+), 2 deletions(-) - -diff --git a/gdb/testsuite/gdb.python/py-send-packet.py b/gdb/testsuite/gdb.python/py-send-packet.py -index 4966688a922..f58deed1019 100644 ---- a/gdb/testsuite/gdb.python/py-send-packet.py -+++ b/gdb/testsuite/gdb.python/py-send-packet.py -@@ -122,6 +122,15 @@ def check_global_var(expected_val): - if val != expected_val: - raise gdb.GdbError("global_var is 0x%x, expected 0x%x" % (val, expected_val)) - -+# Return a bytes object representing an 'X' packet with -+# address ADDR and bytes L. -+def bytes_xpacket (addr, l): -+ # Implement b"X%x,4:\xff\xff\xff\xff" % addr in a way that works -+ # across python versions. -+ res = ("X%x,4:" % addr).encode('ascii') + bytearray(l) -+ # Force it to type bytes. -+ res = bytes(res) -+ return res - - # Set the 'X' packet to the remote target to set a global variable. - # Checks that we can send byte values. -@@ -133,7 +142,7 @@ def run_set_global_var_test(): - res = conn.send_packet("X%x,4:\x01\x01\x01\x01" % addr) - assert isinstance(res, bytes) - check_global_var(0x01010101) -- res = conn.send_packet(b"X%x,4:\x02\x02\x02\x02" % addr) -+ res = conn.send_packet(bytes_xpacket(addr, [0x2, 0x2, 0x2, 0x2])) - assert isinstance(res, bytes) - check_global_var(0x02020202) - if sys.version_info[0] > 2: -@@ -149,7 +158,7 @@ def run_set_global_var_test(): - assert saw_error - check_global_var(0x02020202) - # Now we pass a bytes object, which will work. -- res = conn.send_packet(b"X%x,4:\xff\xff\xff\xff" % addr) -+ res = conn.send_packet(bytes_xpacket(addr, [0xff, 0xff, 0xff, 0xff])) - check_global_var(0xFFFFFFFF) - else: - # On Python 2 we need to force the creation of a Unicode diff --git a/gdb-testsuite-handle-output-after-prompt-in-gdb.thre.patch b/gdb-testsuite-handle-output-after-prompt-in-gdb.thre.patch new file mode 100644 index 0000000..dbaaaeb --- /dev/null +++ b/gdb-testsuite-handle-output-after-prompt-in-gdb.thre.patch @@ -0,0 +1,53 @@ +From a39101060cdf2ee239833106fb3bdf9585f858aa Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Wed, 7 Jun 2023 11:36:19 +0200 +Subject: [PATCH] [gdb/testsuite] Handle output after prompt in + gdb.threads/step-N-all-progress.exp + +Using "taskset -c 0" I run into this timeout: +... +(gdb) PASS: gdb.threads/step-N-all-progress.exp: non-stop=on: \ + target-non-stop=on: continue to breakpoint: break here +next 3^M +[New Thread 0x7ffff7dbd6c0 (LWP 10202)]^M +50 return 0;^M +(gdb) [Thread 0x7ffff7dbd6c0 (LWP 10202) exited]^M +FAIL: gdb.threads/step-N-all-progress.exp: non-stop=on: target-non-stop=on: \ + next 3 (timeout) +... + +The problem is that this test: +... + gdb_test "next 3" "return 0;" +... +expects no output after the prompt. + +Fix this by using -no-prompt-anchor. + +Tested on x86_64-linux. +--- + gdb/testsuite/gdb.threads/step-N-all-progress.exp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.threads/step-N-all-progress.exp b/gdb/testsuite/gdb.threads/step-N-all-progress.exp +index 98cc8423f34..485028d34e7 100644 +--- a/gdb/testsuite/gdb.threads/step-N-all-progress.exp ++++ b/gdb/testsuite/gdb.threads/step-N-all-progress.exp +@@ -44,7 +44,7 @@ proc test {non-stop target-non-stop} { + + gdb_continue_to_breakpoint "break here" + +- gdb_test "next 3" "return 0;" ++ gdb_test -no-prompt-anchor "next 3" "return 0;" + } + + foreach_with_prefix non-stop {off on} { + +base-commit: 7f7fcd7031430953f41b284069d1ed0cf3c8734a +prerequisite-patch-id: b0bf6c343c4113f430e2dce98279078433692131 +prerequisite-patch-id: 20ed3972a694ff7b7eebd0626be31f8694c62afe +prerequisite-patch-id: 2d7b3990c49a8ddc0e4ebc5c328b8cfcd841ec93 +prerequisite-patch-id: 201c63297f725b3796a241d804df62e02b4a8abc +-- +2.35.3 + diff --git a/gdb-testsuite-handle-pipe2-syscall-in-gdb.base-catch-syscall.exp.patch b/gdb-testsuite-handle-pipe2-syscall-in-gdb.base-catch-syscall.exp.patch deleted file mode 100644 index 56936f7..0000000 --- a/gdb-testsuite-handle-pipe2-syscall-in-gdb.base-catch-syscall.exp.patch +++ /dev/null @@ -1,154 +0,0 @@ -[gdb/testsuite] Handle pipe2 syscall in gdb.base/catch-syscall.exp - -When running test-case gdb.reverse/pipe-reverse.exp on openSUSE Tumbleweed, -I run into: -... -(gdb) continue^M -Continuing.^M -^M -Catchpoint 2 (returned from syscall pipe2), in pipe () from /lib64/libc.so.6^M -(gdb) FAIL: gdb.base/catch-syscall.exp: without arguments: \ - syscall pipe has returned -... - -The current glibc on Tumbleweed is 2.35, which contains commit -"linux: Implement pipe in terms of __NR_pipe2", and consequently syscall pipe2 -is used instead of syscall pipe. - -Fix this by detecting whether syscall pipe or pipe2 is used before running the -tests. - -Tested on x86_64-linux, specifically on: -- openSUSE Tumbleweed (with glibc 2.35), and -- openSUSE Leap 15.3 (with glibc 2.31). - -On openSUSE Tumbleweed + target board unix/-m32, this exposes: -... -(gdb) catch syscall pipe2^M -Unknown syscall name 'pipe2'.^M -... -which will be fixed in a folllow-up patch. - -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29056 - ---- - gdb/testsuite/gdb.base/catch-syscall.c | 3 +- - gdb/testsuite/gdb.base/catch-syscall.exp | 69 ++++++++++++++++++++++++++++---- - 2 files changed, 64 insertions(+), 8 deletions(-) - -diff --git a/gdb/testsuite/gdb.base/catch-syscall.c b/gdb/testsuite/gdb.base/catch-syscall.c -index 0ab96318d3e..8c252a06b20 100644 ---- a/gdb/testsuite/gdb.base/catch-syscall.c -+++ b/gdb/testsuite/gdb.base/catch-syscall.c -@@ -24,7 +24,8 @@ int chroot_syscall = SYS_chroot; - int read_syscall = SYS_read; - #ifdef SYS_pipe - int pipe_syscall = SYS_pipe; --#else -+#endif -+#ifdef SYS_pipe2 - int pipe2_syscall = SYS_pipe2; - #endif - int write_syscall = SYS_write; -diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp -index a5dfd02411b..1427dfece6d 100644 ---- a/gdb/testsuite/gdb.base/catch-syscall.exp -+++ b/gdb/testsuite/gdb.base/catch-syscall.exp -@@ -669,35 +669,90 @@ proc fill_all_syscalls_numbers {} { - set unknown_syscall_number [get_integer_valueof "unknown_syscall" -1] - } - --# Set up the vector all_syscalls. -+# Set up the vector all_syscalls. Returns 1 upon success, 0 upon failure. - - proc setup_all_syscalls {} { - global all_syscalls - global gdb_prompt -+ global decimal - - # They are ordered according to the file, so do not change this. - lappend all_syscalls "close" - lappend all_syscalls "chroot" - -+ if { ![runto_main] } { -+ return 0 -+ } -+ - # SYS_pipe doesn't exist on aarch64 kernel. - set test "check SYS_pipe" -+ set have_SYS_pipe 0 - gdb_test_multiple "p pipe_syscall" $test { -- -re " = .*$gdb_prompt $" { -+ -re -wrap " = $decimal" { - pass $test -- lappend all_syscalls "pipe" -+ set have_SYS_pipe 1 - } -- -re "No symbol .*$gdb_prompt $" { -+ -re -wrap "No symbol .*" { - pass $test -- # SYS_pipe isn't defined, use SYS_pipe2 instead. -- lappend all_syscalls "pipe2" -+ } -+ } -+ -+ set test "check SYS_pipe2" -+ set have_SYS_pipe2 0 -+ gdb_test_multiple "p pipe2_syscall" $test { -+ -re -wrap " = $decimal" { -+ pass $test -+ set have_SYS_pipe2 1 -+ } -+ -re -wrap "No symbol .*" { -+ pass $test -+ } -+ } -+ -+ if { $have_SYS_pipe == 0 && $have_SYS_pipe2 == 0 } { -+ return 0 -+ } -+ -+ with_test_prefix "determine pipe syscall" { -+ set line [gdb_get_line_number "pipe (fd)"] -+ gdb_test "break $line" -+ gdb_continue_to_breakpoint "before pipe call" -+ if { $have_SYS_pipe } { -+ gdb_test "catch syscall pipe" -+ } -+ if { $have_SYS_pipe2 } { -+ gdb_test "catch syscall pipe2" -+ } -+ set ok 0 -+ gdb_test_multiple "continue" "" { -+ -re -wrap "Catchpoint $decimal \\(call to syscall pipe\\).*" { -+ lappend all_syscalls pipe -+ pass $gdb_test_name -+ set ok 1 -+ } -+ -re -wrap "Catchpoint $decimal \\(call to syscall pipe2\\).*" { -+ lappend all_syscalls pipe2 -+ pass $gdb_test_name -+ set ok 1 -+ } -+ -re -wrap "" { -+ fail $gdb_test_name -+ } -+ } -+ if { ! $ok } { -+ return 0 - } - } - - lappend all_syscalls "write" - lappend all_syscalls "read" -+ -+ return 1 - } - --setup_all_syscalls -+if { ![setup_all_syscalls] } { -+ return -1 -+} - - # Fill all the syscalls numbers before starting anything. - fill_all_syscalls_numbers diff --git a/gdb-testsuite-handle-quotes-in-gdb_py_module_available.patch b/gdb-testsuite-handle-quotes-in-gdb_py_module_available.patch deleted file mode 100644 index 8836448..0000000 --- a/gdb-testsuite-handle-quotes-in-gdb_py_module_available.patch +++ /dev/null @@ -1,36 +0,0 @@ -[gdb/testsuite] Handle quotes in gdb_py_module_available - -On openSUSE Leap 42.3 with python 3.4, I run into: -... -(gdb) python import pygments^M -Traceback (most recent call last):^M - File "", line 1, in ^M -ImportError: No module named 'pygments'^M -Error while executing Python code.^M -(gdb) FAIL: gdb.base/style.exp: python import pygments -ERROR: unexpected output from python import -... -because gdb_py_module_available doesn't handle the single quotes around the -module name in the ImportError. - -Fix this by allowing the single quotes. - -Tested on x86_64-linux. - ---- - gdb/testsuite/lib/gdb-python.exp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gdb/testsuite/lib/gdb-python.exp b/gdb/testsuite/lib/gdb-python.exp -index d5039bbd099..c7a3907dd2b 100644 ---- a/gdb/testsuite/lib/gdb-python.exp -+++ b/gdb/testsuite/lib/gdb-python.exp -@@ -61,7 +61,7 @@ proc gdb_py_module_available { name } { - -re -wrap "ModuleNotFoundError: No module named '${name}'.*" { - set available false - } -- -re -wrap "ImportError: No module named ${name}.*" { -+ -re -wrap "ImportError: No module named '?${name}.*'?" { - set available false - } - -re -wrap "python import ${name}" { diff --git a/gdb-testsuite-handle-unordered-dict-in-gdb.python-py-mi-cmd.exp.patch b/gdb-testsuite-handle-unordered-dict-in-gdb.python-py-mi-cmd.exp.patch deleted file mode 100644 index dedc093..0000000 --- a/gdb-testsuite-handle-unordered-dict-in-gdb.python-py-mi-cmd.exp.patch +++ /dev/null @@ -1,48 +0,0 @@ -[gdb/testsuite] Handle unordered dict in gdb.python/py-mi-cmd.exp - -When running test-case gdb.python/py-mi-cmd.exp on openSUSE Leap 42.3 with -python 3.4, I occasionally run into: -... -Expecting: ^(-pycmd dct[^M -]+)?(\^done,result={hello="world",times="42"}[^M -]+[(]gdb[)] ^M -[ ]*) --pycmd dct^M -^done,result={times="42",hello="world"}^M -(gdb) ^M -FAIL: gdb.python/py-mi-cmd.exp: -pycmd dct (unexpected output) -... - -The problem is that the data type used here in py-mi-cmd.py: -... - elif argv[0] == "dct": - return {"result": {"hello": "world", "times": 42}} -... -is a dictionary, and only starting version 3.6 are dictionaries insertion -ordered, so using PyDict_Next in serialize_mi_result doesn't guarantee a -fixed order. - -Fix this by allowing the alternative order. - -Tested on x86_64-linux. - ---- - gdb/testsuite/gdb.python/py-mi-cmd.exp | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/gdb/testsuite/gdb.python/py-mi-cmd.exp b/gdb/testsuite/gdb.python/py-mi-cmd.exp -index 300ab956892..45278bada7c 100644 ---- a/gdb/testsuite/gdb.python/py-mi-cmd.exp -+++ b/gdb/testsuite/gdb.python/py-mi-cmd.exp -@@ -54,8 +54,10 @@ mi_gdb_test "-pycmd ary" \ - "\\^done,result=\\\[\"Hello\",\"42\"\\\]" \ - "-pycmd ary" - -+set re_order1 "\\^done,result={hello=\"world\",times=\"42\"}" -+set re_order2 "\\^done,result={times=\"42\",hello=\"world\"}" - mi_gdb_test "-pycmd dct" \ -- "\\^done,result={hello=\"world\",times=\"42\"}" \ -+ "($re_order1|$re_order2)" \ - "-pycmd dct" - - mi_gdb_test "-pycmd bk1" \ diff --git a/gdb-testsuite-prevent-compilation-fails-with-unix-fpie-pie.patch b/gdb-testsuite-prevent-compilation-fails-with-unix-fpie-pie.patch index 78478c2..dd7986d 100644 --- a/gdb-testsuite-prevent-compilation-fails-with-unix-fpie-pie.patch +++ b/gdb-testsuite-prevent-compilation-fails-with-unix-fpie-pie.patch @@ -1,4 +1,8 @@ -[gdb/testsuite] Prevent compilation fails with unix/-fPIE/-pie +From ea9f87de71b8d5cd0f9d62ebca57cef7ee879324 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Fri, 21 Apr 2023 18:01:00 +0200 +Subject: [PATCH 5/5] [gdb/testsuite] Prevent compilation fails with + unix/-fPIE/-pie A regular test-case will produce an executable, and depending on the compiler default, it will be a PIE or not. A test-case can force one or the other @@ -47,18 +51,17 @@ UNTESTED: gdb.arch/amd64-disp-step.exp: failed to prepare Likewise, add nopie_forced. Tested on x86_64-linux. - --- - gdb/testsuite/lib/gdb.exp | 53 +++++++++++++++++++++++++++++++++++++++++++++++ + gdb/testsuite/lib/gdb.exp | 53 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp -index 2b94f79d132..dbf4016aca1 100644 +index 2be69479d70..85ef279bfe9 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp -@@ -4407,6 +4407,17 @@ proc gdb_compile {source dest type options} { - lappend options "$flag" - } +@@ -4966,6 +4966,17 @@ proc gdb_compile {source dest type options} { + set options [lreplace $options $macros $macros $flag] + } + if { $pie != -1 && [nopie_forced] } { + set result "pie unsupported" @@ -74,10 +77,10 @@ index 2b94f79d132..dbf4016aca1 100644 if { $type == "executable" } { if { ([istarget "*-*-mingw*"] || [istarget "*-*-*djgpp"] -@@ -7928,6 +7939,48 @@ gdb_caching_proc have_fuse_ld_gold { - return [gdb_simple_compile $me $src executable $flags] +@@ -8875,6 +8886,48 @@ gdb_caching_proc linker_supports_image_base_flag { } + +# Helper function for pie_forced. +proc pie_forced_0 { } { return 0 } + @@ -123,3 +126,6 @@ index 2b94f79d132..dbf4016aca1 100644 # Return 1 if compiler supports scalar_storage_order attribute, otherwise # return 0. gdb_caching_proc supports_scalar_storage_order_attribute { +-- +2.35.3 + diff --git a/gdb-testsuite-refactor-gdb.threads-detach-step-over.exp.patch b/gdb-testsuite-refactor-gdb.threads-detach-step-over.exp.patch deleted file mode 100644 index 5813b24..0000000 --- a/gdb-testsuite-refactor-gdb.threads-detach-step-over.exp.patch +++ /dev/null @@ -1,305 +0,0 @@ -gdb/testsuite: refactor gdb.threads/detach-step-over.exp - -Factor out some bits of gdb.threads/detach-step-over.exp to procs in -preparation to adding some new variations of the test. Rename the -existing "test" proc and make it use proc_with_prefix. - -Co-Authored-By: Simon Marchi -Change-Id: Ib4412545c81c8556029e0f7bfa9dd48d7a9f3189 - ---- - gdb/testsuite/gdb.threads/detach-step-over.exp | 238 ++++++++++++++----------- - 1 file changed, 138 insertions(+), 100 deletions(-) - -diff --git a/gdb/testsuite/gdb.threads/detach-step-over.exp b/gdb/testsuite/gdb.threads/detach-step-over.exp -index 917be2ef378..ad9b08f549e 100644 ---- a/gdb/testsuite/gdb.threads/detach-step-over.exp -+++ b/gdb/testsuite/gdb.threads/detach-step-over.exp -@@ -56,11 +56,11 @@ standard_testfile - - set bp_lineno [gdb_get_line_number "Set breakpoint here"] - --# The test proper. See description above. --proc test {condition_eval target_non_stop non_stop displaced} { -- # Number of threads started by the program. -- set n_threads 10 -+# Number of threads started by the program. -+set n_threads 10 - -+# Start GDB, configuring various settings according to the arguments. -+proc start_gdb_for_test {condition_eval target_non_stop non_stop displaced} { - save_vars { ::GDBFLAGS } { - append ::GDBFLAGS " -ex \"maint set target-non-stop $target_non_stop\"" - append ::GDBFLAGS " -ex \"set non-stop $non_stop\"" -@@ -69,10 +69,137 @@ proc test {condition_eval target_non_stop non_stop displaced} { - clean_restart $::binfile - } - -+ gdb_test_no_output "set breakpoint condition-evaluation $condition_eval" -+} -+ -+# Use the 'attach' command to attach to process with pid TESTPID. Return true -+# if we believe GDB has attached and we are back at the GDB prompt, otherwise, -+# return false. -+proc attach_to {testpid} { -+ with_timeout_factor 2 { -+ set attached 0 -+ set saw_attaching 0 -+ gdb_test_multiple "attach $testpid" "attach" { -+ -re "Attaching to program.*process $testpid\r\n" { -+ set saw_attaching 1 -+ exp_continue -+ } -+ -re "new threads in iteration" { -+ # Seen when "set debug libthread_db" is on. -+ exp_continue -+ } -+ -re "Reading symbols from|Expanding full symbols from" { -+ # Prevent -readnow timeout. -+ exp_continue -+ } -+ -re "is a zombie - the process has already terminated.*$::gdb_prompt " { -+ fail $gdb_test_name -+ } -+ -re "Unable to attach: .*$::gdb_prompt " { -+ fail $gdb_test_name -+ } -+ -re "\r\n$::gdb_prompt " { -+ if { $saw_attaching } { -+ set attached 1 -+ pass $gdb_test_name -+ } else { -+ fail $gdb_test_name -+ } -+ } -+ } -+ } -+ -+ return $attached -+} -+ -+# After attaching to a multi-threaded inferior in non-stop mode, we expect to -+# see a stop message from each thread. This proc waits for all of these stop -+# messages. TID_RE is a regexp used to match the thread-id of the stopped -+# thread. -+# -+# Return true if we saw a stop from each of the expected threads (based on the -+# global N_THREADS value), otherwise, return false. -+proc check_stops_after_non_stop_attach {tid_re} { -+ set any "\[^\r\n\]*" -+ -+ # In non-stop, we will see one stop per thread after the prompt. -+ set stops 0 -+ set test "seen all stops" -+ for {set thread 1} { $thread <= $::n_threads } { incr thread } { -+ if {[gdb_test_multiple "" $test { -+ -re "Thread ${tid_re} ${any} stopped" { -+ incr stops -+ } -+ }] != 0} { -+ break -+ } -+ } -+ -+ # If we haven't seen all stops, then the -+ # gdb_test_multiple in the loop above will have -+ # already issued a FAIL. -+ if {$stops != $::n_threads} { -+ return false -+ } -+ pass $test -+ return true -+} -+ -+# Prepare for a single test iteration. TESTPID is the pid of the process GDB -+# will be attached too. NON_STOP indicates if GDB is configured in non-stop -+# mode or not. ATTEMPT is the current attempt number, and ATTEMPTS is the -+# maximum number of attempts we plan to run. TID_RE is a string used to match -+# against a thread-id in GDB's stop messages. -+# -+# Return true if everything is prepared correctly, otherwise return false. -+proc prepare_test_iter {testpid non_stop attempt attempts tid_re} { -+ if {![attach_to $testpid]} { -+ return false -+ } -+ -+ if {$non_stop} { -+ if {![check_stops_after_non_stop_attach $tid_re]} { -+ return false -+ } -+ } -+ -+ gdb_test "break ${::srcfile}:${::bp_lineno} if 0" "Breakpoint.*" \ -+ "break LOC if 0" -+ -+ if {$attempt < $attempts} { -+ # Kick the time out timer for another round. -+ gdb_test "print again = 1" " = 1" "reset timer in the inferior" -+ # Show the time we had left in the logs, in case -+ # something goes wrong. -+ gdb_test "print seconds_left" " = .*" -+ } -+ -+ if {$non_stop} { -+ set cont_cmd "continue -a &" -+ } else { -+ set cont_cmd "continue &" -+ } -+ -+ set cont_cmd_re [string_to_regexp $cont_cmd] -+ gdb_test_multiple $cont_cmd "" { -+ -re "^$cont_cmd_re\r\nContinuing\.\r\n$::gdb_prompt " { -+ pass $gdb_test_name -+ } -+ } -+ -+ # Wait a bit, to give time for the threads to hit the -+ # breakpoint. -+ sleep 1 -+ -+ return true -+} -+ -+# The test proper. See the description at the top of the file. -+proc_with_prefix test_detach_command {condition_eval target_non_stop non_stop displaced} { - set test_spawn_id [spawn_wait_for_attach $::binfile] - set testpid [spawn_id_get_pid $test_spawn_id] - -- set any "\[^\r\n\]*" -+ start_gdb_for_test $condition_eval $target_non_stop $non_stop $displaced - - gdb_test "add-inferior" "Added inferior 2.*" - gdb_test "inferior 2" "Switching to .*" -@@ -84,8 +211,6 @@ proc test {condition_eval target_non_stop non_stop displaced} { - return - } - -- gdb_test_no_output "set breakpoint condition-evaluation $condition_eval" -- - # Get the PID of the test process. - set pid_inf2 "" - gdb_test_multiple "p mypid" "get pid of inferior 2" { -@@ -100,101 +225,12 @@ proc test {condition_eval target_non_stop non_stop displaced} { - with_test_prefix "iter $attempt" { - gdb_test "inferior 1" "Switching to .*" - -- with_timeout_factor 2 { -- set attached 0 -- set saw_attaching 0 -- set eperm 0 -- set test "attach" -- gdb_test_multiple "attach $testpid" $test { -- -re "Attaching to program.*process $testpid\r\n" { -- set saw_attaching 1 -- exp_continue -- } -- -re "new threads in iteration" { -- # Seen when "set debug libthread_db" is on. -- exp_continue -- } -- -re "Reading symbols from|Expanding full symbols from" { -- # Prevent -readnow timeout. -- exp_continue -- } -- -re "is a zombie - the process has already terminated.*$::gdb_prompt " { -- fail $gdb_test_name -- } -- -re "Unable to attach: .*$::gdb_prompt " { -- fail $gdb_test_name -- } -- -re "\r\n$::gdb_prompt " { -- if { $saw_attaching } { -- set attached 1 -- pass $test -- } else { -- fail $test -- } -- } -- } -- } -- -- if {!$attached} { -+ if {![prepare_test_iter $testpid $non_stop \ -+ $attempt $attempts "$::decimal\.$::decimal"]} { - kill_wait_spawned_process $test_spawn_id - return - } - -- if {$non_stop} { -- # In non-stop, we will see one stop per thread after -- # the prompt. -- set stops 0 -- set tid_re "$::decimal\.$::decimal" -- set test "seen all stops" -- for {set thread 1} { $thread <= $n_threads } { incr thread } { -- if {[gdb_test_multiple "" $test { -- -re "Thread ${tid_re} ${any} stopped" { -- incr stops -- } -- }] != 0} { -- break -- } -- } -- -- # If we haven't seen all stops, then the -- # gdb_test_multiple in the loop above will have -- # already issued a FAIL. -- if {$stops != $n_threads} { -- kill_wait_spawned_process $test_spawn_id -- return -- } -- pass $test -- } -- -- # Set threads stepping over a breakpoint continuously. -- gdb_test "break $::srcfile:$::bp_lineno if 0" "Breakpoint.*" \ -- "break LOC if 0" -- -- if {$attempt < $attempts} { -- # Kick the time out timer for another round. -- gdb_test "print again = 1" " = 1" "reset timer in the inferior" -- # Show the time we had left in the logs, in case -- # something goes wrong. -- gdb_test "print seconds_left" " = .*" -- } -- -- if {$non_stop} { -- set cont_cmd "continue -a &" -- } else { -- set cont_cmd "continue &" -- } -- -- set cont_cmd_re [string_to_regexp $cont_cmd] -- gdb_test_multiple $cont_cmd "" { -- -re "^$cont_cmd_re\r\nContinuing\.\r\n$::gdb_prompt " { -- pass $gdb_test_name -- } -- } -- -- # Wait a bit, to give time for the threads to hit the -- # breakpoint. -- sleep 1 -- - set running_count 0 - set interrupted 0 - gdb_test_multiple "info threads" "all threads running" { -@@ -219,7 +255,8 @@ proc test {condition_eval target_non_stop non_stop displaced} { - } - } - -re "$::gdb_prompt $" { -- gdb_assert {$running_count == ($n_threads + 1) * 2} $gdb_test_name -+ gdb_assert {$running_count == ($::n_threads + 1) * 2} \ -+ $gdb_test_name - } - } - -@@ -292,7 +329,8 @@ foreach_with_prefix breakpoint-condition-evaluation {"host" "target"} { - } - - foreach_with_prefix displaced {"off" "auto"} { -- test ${breakpoint-condition-evaluation} ${target-non-stop} ${non-stop} ${displaced} -+ test_detach_command ${breakpoint-condition-evaluation} \ -+ ${target-non-stop} ${non-stop} ${displaced} - } - } - } diff --git a/gdb-testsuite-relax-breakpoint-count-check-in-gdb.py.patch b/gdb-testsuite-relax-breakpoint-count-check-in-gdb.py.patch new file mode 100644 index 0000000..c033b5e --- /dev/null +++ b/gdb-testsuite-relax-breakpoint-count-check-in-gdb.py.patch @@ -0,0 +1,73 @@ +From 943623fbdfbc3c047af66866fad4fc5ee4fc1e3b Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Mon, 12 Jun 2023 13:00:09 +0200 +Subject: [PATCH] [gdb/testsuite] Relax breakpoint count check in + gdb.python/py-rbreak.exp + +With a gdb 13.2 based package on SLE-15 aarch64, I run into: +... +(gdb) PASS: gdb.python/py-rbreak.exp: nosharedlibrary +py sl = gdb.rbreak("^[^_]",minsyms=False)^M +Breakpoint 2 at 0x4004ac: file ../sysdeps/aarch64/crti.S, line 63.^M + ... +(gdb) py print(len(sl))^M +12^M +(gdb) FAIL: gdb.python/py-rbreak.exp: check number of returned breakpoints is 11 +... + +The FAIL is due to: +- the glibc object crti.o containing debug information for function + call_weak_fn, and +- the test-case not expecting this. + +The debug information is there due to compiling glibc using a binutils which +contains commit 591cc9fbbfd ("gas/Dwarf: record functions"). + +I've run into a similar issue before, see commit 3fbbcf473a5 ("[gdb/testsuite] +Fix regexp in py-rbreak.exp"). + +The fix I applied there was to use a regexp "^[^_]" to filter out +__libc_csu_fini and __libc_csu_init, but that doesn't work for call_weak_fn. + +Fix this by: +- reverting the regexp to "", and +- rewriting the check to require at least 11 functions, rather than a precise + match. + +Tested on x86_64-linux. + +PR testsuite/30538 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30538 +--- + gdb/testsuite/gdb.python/py-rbreak.exp | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/gdb/testsuite/gdb.python/py-rbreak.exp b/gdb/testsuite/gdb.python/py-rbreak.exp +index 2d39141285f..a4aa953d094 100644 +--- a/gdb/testsuite/gdb.python/py-rbreak.exp ++++ b/gdb/testsuite/gdb.python/py-rbreak.exp +@@ -32,10 +32,16 @@ if {![runto_main]} { + } + + gdb_test_no_output "nosharedlibrary" +-gdb_py_test_silent_cmd "py sl = gdb.rbreak(\"^\[^_\]\",minsyms=False)" \ ++gdb_py_test_silent_cmd "py sl = gdb.rbreak(\"\",minsyms=False)" \ + "get all function breakpoints" 0 +-gdb_test "py print(len(sl))" "11" \ +- "check number of returned breakpoints is 11" ++set min_breakpoints 11 ++gdb_test_multiple "py print(len(sl))" \ ++ "check number of returned breakpoints is at least $min_breakpoints" { ++ -re -wrap "($decimal)" { ++ set n $expect_out(1,string) ++ gdb_assert { $n >= $min_breakpoints } $gdb_test_name ++ } ++ } + gdb_py_test_silent_cmd "py sl = gdb.rbreak(\"main\.\*\",minsyms=False)" \ + "get main function breakpoint" 0 + gdb_test "py print(len(sl))" "1" \ + +base-commit: 85025e0631ed4b0e8c3aa85d7561a715f142bdc6 +-- +2.35.3 + diff --git a/gdb-testsuite-remove-attach-test-from-can_spawn_for_attach.patch b/gdb-testsuite-remove-attach-test-from-can_spawn_for_attach.patch deleted file mode 100644 index aa6eded..0000000 --- a/gdb-testsuite-remove-attach-test-from-can_spawn_for_attach.patch +++ /dev/null @@ -1,99 +0,0 @@ -gdb: testsuite: remove attach test from can_spawn_for_attach - -As Pedro Alves said, caching procs should not issue pass/fail [1], -this commit removes attach test from can_spawn_for_attach, at the -same time, use "verbose -log" instead of "unsupported" to get a -trace about why a test run doesn't support spawning for attach. - -[1] https://sourceware.org/pipermail/gdb-patches/2022-March/186311.html - -Signed-off-by: Tiezhu Yang - ---- - gdb/testsuite/lib/gdb.exp | 52 ++++++++--------------------------------------- - 1 file changed, 9 insertions(+), 43 deletions(-) - -diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp -index f8cd2292170..01744cae7e2 100644 ---- a/gdb/testsuite/lib/gdb.exp -+++ b/gdb/testsuite/lib/gdb.exp -@@ -5096,12 +5096,12 @@ proc gdb_exit { } { - # Return true if we can spawn a program on the target and attach to - # it. - --gdb_caching_proc can_spawn_for_attach { -+proc can_spawn_for_attach { } { - # We use exp_pid to get the inferior's pid, assuming that gives - # back the pid of the program. On remote boards, that would give - # us instead the PID of e.g., the ssh client, etc. - if [is_remote target] then { -- unsupported "skip attach tests (target is remote)" -+ verbose -log "can't spawn for attach (target is remote)" - return 0 - } - -@@ -5109,50 +5109,10 @@ gdb_caching_proc can_spawn_for_attach { - # stub-like, where GDB finds the program already started on - # initial connection. - if {[target_info exists use_gdb_stub]} { -- unsupported "skip attach tests (target is stub)" -+ verbose -log "can't spawn for attach (target is stub)" - return 0 - } - -- set me "can_spawn_for_attach" -- set src { int main (void) { sleep (600); return 0; } } -- if {![gdb_simple_compile $me $src executable]} { -- return 0 -- } -- -- set test_spawn_id [spawn_wait_for_attach $obj] -- set test_pid [spawn_id_get_pid $test_spawn_id] -- -- gdb_start -- file delete $obj -- gdb_test_multiple "attach $test_pid" "can spawn for attach" { -- -re -wrap "Attaching to process $test_pid\r\n.*No executable file now.*" { -- pass $gdb_test_name -- kill_wait_spawned_process $test_spawn_id -- return 1 -- } -- -re -wrap "Attaching to process $test_pid\r\n.*ptrace: Operation not permitted\\." { -- unsupported "$gdb_test_name (Operation not permitted)" -- kill_wait_spawned_process $test_spawn_id -- return 0 -- } -- -re -wrap "Attaching to process $test_pid\r\n.*Attaching to process $test_pid failed" { -- unsupported "$gdb_test_name (Attaching to process failed)" -- kill_wait_spawned_process $test_spawn_id -- return 0 -- } -- -re -wrap "Attaching to process $test_pid\r\n.*XML support was disabled at compile time.*" { -- pass $gdb_test_name -- kill_wait_spawned_process $test_spawn_id -- return 1 -- } -- -re "A program is being debugged already. Kill it. .y or n. " { -- send_gdb "y\n" -- exp_continue -- } -- } -- -- kill_wait_spawned_process $test_spawn_id -- - # Assume yes. - return 1 - } -@@ -5202,6 +5162,12 @@ proc spawn_id_get_pid { spawn_id } { - proc spawn_wait_for_attach { executable_list } { - set spawn_id_list {} - -+ if ![can_spawn_for_attach] { -+ # The caller should have checked can_spawn_for_attach itself -+ # before getting here. -+ error "can't spawn for attach with this target/board" -+ } -+ - foreach {executable} $executable_list { - # Note we use Expect's spawn, not Tcl's exec, because with - # spawn we control when to wait for/reap the process. That diff --git a/gdb-testsuite-remove-global-declarations-in-gdb.threads-detach-step-over.exp.patch b/gdb-testsuite-remove-global-declarations-in-gdb.threads-detach-step-over.exp.patch deleted file mode 100644 index a53f78a..0000000 --- a/gdb-testsuite-remove-global-declarations-in-gdb.threads-detach-step-over.exp.patch +++ /dev/null @@ -1,127 +0,0 @@ -gdb/testsuite: remove global declarations in gdb.threads/detach-step-over.exp - -Before doing further changes to this file, change to use the :: notation -instead of declaring global variables with the `global` keyword. - -Change-Id: I72301fd8f4693fea61aac054ba17245a1f4442fb -Approved-By: Andrew Burgess - ---- - gdb/testsuite/gdb.threads/detach-step-over.exp | 40 +++++++++++--------------- - 1 file changed, 17 insertions(+), 23 deletions(-) - -diff --git a/gdb/testsuite/gdb.threads/detach-step-over.exp b/gdb/testsuite/gdb.threads/detach-step-over.exp -index 15af7e0e723..917be2ef378 100644 ---- a/gdb/testsuite/gdb.threads/detach-step-over.exp -+++ b/gdb/testsuite/gdb.threads/detach-step-over.exp -@@ -58,24 +58,18 @@ set bp_lineno [gdb_get_line_number "Set breakpoint here"] - - # The test proper. See description above. - proc test {condition_eval target_non_stop non_stop displaced} { -- global binfile srcfile -- global gdb_prompt -- global decimal -- global bp_lineno -- global GDBFLAGS -- - # Number of threads started by the program. - set n_threads 10 - -- save_vars { GDBFLAGS } { -- append GDBFLAGS " -ex \"maint set target-non-stop $target_non_stop\"" -- append GDBFLAGS " -ex \"set non-stop $non_stop\"" -- append GDBFLAGS " -ex \"set displaced $displaced\"" -- append GDBFLAGS " -ex \"set schedule-multiple on\"" -- clean_restart $binfile -+ save_vars { ::GDBFLAGS } { -+ append ::GDBFLAGS " -ex \"maint set target-non-stop $target_non_stop\"" -+ append ::GDBFLAGS " -ex \"set non-stop $non_stop\"" -+ append ::GDBFLAGS " -ex \"set displaced $displaced\"" -+ append ::GDBFLAGS " -ex \"set schedule-multiple on\"" -+ clean_restart $::binfile - } - -- set test_spawn_id [spawn_wait_for_attach $binfile] -+ set test_spawn_id [spawn_wait_for_attach $::binfile] - set testpid [spawn_id_get_pid $test_spawn_id] - - set any "\[^\r\n\]*" -@@ -83,7 +77,7 @@ proc test {condition_eval target_non_stop non_stop displaced} { - gdb_test "add-inferior" "Added inferior 2.*" - gdb_test "inferior 2" "Switching to .*" - -- gdb_load $binfile -+ gdb_load $::binfile - if ![runto setup_done] then { - fail "can't run to setup_done" - kill_wait_spawned_process $test_spawn_id -@@ -95,7 +89,7 @@ proc test {condition_eval target_non_stop non_stop displaced} { - # Get the PID of the test process. - set pid_inf2 "" - gdb_test_multiple "p mypid" "get pid of inferior 2" { -- -re " = ($decimal)\r\n$gdb_prompt $" { -+ -re " = ($::decimal)\r\n$::gdb_prompt $" { - set pid_inf2 $expect_out(1,string) - pass $gdb_test_name - } -@@ -124,13 +118,13 @@ proc test {condition_eval target_non_stop non_stop displaced} { - # Prevent -readnow timeout. - exp_continue - } -- -re "is a zombie - the process has already terminated.*$gdb_prompt " { -+ -re "is a zombie - the process has already terminated.*$::gdb_prompt " { - fail $gdb_test_name - } -- -re "Unable to attach: .*$gdb_prompt " { -+ -re "Unable to attach: .*$::gdb_prompt " { - fail $gdb_test_name - } -- -re "\r\n$gdb_prompt " { -+ -re "\r\n$::gdb_prompt " { - if { $saw_attaching } { - set attached 1 - pass $test -@@ -173,7 +167,7 @@ proc test {condition_eval target_non_stop non_stop displaced} { - } - - # Set threads stepping over a breakpoint continuously. -- gdb_test "break $srcfile:$bp_lineno if 0" "Breakpoint.*" \ -+ gdb_test "break $::srcfile:$::bp_lineno if 0" "Breakpoint.*" \ - "break LOC if 0" - - if {$attempt < $attempts} { -@@ -192,7 +186,7 @@ proc test {condition_eval target_non_stop non_stop displaced} { - - set cont_cmd_re [string_to_regexp $cont_cmd] - gdb_test_multiple $cont_cmd "" { -- -re "^$cont_cmd_re\r\nContinuing\.\r\n$gdb_prompt " { -+ -re "^$cont_cmd_re\r\nContinuing\.\r\n$::gdb_prompt " { - pass $gdb_test_name - } - } -@@ -208,14 +202,14 @@ proc test {condition_eval target_non_stop non_stop displaced} { - incr running_count - exp_continue - } -- -re "Cannot execute this command while the target is running.*$gdb_prompt $" { -+ -re "Cannot execute this command while the target is running.*$::gdb_prompt $" { - # Testing against a remote server that doesn't do - # non-stop mode. Explicitly interrupt. This - # doesn't test the same code paths in GDB, but - # it's still something. - set interrupted 1 - gdb_test_multiple "interrupt" "" { -- -re "$gdb_prompt " { -+ -re "$::gdb_prompt " { - gdb_test_multiple "" $gdb_test_name { - -re "received signal SIGINT, Interrupt" { - pass $gdb_test_name -@@ -224,7 +218,7 @@ proc test {condition_eval target_non_stop non_stop displaced} { - } - } - } -- -re "$gdb_prompt $" { -+ -re "$::gdb_prompt $" { - gdb_assert {$running_count == ($n_threads + 1) * 2} $gdb_test_name - } - } diff --git a/gdb-testsuite-remove-target-limits-in-gdb.base-catch-syscall.exp.patch b/gdb-testsuite-remove-target-limits-in-gdb.base-catch-syscall.exp.patch deleted file mode 100644 index 832dae7..0000000 --- a/gdb-testsuite-remove-target-limits-in-gdb.base-catch-syscall.exp.patch +++ /dev/null @@ -1,158 +0,0 @@ -[gdb/testsuite] Remove target limits in gdb.base/catch-syscall.exp - -In test-case gdb.base/catch-syscall.exp, proc test_catch_syscall_multi_arch we -test for supported targets using istarget, like so: -... - if { [istarget "i*86-*-*"] || [istarget "x86_64-*-*"] } { - ... - } elseif { [istarget "powerpc-*-linux*"] \ - || [istarget "powerpc64*-linux*"] } { - ... -... -but the tests excercised there can all be executed if gdb is configured with ---enable-targets=all. - -Rewrite the proc to iterate over all cases, and check if the test is supported -by trying "set arch $arch1" and "set arch $arch2". - -Tested on x86_64-linux, with: -- a gdb build with --enable-targets=all, and -- a gdb build build with my usual --enable-targets setting (too long to - include here) which means the sparc vs sparc:v9 case is unsupported. - ---- - gdb/testsuite/gdb.base/catch-syscall.exp | 106 ++++++++++++++++++------------- - 1 file changed, 61 insertions(+), 45 deletions(-) - -diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp -index a5dfd02411b..939cf4876b6 100644 ---- a/gdb/testsuite/gdb.base/catch-syscall.exp -+++ b/gdb/testsuite/gdb.base/catch-syscall.exp -@@ -565,59 +565,33 @@ proc test_catch_syscall_with_wrong_args_noxml {} { - } - } - --proc test_catch_syscall_multi_arch {} { -+proc test_catch_syscall_multi_arch_1 { -+ arch1 arch2 syscall1_name syscall2_name syscall_number -+} { - global decimal binfile - -- if { [istarget "i*86-*-*"] || [istarget "x86_64-*-*"] } { -- set arch1 "i386" -- set arch2 "i386:x86-64" -- set syscall1_name "exit" -- set syscall2_name "write" -- set syscall_number 1 -- } elseif { [istarget "powerpc-*-linux*"] \ -- || [istarget "powerpc64*-linux*"] } { -- set arch1 "powerpc:common" -- set arch2 "powerpc:common64" -- set syscall1_name "openat" -- set syscall2_name "unlinkat" -- set syscall_number 286 -- } elseif { [istarget "sparc-*-linux*"] \ -- || [istarget "sparc64-*-linux*"] } { -- set arch1 "sparc" -- set arch2 "sparc:v9" -- set syscall1_name "setresuid32" -- set syscall2_name "setresuid" -- set syscall_number 108 -- } elseif { [istarget "mips*-linux*"] } { -- # MIPS does not use the same numbers for syscalls on 32 and 64 -- # bits. -- verbose "Not testing MIPS for multi-arch syscall support" -- return -- } elseif { [istarget "arm*-linux*"] } { -- # catch syscall supports only 32-bit ARM for now. -- verbose "Not testing ARM for multi-arch syscall support" -- return -- } elseif { [istarget "aarch64*-linux*"] } { -- set arch1 "aarch64" -- set arch2 "arm" -- set syscall1_name "reboot" -- set syscall2_name "_newselect" -- set syscall_number 142 -- } elseif { [istarget "s390*-linux*"] } { -- set arch1 "s390:31-bit" -- set arch2 "s390:64-bit" -- set syscall1_name "_newselect" -- set syscall2_name "select" -- set syscall_number 142 -- } -- -- with_test_prefix "multiple targets" { -+ with_test_prefix "multiple targets: $arch1 vs $arch2" { - # We are not interested in loading any binary here, and in - # some systems (PowerPC, for example), if we load a binary - # there is no way to set other architecture. - gdb_exit - gdb_start - -+ set supported 1 -+ foreach arch [list $arch1 $arch2] { -+ gdb_test_multiple "set architecture $arch" "" { -+ -re -wrap "Undefined item: \"$arch\"\\." { -+ set supported 0 -+ unsupported $gdb_test_name -+ } -+ -re -wrap "The target architecture is set to \"$arch\"\\." { -+ } -+ } -+ } -+ if { $supported == 0 } { -+ return -+ } -+ - gdb_test "set architecture $arch1" \ - "The target architecture is set to \"$arch1\"\\." - -@@ -636,6 +610,48 @@ proc test_catch_syscall_multi_arch {} { - } - } - -+proc test_catch_syscall_multi_arch {} { -+ set arch1 "i386" -+ set arch2 "i386:x86-64" -+ set syscall1_name "exit" -+ set syscall2_name "write" -+ set syscall_number 1 -+ test_catch_syscall_multi_arch_1 $arch1 $arch2 $syscall1_name \ -+ $syscall2_name $syscall_number -+ -+ set arch1 "powerpc:common" -+ set arch2 "powerpc:common64" -+ set syscall1_name "openat" -+ set syscall2_name "unlinkat" -+ set syscall_number 286 -+ test_catch_syscall_multi_arch_1 $arch1 $arch2 $syscall1_name \ -+ $syscall2_name $syscall_number -+ -+ set arch1 "sparc" -+ set arch2 "sparc:v9" -+ set syscall1_name "setresuid32" -+ set syscall2_name "setresuid" -+ set syscall_number 108 -+ test_catch_syscall_multi_arch_1 $arch1 $arch2 $syscall1_name \ -+ $syscall2_name $syscall_number -+ -+ set arch1 "aarch64" -+ set arch2 "arm" -+ set syscall1_name "reboot" -+ set syscall2_name "_newselect" -+ set syscall_number 142 -+ test_catch_syscall_multi_arch_1 $arch1 $arch2 $syscall1_name \ -+ $syscall2_name $syscall_number -+ -+ set arch1 "s390:31-bit" -+ set arch2 "s390:64-bit" -+ set syscall1_name "_newselect" -+ set syscall2_name "select" -+ set syscall_number 142 -+ test_catch_syscall_multi_arch_1 $arch1 $arch2 $syscall1_name \ -+ $syscall2_name $syscall_number -+} -+ - proc do_syscall_tests_without_xml {} { - # Make sure GDB doesn't load the syscalls xml from the system data - # directory. diff --git a/gdb-testsuite-require-syscall-time-in-gdb.reverse-ti.patch b/gdb-testsuite-require-syscall-time-in-gdb.reverse-ti.patch new file mode 100644 index 0000000..0ced546 --- /dev/null +++ b/gdb-testsuite-require-syscall-time-in-gdb.reverse-ti.patch @@ -0,0 +1,70 @@ +From e4db94ab97c500e9090feb6da8a1e7974c5c0d9a Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 21 Feb 2023 14:10:12 +0100 +Subject: [PATCH 2/6] [gdb/testsuite] Require syscall time in + gdb.reverse/time-reverse.exp + +On aarch64-linux, I run into: +... +Running gdb.reverse/time-reverse.exp ... +gdb compile failed, gdb.reverse/time-reverse.c: In function 'main': +gdb.reverse/time-reverse.c:39:12: error: 'SYS_time' undeclared \ + (first use in this function); did you mean 'SYS_times'? + syscall (SYS_time, &time_global); + ^~~~~~~~ + SYS_times +gdb.reverse/time-reverse.c:39:12: note: each undeclared identifier is \ + reported only once for each function it appears in +UNTESTED: gdb.reverse/time-reverse.exp: failed to prepare +... + +Fix this by adding a new proc have_syscall, and requiring syscall time, such +that we have instead: +... +UNSUPPORTED: gdb.reverse/time-reverse.exp: require failed: \ + expr [have_syscall time] +... + +Tested on x86_64-linux and aarch64-linux. +--- + gdb/testsuite/gdb.reverse/time-reverse.exp | 2 ++ + gdb/testsuite/lib/gdb.exp | 11 +++++++++++ + 2 files changed, 13 insertions(+) + +diff --git a/gdb/testsuite/gdb.reverse/time-reverse.exp b/gdb/testsuite/gdb.reverse/time-reverse.exp +index 73648af992b..d382d1c2337 100644 +--- a/gdb/testsuite/gdb.reverse/time-reverse.exp ++++ b/gdb/testsuite/gdb.reverse/time-reverse.exp +@@ -25,6 +25,8 @@ if ![supports_reverse] { + + standard_testfile + ++if { ![have_syscall time] } { return } ++ + if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } { + return -1 + } +diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp +index 85ef279bfe9..095d8930edb 100644 +--- a/gdb/testsuite/lib/gdb.exp ++++ b/gdb/testsuite/lib/gdb.exp +@@ -9410,5 +9410,16 @@ gdb_caching_proc linux_kernel_version { + return [list $v1 $v2 $v3] + } + ++# Return 1 if syscall NAME is supported. ++ ++proc have_syscall { name } { ++ set src \ ++ [list \ ++ "#include " \ ++ "int var = SYS_$name;"] ++ set src [join $src "\n"] ++ return [gdb_can_simple_compile have_syscall_$name $src object] ++} ++ + # Always load compatibility stuff. + load_lib future.exp +-- +2.35.3 + diff --git a/gdb-testsuite-simplify-gdb.base-unwind-on-each-insn..patch b/gdb-testsuite-simplify-gdb.base-unwind-on-each-insn..patch new file mode 100644 index 0000000..5714ac9 --- /dev/null +++ b/gdb-testsuite-simplify-gdb.base-unwind-on-each-insn..patch @@ -0,0 +1,118 @@ +From 525bc63f2afc749f967f98730623de3a6895a5e9 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Mon, 23 Jan 2023 10:32:45 +0100 +Subject: [PATCH 2/4] [gdb/testsuite] Simplify gdb.base/unwind-on-each-insn.exp + +In test-case gdb.base/unwind-on-each-insn.exp, we try to determine the last +disassembled insn in function foo. + +This in it self is fragile, as demonstrated by commit 91836f41e20 ("Powerpc +fix for gdb.base/unwind-on-each-insn.exp"). + +The use of the last disassembled insn in the test-case is to stop stepping in +foo once reaching it. + +However, the intent is to stop stepping just before returning to main. + +There is no guarantee that the last disassembled insn: +- is actually executed +- is executed just before returning to main +- is executed only once. + +Fix this by simplying the test-case to continue stepping till stepping out of +foo. + +Tested on x86_64-linux. +--- + .../gdb.base/unwind-on-each-insn.exp | 62 ++++--------------- + 1 file changed, 11 insertions(+), 51 deletions(-) + +diff --git a/gdb/testsuite/gdb.base/unwind-on-each-insn.exp b/gdb/testsuite/gdb.base/unwind-on-each-insn.exp +index c8748d5ae14..5e822effaf1 100644 +--- a/gdb/testsuite/gdb.base/unwind-on-each-insn.exp ++++ b/gdb/testsuite/gdb.base/unwind-on-each-insn.exp +@@ -73,51 +73,6 @@ set main_fid [get_fid] + gdb_breakpoint "*foo" + gdb_continue_to_breakpoint "enter foo" + +-# Figure out the range of addresses covered by this function. +-set last_addr_in_foo "" +- +-# The disassembly of foo on PowerPC looks like: +-# Dump of assembler code for function foo: +-# => 0x00000000100006dc <+0>: std r31,-8(r1) +-# 0x00000000100006e0 <+4>: stdu r1,-48(r1) +-# 0x00000000100006e4 <+8>: mr r31,r1 +-# 0x00000000100006e8 <+12>: nop +-# 0x00000000100006ec <+16>: addi r1,r31,48 +-# 0x00000000100006f0 <+20>: ld r31,-8(r1) +-# 0x00000000100006f4 <+24>: blr +-# 0x00000000100006f8 <+28>: .long 0x0 +-# 0x00000000100006fc <+32>: .long 0x0 +-# 0x0000000010000700 <+36>: .long 0x1000180 +-# End of assembler dump. +-# +-# The last instruction in function foo is blr. Need to ignore the .long +-# entries following the blr instruction. +- +-gdb_test_multiple "disassemble foo" "" { +- -re "^disassemble foo\r\n" { +- exp_continue +- } +- +- -re "^Dump of assembler code for function foo:\r\n" { +- exp_continue +- } +- +- -re "^...($hex) \[<>+0-9:\s\t\]*\.long\[\s\t\]*\[^\r\n\]*\r\n" { +- exp_continue +- } +- +- -re "^...($hex) \[^\r\n\]+\r\n" { +- set last_addr_in_foo $expect_out(1,string) +- exp_continue +- } +- +- -wrap -re "^End of assembler dump\\." { +- gdb_assert { ![string equal $last_addr_in_foo ""] } \ +- "found some addresses in foo" +- pass $gdb_test_name +- } +-} +- + # Record the current stack-pointer, and the frame base address. + lassign [get_sp_and_fba "in foo"] foo_sp foo_fba + set foo_fid [get_fid] +@@ -158,11 +113,6 @@ for { set i_count 1 } { true } { incr i_count } { + # Move back to the inner most frame. + gdb_test "frame 0" ".*" + +- set pc [get_hexadecimal_valueof "\$pc" "*UNKNOWN*"] +- if { $pc == $last_addr_in_foo } { +- break +- } +- + if { $i_count > 100 } { + # We expect a handful of instructions, if we reach 100, + # something is going wrong. Avoid an infinite loop. +@@ -170,6 +120,16 @@ for { set i_count 1 } { true } { incr i_count } { + break + } + +- gdb_test "stepi" ".*" ++ set in_foo 0 ++ gdb_test_multiple "stepi" "" { ++ -re -wrap "$hex in foo \\(\\)" { ++ set in_foo 1 ++ } ++ -re -wrap "" {} ++ } ++ ++ if { ! $in_foo } { ++ break ++ } + } + } +-- +2.35.3 + diff --git a/gdb-testsuite-skip-gdb.fortran-namelist.exp-for-gfortran-4.8.patch b/gdb-testsuite-skip-gdb.fortran-namelist.exp-for-gfortran-4.8.patch deleted file mode 100644 index d298b6f..0000000 --- a/gdb-testsuite-skip-gdb.fortran-namelist.exp-for-gfortran-4.8.patch +++ /dev/null @@ -1,32 +0,0 @@ -[gdb/testsuite] Skip gdb.fortran/namelist.exp for gfortran 4.8 - -The test-case gdb.fortran/namelist.exp uses a gfortran feature (emitting -DW_TAG_namelist in the debug info) that has been supported since gfortran 4.9, -see PR gcc/37132. - -Skip the test for gfortran 4.8 and earlier. Do this using gcc_major_version, -and update it to be able to handle "gcc_major_version {gfortran-*} f90". - -Tested on x86_64-linux, with gfortran 4.8.5, 7.5.0, and 12.1.1. - ---- - gdb/testsuite/gdb.fortran/namelist.exp | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/gdb/testsuite/gdb.fortran/namelist.exp b/gdb/testsuite/gdb.fortran/namelist.exp -index d6263e12fec..464f2f84fc2 100644 ---- a/gdb/testsuite/gdb.fortran/namelist.exp -+++ b/gdb/testsuite/gdb.fortran/namelist.exp -@@ -37,7 +37,11 @@ set int [fortran_int4] - gdb_breakpoint [gdb_get_line_number "Display namelist"] - gdb_continue_to_breakpoint "Display namelist" - --if {[test_compiler_info {gcc-*}]} { -+# DW_TAG_namelist is supported starting gcc 4.9. -+set supported [expr \ -+ [test_compiler_info {gcc-*}] \ -+ && [gcc_major_version] >= 4.9] -+if { $supported } { - gdb_test "ptype nml" \ - "type = Type nml\r\n *$int :: a\r\n *$int :: b\r\n *End Type nml" - gdb_test "print nml" \ diff --git a/gdb-testsuite-support-recording-of-getrandom.patch b/gdb-testsuite-support-recording-of-getrandom.patch deleted file mode 100644 index d3d3ad6..0000000 --- a/gdb-testsuite-support-recording-of-getrandom.patch +++ /dev/null @@ -1,243 +0,0 @@ -[gdb/testsuite] Support recording of getrandom - -Add missing support for recording of linux syscall getrandom. - -Tested on x86_64-linux with native and target board unix/-m32. - ---- - gdb/aarch64-linux-tdep.c | 2 ++ - gdb/amd64-linux-tdep.c | 3 ++ - gdb/amd64-linux-tdep.h | 3 +- - gdb/arm-linux-tdep.c | 1 + - gdb/linux-record.c | 6 ++++ - gdb/linux-record.h | 1 + - gdb/ppc-linux-tdep.c | 2 ++ - gdb/s390-linux-tdep.c | 2 ++ - gdb/testsuite/gdb.reverse/getrandom.c | 41 ++++++++++++++++++++++++ - gdb/testsuite/gdb.reverse/getrandom.exp | 56 +++++++++++++++++++++++++++++++++ - 10 files changed, 116 insertions(+), 1 deletion(-) - -diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c -index cb132d5a540..437fd083fa7 100644 ---- a/gdb/aarch64-linux-tdep.c -+++ b/gdb/aarch64-linux-tdep.c -@@ -1137,6 +1137,7 @@ enum aarch64_syscall { - aarch64_sys_finit_module = 273, - aarch64_sys_sched_setattr = 274, - aarch64_sys_sched_getattr = 275, -+ aarch64_sys_getrandom = 278 - }; - - /* aarch64_canonicalize_syscall maps syscall ids from the native AArch64 -@@ -1419,6 +1420,7 @@ aarch64_canonicalize_syscall (enum aarch64_syscall syscall_number) - UNSUPPORTED_SYSCALL_MAP (finit_module); - UNSUPPORTED_SYSCALL_MAP (sched_setattr); - UNSUPPORTED_SYSCALL_MAP (sched_getattr); -+ SYSCALL_MAP (getrandom); - default: - return gdb_sys_no_syscall; - } -diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c -index 9788711d296..02f87ddac32 100644 ---- a/gdb/amd64-linux-tdep.c -+++ b/gdb/amd64-linux-tdep.c -@@ -463,6 +463,9 @@ amd64_canonicalize_syscall (enum amd64_syscall syscall_number) - case amd64_sys_pipe2: - return gdb_sys_pipe2; - -+ case amd64_sys_getrandom: -+ return gdb_sys_getrandom; -+ - case amd64_sys_select: - case amd64_x32_sys_select: - return gdb_sys_select; -diff --git a/gdb/amd64-linux-tdep.h b/gdb/amd64-linux-tdep.h -index 184b0c86f07..ef111f4ac2a 100644 ---- a/gdb/amd64-linux-tdep.h -+++ b/gdb/amd64-linux-tdep.h -@@ -320,7 +320,8 @@ enum amd64_syscall { - amd64_sys_sync_file_range = 277, - amd64_sys_vmsplice = 278, - amd64_sys_move_pages = 279, -- amd64_sys_pipe2 = 293 -+ amd64_sys_pipe2 = 293, -+ amd64_sys_getrandom = 318 - }; - - /* Enum that defines the syscall identifiers for x32 linux. -diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c -index 6aac016afb9..be9f203bd8e 100644 ---- a/gdb/arm-linux-tdep.c -+++ b/gdb/arm-linux-tdep.c -@@ -1610,6 +1610,7 @@ arm_canonicalize_syscall (int syscall) - case 378: return gdb_sys_kcmp; - case 379: return gdb_sys_finit_module; - */ -+ case 384: return gdb_sys_getrandom; - case 983041: /* ARM_breakpoint */ return gdb_sys_no_syscall; - case 983042: /* ARM_cacheflush */ return gdb_sys_no_syscall; - case 983043: /* ARM_usr26 */ return gdb_sys_no_syscall; -diff --git a/gdb/linux-record.c b/gdb/linux-record.c -index 0af1ef2a9e0..ffc6337d18a 100644 ---- a/gdb/linux-record.c -+++ b/gdb/linux-record.c -@@ -356,6 +356,12 @@ record_linux_system_call (enum gdb_syscall syscall, - return -1; - break; - -+ case gdb_sys_getrandom: -+ regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest); -+ if (record_mem_at_reg (regcache, tdep->arg1, tmpulongest)) -+ return -1; -+ break; -+ - case gdb_sys_times: - if (record_mem_at_reg (regcache, tdep->arg1, tdep->size_tms)) - return -1; -diff --git a/gdb/linux-record.h b/gdb/linux-record.h -index 219c67f888d..c70d75b0d6e 100644 ---- a/gdb/linux-record.h -+++ b/gdb/linux-record.h -@@ -510,6 +510,7 @@ enum gdb_syscall { - gdb_sys_dup3 = 330, - gdb_sys_pipe2 = 331, - gdb_sys_inotify_init1 = 332, -+ gdb_sys_getrandom = 355, - gdb_sys_statx = 383, - gdb_sys_socket = 500, - gdb_sys_connect = 501, -diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c -index 0b165fe2ca3..cb215f9cc51 100644 ---- a/gdb/ppc-linux-tdep.c -+++ b/gdb/ppc-linux-tdep.c -@@ -1406,6 +1406,8 @@ ppc_canonicalize_syscall (int syscall, int wordsize) - result = gdb_sys_recvfrom; - else if (syscall == 342) - result = gdb_sys_recvmsg; -+ else if (syscall == 359) -+ result = gdb_sys_getrandom; - - return (enum gdb_syscall) result; - } -diff --git a/gdb/s390-linux-tdep.c b/gdb/s390-linux-tdep.c -index 56cc147a391..d4ae9275e36 100644 ---- a/gdb/s390-linux-tdep.c -+++ b/gdb/s390-linux-tdep.c -@@ -787,6 +787,8 @@ s390_canonicalize_syscall (int syscall, enum s390_abi_kind abi) - /* ioprio_set .. epoll_pwait */ - else if (syscall >= 282 && syscall <= 312) - ret = syscall + 7; -+ else if (syscall == 349) -+ ret = gdb_sys_getrandom; - else - ret = gdb_sys_no_syscall; - -diff --git a/gdb/testsuite/gdb.reverse/getrandom.c b/gdb/testsuite/gdb.reverse/getrandom.c -new file mode 100644 -index 00000000000..162de6ed81b ---- /dev/null -+++ b/gdb/testsuite/gdb.reverse/getrandom.c -@@ -0,0 +1,41 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2022 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 . */ -+ -+#include -+ -+void -+marker1 (void) -+{ -+} -+ -+void -+marker2 (void) -+{ -+} -+ -+unsigned char buf[6]; -+ -+int -+main (void) -+{ -+ buf[0] = 0xff; -+ buf[5] = 0xff; -+ marker1 (); -+ volatile ssize_t r = getrandom (&buf[1], 4, 0); -+ marker2 (); -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.reverse/getrandom.exp b/gdb/testsuite/gdb.reverse/getrandom.exp -new file mode 100644 -index 00000000000..b1c7d9dad80 ---- /dev/null -+++ b/gdb/testsuite/gdb.reverse/getrandom.exp -@@ -0,0 +1,56 @@ -+# Copyright 2022 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 . -+ -+# This file is part of the gdb testsuite. -+ -+# -+# This test tests getrandom syscall for reverse execution. -+# -+ -+if ![supports_reverse] { -+ return -+} -+ -+standard_testfile -+ -+if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } { -+ return -1 -+} -+ -+runto_main -+ -+if [supports_process_record] { -+ # Activate process record/replay -+ gdb_test_no_output "record" "turn on process record" -+} -+ -+gdb_test "break marker2" \ -+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \ -+ "set breakpoint at marker2" -+ -+gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*" -+ -+gdb_test "break marker1" \ -+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \ -+ "set breakpoint at marker1" -+ -+gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1" -+ -+gdb_test "print (unsigned)buf\[0\]" ".* = 255" "check buf\[0\]" -+gdb_test "print (unsigned)buf\[1\]" ".* = 0" "check buf\[1\]" -+gdb_test "print (unsigned)buf\[2\]" ".* = 0" "check buf\[2\]" -+gdb_test "print (unsigned)buf\[3\]" ".* = 0" "check buf\[3\]" -+gdb_test "print (unsigned)buf\[4\]" ".* = 0" "check buf\[4\]" -+gdb_test "print (unsigned)buf\[5\]" ".* = 255" "check buf\[5\]" diff --git a/gdb-testsuite-workaround-unnecessary-.s-file-with-gfortran-4.8.patch b/gdb-testsuite-workaround-unnecessary-.s-file-with-gfortran-4.8.patch deleted file mode 100644 index 7d8d52d..0000000 --- a/gdb-testsuite-workaround-unnecessary-.s-file-with-gfortran-4.8.patch +++ /dev/null @@ -1,48 +0,0 @@ -[gdb/testsuite] Workaround unnecessary .s file with gfortran 4.8 - -After running test-case gdb.fortran/namelist.exp with gfortran 4.8.5, I'm left -with: -... -$ git sti -On branch master -Your branch is up to date with 'origin/master'. - -Untracked files: - (use "git add ..." to include in what will be committed) - gdb/testsuite/lib/compiler.s - -nothing added to commit but untracked files present (use "git add" to track) -... - -We're running into PR gcc/60447, which was fixed in gcc 4.9.0. - -Workaround this by first copying the source file to the temp dir, such that -the .s file is left there instead: -... -$ ls build/gdb/testsuite/temp// -compiler.c compiler.F90 compiler.s -... - -Tested on x86_64-linux. - ---- - gdb/testsuite/lib/gdb.exp | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp -index 6f6acfe188a..f8cd2292170 100644 ---- a/gdb/testsuite/lib/gdb.exp -+++ b/gdb/testsuite/lib/gdb.exp -@@ -4087,6 +4087,12 @@ proc get_compiler_info {{arg ""}} { - set cppout [read $file] - close $file - } else { -+ # Copy $ifile to temp dir, to work around PR gcc/60447. This will leave the -+ # superfluous .s file in the temp dir instead of in the source dir. -+ set tofile [file tail $ifile] -+ set tofile [standard_temp_file $tofile] -+ file copy -force $ifile $tofile -+ set ifile $tofile - set cppout [ gdb_compile "${ifile}" "" preprocess [list "$arg" quiet getting_compiler_info] ] - } - eval log_file $saved_log diff --git a/gdb-update-syscalls-amd64-i386-linux.xml.patch b/gdb-update-syscalls-amd64-i386-linux.xml.patch deleted file mode 100644 index 59eab0b..0000000 --- a/gdb-update-syscalls-amd64-i386-linux.xml.patch +++ /dev/null @@ -1,614 +0,0 @@ -[gdb] Update syscalls/{amd64,i386}-linux.xml - -- Add a script syscalls/gen-header.py, based on syscalls/arm-linux.py. -- Add a script syscalls/update-linux.sh (alongside update-freebsd.sh and - update-netbsd.sh). -- Use syscalls/update-linux.sh to update syscalls/{amd64,i386}-linux.xml.in. -- Regenerate syscalls/{amd64,i386}-linux.xml using syscalls/Makefile. - -In gdb/syscalls/i386-linux.xml.in, updating has the following notable effect: -... -- -- -- -+ -+ -... - -I've verified in ./arch/x86/entry/syscalls/syscall_32.tbl that the numbers are -correct. - -Tested on x86_64-linux. - ---- - gdb/syscalls/amd64-linux.xml | 69 +++++++++++++++++++++- - gdb/syscalls/amd64-linux.xml.in | 70 +++++++++++++++++++++- - gdb/syscalls/gen-header.py | 33 +++++++++++ - gdb/syscalls/i386-linux.xml | 126 +++++++++++++++++++++++++++++++++++++-- - gdb/syscalls/i386-linux.xml.in | 127 ++++++++++++++++++++++++++++++++++++++-- - gdb/syscalls/update-linux.sh | 60 +++++++++++++++++++ - 6 files changed, 471 insertions(+), 14 deletions(-) - -diff --git a/gdb/syscalls/amd64-linux.xml b/gdb/syscalls/amd64-linux.xml -index 688da89572d..fabc5e7893c 100644 ---- a/gdb/syscalls/amd64-linux.xml -+++ b/gdb/syscalls/amd64-linux.xml -@@ -6,8 +6,8 @@ - are permitted in any medium without royalty provided the copyright - notice and this notice are preserved. --> - - -@@ -308,4 +308,69 @@ - - - -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - -diff --git a/gdb/syscalls/amd64-linux.xml.in b/gdb/syscalls/amd64-linux.xml.in -index ef71221dcd4..31648b91009 100644 ---- a/gdb/syscalls/amd64-linux.xml.in -+++ b/gdb/syscalls/amd64-linux.xml.in -@@ -8,11 +8,12 @@ - - - - -+ - - - -@@ -311,4 +312,69 @@ - - - -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - -diff --git a/gdb/syscalls/gen-header.py b/gdb/syscalls/gen-header.py -new file mode 100644 -index 00000000000..d449688bd75 ---- /dev/null -+++ b/gdb/syscalls/gen-header.py -@@ -0,0 +1,33 @@ -+# Copyright (C) 2013-2022 Free Software Foundation, Inc. -+ -+# Copying and distribution of this file, with or without modification, -+# are permitted in any medium without royalty provided the copyright -+# notice and this notice are preserved. This file is offered as-is, -+# without any warranty. -+ -+import sys -+import re -+import time -+ -+infname = sys.argv[1] -+ -+print( -+ """\ -+ -+ -+ -+ -+ -+ -+ -+""" -+ % (time.strftime("%Y"), infname) -+) -diff --git a/gdb/syscalls/i386-linux.xml b/gdb/syscalls/i386-linux.xml -index 23328a874e1..e11a42e9296 100644 ---- a/gdb/syscalls/i386-linux.xml -+++ b/gdb/syscalls/i386-linux.xml -@@ -6,8 +6,8 @@ - are permitted in any medium without royalty provided the copyright - notice and this notice are preserved. --> - - -@@ -231,9 +231,8 @@ - - - -- -- -- -+ -+ - - - -@@ -334,5 +333,122 @@ - - - -+ -+ -+ -+ -+ - -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - -diff --git a/gdb/syscalls/i386-linux.xml.in b/gdb/syscalls/i386-linux.xml.in -index c1ae7aa35a9..430687efa87 100644 ---- a/gdb/syscalls/i386-linux.xml.in -+++ b/gdb/syscalls/i386-linux.xml.in -@@ -8,11 +8,12 @@ - - - - -+ - - - -@@ -234,9 +235,8 @@ - - - -- -- -- -+ -+ - - - -@@ -337,5 +337,122 @@ - - - -+ -+ -+ -+ -+ - -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - -diff --git a/gdb/syscalls/update-linux.sh b/gdb/syscalls/update-linux.sh -new file mode 100755 -index 00000000000..aadfdfccf81 ---- /dev/null -+++ b/gdb/syscalls/update-linux.sh -@@ -0,0 +1,60 @@ -+#!/bin/sh -+ -+# Copyright (C) 2022 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 . -+ -+# Used to generate .xml.in files, like so: -+# -+# ./update-linux.sh amd64-linux.xml.in -+# ./update-linux.sh i386-linux.xml.in -m32 -+ -+ -+if [ $# -lt 1 ]; then -+ echo "file argument needed" -+ exit 1 -+fi -+ -+f="$1" -+shift -+ -+if [ ! -f $f ]; then -+ echo "cannot find $f" -+ exit 1 -+fi -+ -+( -+ python gen-header.py "" -+ -+ tmp=$(mktemp) -+ -+ echo '#include ' \ -+ | gcc -E - -dD "$@" \ -+ | egrep '#define __NR_' \ -+ > $tmp -+ -+ echo '' -+ -+ while read line; do -+ name=$(echo $line | awk '{print $2}' | sed 's/^__NR_//') -+ nr=$(echo $line | awk '{print $3}') -+ echo " " -+ done < $tmp -+ -+ echo '' -+) > $f -+ -+rm -f $tmp diff --git a/gdb.changes b/gdb.changes index a48a579..3962ebd 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,10 +1,188 @@ ------------------------------------------------------------------- +Wed Jun 14 06:23:42 UTC 2023 - Tom de Vries + +- Patches added (master backports): + * pass-const-frame_info_ptr-reference-for-skip_-langua.patch +- Maintenance script qa.sh: + * Add PR30543 kfail. + * Remove PR29793 kfail. + +------------------------------------------------------------------- +Mon Jun 12 08:36:48 UTC 2023 - Tom de Vries + +- Patches added (master backports): + * fix-pr30369-regression-on-aarch64-arm-pr30506.patch + * gdb-tdep-aarch64-fix-frame-address-of-last-insn.patch + * gdb-testsuite-fix-breakpoint-regexp-in-gdb.ada-out_o.patch + * gdb-testsuite-relax-breakpoint-count-check-in-gdb.py.patch + * gdb-testsuite-fix-buffer-overflow-in-gdb.base-signed.patch + * gdb-testsuite-require-syscall-time-in-gdb.reverse-ti.patch + * gdb-testsuite-handle-missing-gdc-in-gdb.dlang-dlang-.patch + * gdb-testsuite-add-basic-lmap-for-tcl-8.6.patch + * gdb-testsuite-fix-gdb.rust-watch.exp-on-ppc64le.patch + * gdb-testsuite-fix-gdb.python-py-breakpoint.exp-timeo.patch + * powerpc-fix-for-gdb.reverse-finish-precsave.exp-and-.patch + * powerpc-regression-fix-for-reverse-finish-command.patch + * gdb-testsuite-don-t-use-string-cat-in-gdb.dwarf2-dw2.patch + * move-step_until-procedure.patch +- Patches added (gdb-patches backport): + * gdb-testsuite-add-have_host_locale.patch +- Patches added (fedora patch fixups): + * fixup-gdb-6.3-gstack-20050411.patch + * fixup-gdb-6.3-attach-see-vdso-test.patch + * fixup-gdb-lineno-makeup-test.patch + * fixup-gdb-rhbz1261564-aarch64-hw-watchpoint-test.pat.patch +- Patches dropped: + * gdb-ppc-power7-test.patch + * gdb-rhbz1156192-recursive-dlopen-test.patch + * gdb-6.3-bz140532-ppc-unwinding-test.patch +- Maintenance script qa.sh: + * Add PR30540, PR30537, PR30021 and PR30542 KFAILs. + * Add gdb.base/gcore-excessive-memory.exp internal error. + * Update gdb.base/inline-frame-cycle-unwind.exp KFAIL comment. + +------------------------------------------------------------------- +Fri Jun 9 06:26:02 UTC 2023 - Tom de Vries + +- Patches added (master backports): + * aarch64-avoid-initializers-for-vlas.patch + +------------------------------------------------------------------- +Tue Jun 6 06:00:11 UTC 2023 - Tom de Vries + +- Rebase to 13.2 release (fedora 38 @ fc4e284) + * Replace gdb-12.1.tar.bz2 with gdb-13.2.tar.bz2. +- Patches dropped: + * add-elfcompress_zstd.patch + * binutils-gdb-support-zstd-compressed-debug-section.patch + * fix-comparison-of-unsigned-long-int-to-int-in-record_linux_system_call.patch + * fix-core-file-detach-crash-corefiles-29275.patch + * fix-for-gdb.base-solib-search.exp-test.patch + * fix-gdb-build-elf-support-check-lzstd.patch + * fixup-gdb-rhbz1325795-framefilters-test.patch + * gdb-6.3-focus-cmd-prev-test.patch + * gdb-6.3-inheritancetest-20050726.patch + * gdb-6.3-test-dtorfix-20050121.patch + * gdb-6.3-test-movedir-20050125.patch + * gdb-6.3-threaded-watchpoints2-20050225.patch + * gdb-6.6-buildid-locate-rpm-scl.patch + * gdb-6.6-bz230000-power6-disassembly-test.patch + * gdb-add-gdb-syscalls-makefile.patch + * gdb-add-support-for-readline-8.2.patch + * gdb-bz601887-dwarf4-rh-test.patch + * gdb-disable-commit-resumed-in-target_kill.patch + * gdb-fix-assert-in-handle_jit_event.patch + * gdb-fix-assert-when-quitting-gdb-while-a-thread-is-stepping.patch + * gdb-fix-for-gdb.base-eof-exit.exp-test-failures.patch + * gdb-fix-selftest-fails-with-gdb-build-with-O2-flto.patch + * gdb-fortran-frame-string.patch + * gdb-handle-pending-c-after-rl_callback_read_char.patch + * gdb-improved-eof-handling-when-using-readline-7.patch + * gdb-physname-pr11734-test.patch + * gdb-physname-pr12273-test.patch + * gdb-record-handle-statx-system-call.patch + * gdb-rhbz1325795-framefilters-test.patch + * gdb-rhbz1398387-tab-crash-test.patch + * gdb-runtest-pie-override.patch + * gdb-symtab-fix-handling-of-dw_tag_unspecified_type.patch + * gdb-tdep-fix-powerpc-ieee-128-bit-format-arg-passing.patch + * gdb-tdep-handle-pipe2-syscall-for-amd64.patch + * gdb-tdep-support-catch-syscall-pipe2-for-i386.patch + * gdb-tdep-update-syscalls-ppc64-ppc-linux.xml.patch + * gdb-test-expr-cumulative-archer.patch + * gdb-testsuite-add-kfail-in-gdb.threads-fork-plus-threads.exp.patch + * gdb-testsuite-add-new-gdb_attach-to-check-attach-command.patch + * gdb-testsuite-address-test-failures-in-gdb.mi-mi-multi-commands.exp.patch + * gdb-testsuite-detect-change-instead-of-init-in-gdb.mi-mi-var-block.exp.patch + * gdb-testsuite-enable-some-test-cases-for-x86_64-m32.patch + * gdb-testsuite-fix-fail-in-gdb.threads-fork-and-threads.exp.patch + * gdb-testsuite-fix-gdb.ada-literals.exp-with-aarch64.patch + * gdb-testsuite-fix-gdb.base-break-idempotent.exp-on-ppc.patch + * gdb-testsuite-fix-gdb.base-catch-syscall.exp-with-with-expat-no.patch + * gdb-testsuite-fix-gdb.base-catch-syscall.exp-without-enable-targets.patch + * gdb-testsuite-fix-gdb.base-infoline-reloc-main-from-.patch + * gdb-testsuite-fix-gdb.base-nested-subp-2-3-.exp-with.patch + * gdb-testsuite-fix-gdb.dwarf2-dw2-dir-file-name.exp-w.patch + * gdb-testsuite-fix-gdb.dwarf2-dw2-out-of-range-end-of-seq.exp-on-aarch64.patch + * gdb-testsuite-fix-gdb.dwarf2-dw2-unspecified-type-foo.c-with-m32.patch + * gdb-testsuite-fix-gdb.mi-mi-sym-info.exp-on-opensuse-tumbleweed.patch + * gdb-testsuite-fix-gdb.opt-clobbered-registers-o2.exp-with-gcc-12.patch + * gdb-testsuite-fix-gdb.reverse-i387-env-reverse.exp-for-pie.patch + * gdb-testsuite-fix-gdb.reverse-test_ioctl_tcsetsw.exp-with-libc-debuginfo.patch + * gdb-testsuite-fix-gdb.threads-killed-outside.exp-on-aarch64.patch + * gdb-testsuite-fix-have_mpx-test.patch + * gdb-testsuite-fix-occasional-failure-in-gdb.mi-mi-multi-commands.exp.patch + * gdb-testsuite-fix-test-failure-when-building-against-readline-v7.patch + * gdb-testsuite-handle-init-errors-in-gdb.mi-user-selected-context-sync.exp.patch + * gdb-testsuite-handle-missing-.note.gnu-stack.patch + * gdb-testsuite-handle-older-python-in-gdb.python-py-send-packet.py.patch + * gdb-testsuite-handle-pipe2-syscall-in-gdb.base-catch-syscall.exp.patch + * gdb-testsuite-handle-quotes-in-gdb_py_module_available.patch + * gdb-testsuite-handle-unordered-dict-in-gdb.python-py-mi-cmd.exp.patch + * gdb-testsuite-refactor-gdb.threads-detach-step-over.exp.patch + * gdb-testsuite-remove-attach-test-from-can_spawn_for_attach.patch + * gdb-testsuite-remove-global-declarations-in-gdb.threads-detach-step-over.exp.patch + * gdb-testsuite-remove-target-limits-in-gdb.base-catch-syscall.exp.patch + * gdb-testsuite-skip-gdb.fortran-namelist.exp-for-gfortran-4.8.patch + * gdb-testsuite-support-recording-of-getrandom.patch + * gdb-testsuite-workaround-unnecessary-.s-file-with-gfortran-4.8.patch + * gdb-update-syscalls-amd64-i386-linux.xml.patch + * gdbserver-switch-to-right-process-in-find_one_thread.patch + * make-gdb.ada-float-bits.exp-more-generic.patch + * powerpc-add-support-for-ieee-128-bit-format.patch + * powerpc-correct-the-gdb-ioctl-values-for-tcgets-tcsets-tcsetsw-and-tcsetsf.patch + * powerpc-fix-for-gdb.base-eh_return.exp.patch + * powerpc-fix-gdb.base-watchpoint.exp-on-power-9.patch + * powerpc-update-expected-floating-point-output-for-gdb.arch-altivec-regs.exp-and-gdb.arch-vsx-regs.exp.patch +- Patches added: + * fixup-gdb-bz634108-solib_address.patch + * gdb-binutils29988-read_indexed_address.patch + * gdb-cli-handle-pending-c-after-rl_callback_read_char.patch + * gdb-rhbz2177655-aarch64-pauth-valid-regcache.patch + * gdb-rhbz2183595-rustc-inside_main.patch + * gdb-testsuite-fix-gdb.gdb-python-helper.exp-with-o2-.patch + * gdb-testsuite-handle-output-after-prompt-in-gdb.thre.patch + * gdb-testsuite-simplify-gdb.base-unwind-on-each-insn..patch + * remove-some-unnecessary-includes-from-exp.y.patch + * gdb-testsuite-fix-gdb.rust-main-crash.exp.patch +- Patches modified: + * gdb-6.3-bz140532-ppc-unwinding-test.patch + * gdb-6.3-gstack-20050411.patch + * gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch + * gdb-6.6-buildid-locate-rpm-suse.patch + * gdb-6.6-buildid-locate-rpm.patch + * gdb-6.6-buildid-locate-solib-missing-ids.patch + * gdb-6.6-buildid-locate.patch + * gdb-6.7-testsuite-stable-results.patch + * gdb-ccache-workaround.patch + * gdb-core-open-vdso-warning.patch + * gdb-fedora-libncursesw.patch + * gdb-gcore-bash.patch + * gdb-linux_perf-bundle.patch + * gdb-testsuite-ada-pie.patch + * gdb-testsuite-add-xfail-in-gdb.arch-i386-pkru.exp.patch + * gdb-testsuite-factor-out-proc-linux_kernel_version.patch + * gdb-testsuite-prevent-compilation-fails-with-unix-fpie-pie.patch +- Maintenance script qa.sh: + * Add -i586 and -x86_64. + * Add KFAILs for PR29040, PR30521, PR30180, PR30518, PR30519. + * Update some KFAIL patterns. + * Add some factory KFAILs. + * Add gdb.base/longjmp-until-in-main.exp in PR26967 KFAILs. +- Maintenance script qa-local.sh: + * Factor out version variable, update to 13.2. + * Try to give reason for build failure. + * Use -$arch as argument to qa.sh. + +------------------------------------------------------------------- + Mon May 22 21:01:44 UTC 2023 - Dirk Müller - disable werror as a workaround for deprecation warnings with python 3.11 (bsc#1211052) ------------------------------------------------------------------- + Fri Apr 7 07:48:58 UTC 2023 - Tom de Vries - Revert to singlespec multibuild. diff --git a/gdb.spec b/gdb.spec index 1d69f1c..b239358 100644 --- a/gdb.spec +++ b/gdb.spec @@ -69,7 +69,7 @@ Group: Development/Languages/C and C++ %endif Name: gdb%{name_suffix} -Version: 12.1 +Version: 13.2 Release: 0 # The release always contains a leading reserved number, start it at 1. @@ -96,10 +96,11 @@ Obsoletes: devtoolset-1.0-%{pkg_name} %endif # %%{ix86} x86_64 # Choose python version -%if 0%{?suse_version} >= 1320 +%if 0%{?suse_version} >= 1200 %define python python3 %else -%define python python +# Skip for SLE-11 due to lack of python3. +%define _without_python 1 %endif # GDB patches have the format `gdb--bz-.patch'. @@ -164,73 +165,56 @@ NoSource: 18 NoSource: 19 %endif -# Fedora import from branch f36, commit 89947a7 "Rebase to FSF GDB 12.1." +# Fedora import from branch f38, commit fc4e284. #Fedora Packages begin Patch2: gdb-6.3-gstack-20050411.patch -Patch3: gdb-6.3-test-dtorfix-20050121.patch -Patch4: gdb-6.3-test-movedir-20050125.patch -Patch5: gdb-6.3-threaded-watchpoints2-20050225.patch -Patch6: gdb-6.3-inheritancetest-20050726.patch -Patch7: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch -Patch8: gdb-6.5-sharedlibrary-path.patch -Patch10: gdb-6.5-last-address-space-byte-test.patch -Patch12: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch -Patch13: gdb-6.5-bz109921-DW_AT_decl_file-test.patch -Patch14: gdb-6.3-bz140532-ppc-unwinding-test.patch -Patch15: gdb-6.3-bz202689-exec-from-pthread-test.patch -Patch16: gdb-6.6-bz230000-power6-disassembly-test.patch -Patch17: gdb-6.6-bz229517-gcore-without-terminal.patch -Patch18: gdb-6.6-testsuite-timeouts.patch -Patch19: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch -Patch20: gdb-6.3-attach-see-vdso-test.patch -Patch21: gdb-6.5-bz243845-stale-testing-zombie-test.patch -Patch22: gdb-6.6-buildid-locate.patch -Patch23: gdb-6.6-buildid-locate-solib-missing-ids.patch -Patch24: gdb-6.6-buildid-locate-rpm.patch -Patch27: gdb-6.7-testsuite-stable-results.patch -Patch28: gdb-6.5-ia64-libunwind-leak-test.patch -Patch29: gdb-6.5-missed-trap-on-step-test.patch -Patch30: gdb-6.5-gcore-buffer-limit-test.patch -Patch31: gdb-6.3-mapping-zero-inode-test.patch -Patch32: gdb-6.3-focus-cmd-prev-test.patch -Patch33: gdb-6.8-bz442765-threaded-exec-test.patch -Patch34: gdb-6.5-section-num-fixup-test.patch -Patch36: gdb-simultaneous-step-resume-breakpoint-test.patch -Patch37: gdb-core-open-vdso-warning.patch -Patch38: gdb-ccache-workaround.patch -Patch39: gdb-lineno-makeup-test.patch -Patch40: gdb-ppc-power7-test.patch -Patch41: gdb-archer-next-over-throw-cxx-exec.patch -Patch42: gdb-bz601887-dwarf4-rh-test.patch -Patch43: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch -Patch44: gdb-test-bt-cfi-without-die.patch -Patch45: gdb-bz634108-solib_address.patch -Patch46: gdb-test-pid0-core.patch -Patch47: gdb-test-dw2-aranges.patch -Patch48: gdb-test-expr-cumulative-archer.patch -Patch49: gdb-physname-pr11734-test.patch -Patch50: gdb-physname-pr12273-test.patch -Patch52: gdb-runtest-pie-override.patch -Patch53: gdb-glibc-strstr-workaround.patch -Patch54: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch -Patch55: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch -Patch56: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch -Patch57: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch -Patch59: gdb-fortran-frame-string.patch -Patch60: gdb-rhbz1156192-recursive-dlopen-test.patch -Patch61: gdb-rhbz1149205-catch-syscall-after-fork-test.patch -Patch62: gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch -Patch63: gdb-rhbz1350436-type-printers-error.patch -Patch64: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch -Patch65: gdb-fedora-libncursesw.patch -Patch66: gdb-opcodes-clflushopt-test.patch -Patch67: gdb-6.6-buildid-locate-rpm-scl.patch -Patch68: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch -Patch70: gdb-rhbz1325795-framefilters-test.patch -Patch71: gdb-linux_perf-bundle.patch -Patch73: gdb-rhbz1398387-tab-crash-test.patch -Patch74: gdb-rhbz1553104-s390x-arch12-test.patch +Patch3: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch +Patch4: gdb-6.5-sharedlibrary-path.patch +Patch6: gdb-6.5-last-address-space-byte-test.patch +Patch8: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch +Patch9: gdb-6.5-bz109921-DW_AT_decl_file-test.patch +Patch11: gdb-6.3-bz202689-exec-from-pthread-test.patch +Patch12: gdb-6.6-bz229517-gcore-without-terminal.patch +Patch13: gdb-6.6-testsuite-timeouts.patch +Patch14: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch +Patch15: gdb-6.3-attach-see-vdso-test.patch +Patch16: gdb-6.5-bz243845-stale-testing-zombie-test.patch +Patch17: gdb-6.6-buildid-locate.patch +Patch18: gdb-6.6-buildid-locate-solib-missing-ids.patch +Patch19: gdb-6.6-buildid-locate-rpm.patch +Patch22: gdb-6.7-testsuite-stable-results.patch +Patch23: gdb-6.5-ia64-libunwind-leak-test.patch +Patch24: gdb-6.5-missed-trap-on-step-test.patch +Patch25: gdb-6.5-gcore-buffer-limit-test.patch +Patch26: gdb-6.3-mapping-zero-inode-test.patch +Patch27: gdb-6.8-bz442765-threaded-exec-test.patch +Patch28: gdb-6.5-section-num-fixup-test.patch +Patch30: gdb-simultaneous-step-resume-breakpoint-test.patch +Patch31: gdb-core-open-vdso-warning.patch +Patch32: gdb-ccache-workaround.patch +Patch33: gdb-lineno-makeup-test.patch +Patch35: gdb-archer-next-over-throw-cxx-exec.patch +Patch36: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch +Patch37: gdb-test-bt-cfi-without-die.patch +Patch38: gdb-bz634108-solib_address.patch +Patch39: gdb-test-pid0-core.patch +Patch40: gdb-test-dw2-aranges.patch +Patch42: gdb-glibc-strstr-workaround.patch +Patch43: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch +Patch44: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch +Patch45: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch +Patch46: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch +Patch49: gdb-rhbz1149205-catch-syscall-after-fork-test.patch +Patch50: gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch +Patch51: gdb-rhbz1350436-type-printers-error.patch +Patch52: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch +Patch53: gdb-fedora-libncursesw.patch +Patch54: gdb-opcodes-clflushopt-test.patch +Patch55: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch +Patch57: gdb-linux_perf-bundle.patch +Patch59: gdb-rhbz1553104-s390x-arch12-test.patch +Patch62: gdb-binutils29988-read_indexed_address.patch #Fedora Packages end # Fedora Packages not copied: @@ -247,46 +231,60 @@ Patch74: gdb-rhbz1553104-s390x-arch12-test.patch # over-specific test-case in a shell script # - gdb-6.5-readline-long-line-crash-test.patch # Hangs for horizontal-scroll-mode on, times out after 10 minutes. +# - gdb-rhbz1156192-recursive-dlopen-test.patch +# Fragile test-case, requires glibc to fail in a certain way. # # Obsolete: -# - gdb-6.7-charsign-test.patch +# - gdb-6.7-charsign-test.patch (dropped by fedora) # - gdb-6.7-ppc-clobbered-registers-O2-test.patch # - gdb-test-ivy-bridge.patch (dropped by fedora) +# - gdb-ppc-power7-test.patch (dropped by fedora) +# - gdb-6.3-bz140532-ppc-unwinding-test.patch (dropped by fedora) +# +# Dropped: +# - gdb-rhbz2177655-aarch64-pauth-valid-regcache.patch (included in 13.2) +# - gdb-rhbz2183595-rustc-inside_main.patch (included in 13.2) # Fedora patches fixup +# These need a number with at least four digits, otherwise patchlist.pl removes +# them when upgrading. -Patch500: fixup-gdb-linux_perf-bundle.patch -Patch501: fixup-gdb-rhbz1325795-framefilters-test.patch -Patch502: fixup-gdb-rhbz1553104-s390x-arch12-test.patch -Patch503: fixup-gdb-glibc-strstr-workaround.patch -Patch504: fixup-gdb-6.5-bz243845-stale-testing-zombie-test.patch -Patch505: fixup-gdb-test-bt-cfi-without-die.patch -Patch506: fixup-2-gdb-rhbz1553104-s390x-arch12-test.patch -Patch507: fixup-gdb-test-dw2-aranges.patch +Patch1000: fixup-gdb-linux_perf-bundle.patch +Patch1002: fixup-gdb-rhbz1553104-s390x-arch12-test.patch +Patch1003: fixup-gdb-glibc-strstr-workaround.patch +Patch1004: fixup-gdb-6.5-bz243845-stale-testing-zombie-test.patch +Patch1005: fixup-gdb-test-bt-cfi-without-die.patch +Patch1006: fixup-2-gdb-rhbz1553104-s390x-arch12-test.patch +Patch1007: fixup-gdb-test-dw2-aranges.patch +Patch1008: fixup-gdb-bz634108-solib_address.patch +Patch1009: fixup-gdb-6.3-gstack-20050411.patch +Patch1010: fixup-gdb-6.3-attach-see-vdso-test.patch +Patch1011: fixup-gdb-lineno-makeup-test.patch +Patch1012: fixup-gdb-rhbz1261564-aarch64-hw-watchpoint-test.pat.patch # openSUSE specific # Hardcodes /bin/bash, given that path is known. -Patch1000: gdb-gcore-bash.patch +Patch1100: gdb-gcore-bash.patch # Make gdb emit zypper install hints, rather than debuginfo-install hints. -Patch1001: gdb-6.6-buildid-locate-rpm-suse.patch +Patch1101: gdb-6.6-buildid-locate-rpm-suse.patch # openSUSE specific -- testsuite # Silences ada pie compilation FAILs. Todo: Fix ada pie compilation. -Patch1100: gdb-testsuite-ada-pie.patch +Patch1200: gdb-testsuite-ada-pie.patch # Strictly speaking, not a testsuite patch, but purpose is to enable gdb.gdb # testcases. -Patch1101: gdb-fix-selftest-fails-with-gdb-build-with-O2-flto.patch +##Patch1201: gdb-fix-selftest-fails-with-gdb-build-with-O2-flto.patch # The test-case expects init or systemd as process, but we run into a case # where it's bash instead. This doesn't look harmful, so allow it. # It would be nice to upstream this, but in order to do that I'd like to have # an explanation of why this happens, so for now, park this here. -Patch1102: gdb-testsuite-fix-gdb-server-ext-run-exp-for-obs.patch +Patch1202: gdb-testsuite-fix-gdb-server-ext-run-exp-for-obs.patch # Tests the zypper install hints. -Patch1103: gdb-testsuite-add-gdb.suse-zypper-hint.exp.patch +Patch1203: gdb-testsuite-add-gdb.suse-zypper-hint.exp.patch # Tests that no branding is leaked from sourcing the fedora package. -Patch1104: gdb-testsuite-add-gdb.suse-debranding.exp.patch +Patch1204: gdb-testsuite-add-gdb.suse-debranding.exp.patch # Patches to upstream @@ -306,63 +304,14 @@ Patch1505: gdb-testsuite-fix-gdb.base-step-over-syscall.exp-with-m32-amd-ca # Backports from release branch -Patch1700: fix-core-file-detach-crash-corefiles-29275.patch -Patch1701: gdb-testsuite-add-new-gdb_attach-to-check-attach-command.patch -Patch1702: gdb-testsuite-remove-global-declarations-in-gdb.threads-detach-step-over.exp.patch -Patch1703: gdb-testsuite-refactor-gdb.threads-detach-step-over.exp.patch -Patch1704: gdb-fix-assert-when-quitting-gdb-while-a-thread-is-stepping.patch -Patch1705: gdbserver-switch-to-right-process-in-find_one_thread.patch -Patch1706: gdb-disable-commit-resumed-in-target_kill.patch +# # Backports from master, available in next release. -Patch2000: gdb-testsuite-fix-gdb.opt-clobbered-registers-o2.exp-with-gcc-12.patch -Patch2001: gdb-testsuite-detect-change-instead-of-init-in-gdb.mi-mi-var-block.exp.patch -Patch2002: gdb-fix-for-gdb.base-eof-exit.exp-test-failures.patch -Patch2003: gdb-testsuite-handle-init-errors-in-gdb.mi-user-selected-context-sync.exp.patch -Patch2004: gdb-add-gdb-syscalls-makefile.patch -Patch2005: gdb-record-handle-statx-system-call.patch -Patch2006: gdb-tdep-handle-pipe2-syscall-for-amd64.patch -Patch2007: gdb-testsuite-handle-pipe2-syscall-in-gdb.base-catch-syscall.exp.patch -Patch2008: gdb-tdep-support-catch-syscall-pipe2-for-i386.patch -Patch2009: gdb-update-syscalls-amd64-i386-linux.xml.patch -Patch2010: gdb-testsuite-address-test-failures-in-gdb.mi-mi-multi-commands.exp.patch -Patch2011: gdb-testsuite-fix-occasional-failure-in-gdb.mi-mi-multi-commands.exp.patch -Patch2012: gdb-testsuite-fix-test-failure-when-building-against-readline-v7.patch -Patch2013: gdb-improved-eof-handling-when-using-readline-7.patch -Patch2014: gdb-testsuite-remove-attach-test-from-can_spawn_for_attach.patch -Patch2015: powerpc-update-expected-floating-point-output-for-gdb.arch-altivec-regs.exp-and-gdb.arch-vsx-regs.exp.patch -Patch2016: powerpc-add-support-for-ieee-128-bit-format.patch -Patch2017: powerpc-correct-the-gdb-ioctl-values-for-tcgets-tcsets-tcsetsw-and-tcsetsf.patch -Patch2018: gdb-testsuite-remove-target-limits-in-gdb.base-catch-syscall.exp.patch -Patch2019: gdb-tdep-update-syscalls-ppc64-ppc-linux.xml.patch -Patch2020: powerpc-fix-for-gdb.base-eh_return.exp.patch -Patch2021: fix-comparison-of-unsigned-long-int-to-int-in-record_linux_system_call.patch -Patch2022: gdb-testsuite-fix-gdb.reverse-test_ioctl_tcsetsw.exp-with-libc-debuginfo.patch -Patch2023: gdb-testsuite-fix-gdb.dwarf2-dw2-out-of-range-end-of-seq.exp-on-aarch64.patch -Patch2024: gdb-testsuite-support-recording-of-getrandom.patch -Patch2025: gdb-testsuite-fix-gdb.base-catch-syscall.exp-without-enable-targets.patch -Patch2026: gdb-testsuite-fix-gdb.base-catch-syscall.exp-with-with-expat-no.patch -Patch2027: fix-for-gdb.base-solib-search.exp-test.patch -Patch2028: make-gdb.ada-float-bits.exp-more-generic.patch -Patch2029: gdb-testsuite-fix-gdb.threads-killed-outside.exp-on-aarch64.patch -Patch2030: gdb-tdep-fix-powerpc-ieee-128-bit-format-arg-passing.patch -Patch2031: gdb-symtab-fix-handling-of-dw_tag_unspecified_type.patch -Patch2032: gdb-handle-pending-c-after-rl_callback_read_char.patch -Patch2033: gdb-testsuite-fix-have_mpx-test.patch -Patch2034: gdb-testsuite-fix-gdb.dwarf2-dw2-unspecified-type-foo.c-with-m32.patch -Patch2035: gdb-add-support-for-readline-8.2.patch -Patch2036: gdb-fix-assert-in-handle_jit_event.patch -Patch2037: gdb-testsuite-fix-gdb.base-break-idempotent.exp-on-ppc.patch -Patch2038: powerpc-fix-gdb.base-watchpoint.exp-on-power-9.patch -Patch2039: gdb-testsuite-handle-missing-.note.gnu-stack.patch -Patch2040: gdb-testsuite-fix-gdb.base-infoline-reloc-main-from-.patch -Patch2041: gdb-testsuite-fix-gdb.base-nested-subp-2-3-.exp-with.patch -Patch2042: add-elfcompress_zstd.patch -Patch2043: binutils-gdb-support-zstd-compressed-debug-section.patch -Patch2044: fix-gdb-build-elf-support-check-lzstd.patch - -# Backports from master, not yet available in next release. +Patch2040: remove-some-unnecessary-includes-from-exp.y.patch +Patch2041: gdb-testsuite-fix-gdb.gdb-python-helper.exp-with-o2-.patch +Patch2042: gdb-testsuite-simplify-gdb.base-unwind-on-each-insn..patch +Patch2043: gdb-testsuite-handle-output-after-prompt-in-gdb.thre.patch Patch2075: gdb-testsuite-add-xfail-in-gdb.arch-i386-pkru.exp.patch Patch2076: gdb-testsuite-factor-out-proc-linux_kernel_version.patch @@ -371,6 +320,26 @@ Patch2078: gdb-testsuite-fix-gdb.threads-schedlock.exp-on-fast-.patch Patch2079: gdb-testsuite-simplify-gdb.arch-amd64-disp-step-avx..patch Patch2080: gdb-testsuite-fix-gdb.threads-schedlock.exp-for-gcc-.patch Patch2081: gdb-testsuite-add-xfail-case-in-gdb.python-py-record.patch +Patch2082: aarch64-avoid-initializers-for-vlas.patch +Patch2083: gdb-tdep-aarch64-fix-frame-address-of-last-insn.patch +Patch2084: fix-pr30369-regression-on-aarch64-arm-pr30506.patch +Patch2085: gdb-testsuite-fix-breakpoint-regexp-in-gdb.ada-out_o.patch +Patch2086: gdb-testsuite-relax-breakpoint-count-check-in-gdb.py.patch +Patch2087: gdb-testsuite-fix-buffer-overflow-in-gdb.base-signed.patch +Patch2088: gdb-testsuite-require-syscall-time-in-gdb.reverse-ti.patch +Patch2089: gdb-testsuite-handle-missing-gdc-in-gdb.dlang-dlang-.patch +Patch2090: gdb-testsuite-add-basic-lmap-for-tcl-8.6.patch +Patch2091: gdb-testsuite-fix-gdb.rust-watch.exp-on-ppc64le.patch +Patch2092: gdb-testsuite-fix-gdb.python-py-breakpoint.exp-timeo.patch +Patch2093: powerpc-fix-for-gdb.reverse-finish-precsave.exp-and-.patch +Patch2094: powerpc-regression-fix-for-reverse-finish-command.patch +Patch2095: gdb-testsuite-don-t-use-string-cat-in-gdb.dwarf2-dw2.patch +Patch2096: move-step_until-procedure.patch +Patch2097: pass-const-frame_info_ptr-reference-for-skip_-langua.patch + +# Backports from master, not yet available in next release. + +# # Backport from gdb-patches @@ -378,32 +347,14 @@ Patch2081: gdb-testsuite-add-xfail-case-in-gdb.python-py-record.patch Patch2100: gdb-python-finishbreakpoint-update.patch # https://sourceware.org/pipermail/gdb-patches/2021-October/182444.html Patch2101: gdb-testsuite-prevent-compilation-fails-with-unix-fpie-pie.patch -# https://sourceware.org/pipermail/gdb-patches/2021-October/182847.html -Patch2102: gdb-testsuite-fix-fail-in-gdb.threads-fork-and-threads.exp.patch -# https://sourceware.org/pipermail/gdb-patches/2021-October/182846.html -Patch2103: gdb-testsuite-add-kfail-in-gdb.threads-fork-plus-threads.exp.patch # https://sourceware.org/pipermail/gdb-patches/2021-October/182919.html Patch2104: gdb-testsuite-work-around-skip_prologue-problems-in-gdb.threads-process-dies-while-detaching.exp.patch # https://sourceware.org/pipermail/gdb-patches/2021-May/178990.html Patch2105: gdb-cli-add-ignore-errors-command.patch -# https://sourceware.org/pipermail/gdb-patches/2022-June/189994.html -Patch2106: gdb-testsuite-skip-gdb.fortran-namelist.exp-for-gfortran-4.8.patch -# https://sourceware.org/pipermail/gdb-patches/2022-June/189995.html -Patch2107: gdb-testsuite-workaround-unnecessary-.s-file-with-gfortran-4.8.patch -# https://sourceware.org/pipermail/gdb-patches/2022-June/190045.html -Patch2108: gdb-testsuite-handle-quotes-in-gdb_py_module_available.patch -# https://sourceware.org/pipermail/gdb-patches/2022-June/190046.html -Patch2109: gdb-testsuite-handle-unordered-dict-in-gdb.python-py-mi-cmd.exp.patch -# https://sourceware.org/pipermail/gdb-patches/2022-June/190054.html -Patch2110: gdb-testsuite-handle-older-python-in-gdb.python-py-send-packet.py.patch -# https://sourceware.org/pipermail/gdb-patches/2022-June/190248.html -Patch2111: gdb-testsuite-enable-some-test-cases-for-x86_64-m32.patch -# https://sourceware.org/pipermail/gdb-patches/2022-June/190249.html -Patch2112: gdb-testsuite-fix-gdb.reverse-i387-env-reverse.exp-for-pie.patch -# https://sourceware.org/pipermail/gdb-patches/2022-July/191107.html -Patch2113: gdb-testsuite-fix-gdb.ada-literals.exp-with-aarch64.patch -# https://sourceware.org/pipermail/gdb-patches/2022-September/192172.html -Patch2115: gdb-testsuite-fix-gdb.mi-mi-sym-info.exp-on-opensuse-tumbleweed.patch +# https://sourceware.org/pipermail/gdb-patches/2023-May/199802.html +Patch2106: gdb-cli-handle-pending-c-after-rl_callback_read_char.patch +# https://sourceware.org/pipermail/gdb-patches/2023-June/200242.html +Patch2107: gdb-testsuite-add-have_host_locale.patch # Debug patches. @@ -411,9 +362,9 @@ Patch2115: gdb-testsuite-fix-gdb.mi-mi-sym-info.exp-on-opensuse-tumbleweed. # Other. Needs comment for each patch. -# Not a backport, but no need to upstream either. Should be able to drop -# it in next release. -Patch3000: gdb-testsuite-fix-gdb.dwarf2-dw2-dir-file-name.exp-w.patch +# + +# End of patches. BuildRequires: bison BuildRequires: flex @@ -619,9 +570,11 @@ BuildRequires: elfutils-debuginfod BuildRequires: xz %endif +%if 0%{!?_without_python:1} # Provide python package xml.etree.ElementTree, used by test-case # gdb.python/py-send-packet.exp. BuildRequires: %{python}-xml +%endif %endif # %%{build_testsuite} @@ -693,11 +646,10 @@ find -name "*.info*"|xargs rm -f %patch2 -p1 %patch3 -p1 %patch4 -p1 -%patch5 -p1 %patch6 -p1 -%patch7 -p1 %patch8 -p1 -%patch10 -p1 +%patch9 -p1 +%patch11 -p1 %patch12 -p1 %patch13 -p1 %patch14 -p1 @@ -706,73 +658,61 @@ find -name "*.info*"|xargs rm -f %patch17 -p1 %patch18 -p1 %patch19 -p1 -%patch20 -p1 -%patch21 -p1 %patch22 -p1 %patch23 -p1 %patch24 -p1 +%patch25 -p1 +%patch26 -p1 %patch27 -p1 %patch28 -p1 -%patch29 -p1 %patch30 -p1 %patch31 -p1 %patch32 -p1 %patch33 -p1 -%patch34 -p1 +%patch35 -p1 %patch36 -p1 %patch37 -p1 %patch38 -p1 %patch39 -p1 %patch40 -p1 -%patch41 -p1 %patch42 -p1 %patch43 -p1 %patch44 -p1 %patch45 -p1 %patch46 -p1 -%patch47 -p1 -%patch48 -p1 %patch49 -p1 %patch50 -p1 +%patch51 -p1 %patch52 -p1 %patch53 -p1 %patch54 -p1 %patch55 -p1 -%patch56 -p1 %patch57 -p1 %patch59 -p1 -%patch60 -p1 -%patch61 -p1 %patch62 -p1 -%patch63 -p1 -%patch64 -p1 -%patch65 -p1 -%patch66 -p1 -%patch67 -p1 -%patch68 -p1 -%patch70 -p1 -%patch71 -p1 -%patch73 -p1 -%patch74 -p1 #Fedora patching end -%patch500 -p1 -%patch501 -p1 -%patch502 -p1 -%patch503 -p1 -%patch504 -p1 -%patch505 -p1 -%patch506 -p1 -%patch507 -p1 - %patch1000 -p1 -%patch1001 -p1 +%patch1002 -p1 +%patch1003 -p1 +%patch1004 -p1 +%patch1005 -p1 +%patch1006 -p1 +%patch1007 -p1 +%patch1008 -p1 +%patch1009 -p1 +%patch1010 -p1 +%patch1011 -p1 +%patch1012 -p1 %patch1100 -p1 %patch1101 -p1 -%patch1102 -p1 -%patch1103 -p1 -%patch1104 -p1 + +%patch1200 -p1 +#%patch1201 -p1 +%patch1202 -p1 +%patch1203 -p1 +%patch1204 -p1 %patch1500 -p1 %patch1501 -p1 @@ -780,59 +720,10 @@ find -name "*.info*"|xargs rm -f %patch1504 -p1 %patch1505 -p1 -%patch1700 -p1 -%patch1701 -p1 -%patch1702 -p1 -%patch1703 -p1 -%patch1704 -p1 -%patch1705 -p1 -%patch1706 -p1 - -%patch2000 -p1 -%patch2001 -p1 -%patch2002 -p1 -%patch2003 -p1 -%patch2004 -p1 -%patch2005 -p1 -%patch2006 -p1 -%patch2007 -p1 -%patch2008 -p1 -%patch2009 -p1 -%patch2010 -p1 -%patch2011 -p1 -%patch2012 -p1 -%patch2013 -p1 -%patch2014 -p1 -%patch2015 -p1 -%patch2016 -p1 -%patch2017 -p1 -%patch2018 -p1 -%patch2019 -p1 -%patch2020 -p1 -%patch2021 -p1 -%patch2022 -p1 -%patch2023 -p1 -%patch2024 -p1 -%patch2025 -p1 -%patch2026 -p1 -%patch2027 -p1 -%patch2028 -p1 -%patch2029 -p1 -%patch2030 -p1 -%patch2031 -p1 -%patch2032 -p1 -%patch2033 -p1 -%patch2034 -p1 -%patch2035 -p1 -%patch2036 -p1 -%patch2037 -p1 -%patch2038 -p1 -%patch2039 -p1 %patch2040 -p1 %patch2041 -p1 %patch2042 -p1 %patch2043 -p1 -%patch2044 -p1 %patch2075 -p1 %patch2076 -p1 @@ -841,24 +732,29 @@ find -name "*.info*"|xargs rm -f %patch2079 -p1 %patch2080 -p1 %patch2081 -p1 +%patch2082 -p1 +%patch2083 -p1 +%patch2084 -p1 +%patch2085 -p1 +%patch2086 -p1 +%patch2087 -p1 +%patch2088 -p1 +%patch2089 -p1 +%patch2090 -p1 +%patch2091 -p1 +%patch2092 -p1 +%patch2093 -p1 +%patch2094 -p1 +%patch2095 -p1 +%patch2096 -p1 +%patch2097 -p1 %patch2100 -p1 %patch2101 -p1 -%patch2102 -p1 -%patch2103 -p1 %patch2104 -p1 %patch2105 -p1 %patch2106 -p1 %patch2107 -p1 -%patch2108 -p1 -%patch2109 -p1 -%patch2110 -p1 -%patch2111 -p1 -%patch2112 -p1 -%patch2113 -p1 -%patch2115 -p1 - -%patch3000 -p1 #unpack libipt %if 0%{have_libipt} @@ -1301,8 +1197,9 @@ rm -rf $RPM_BUILD_ROOT%{_datadir}/locale/ rm -f $RPM_BUILD_ROOT%{_infodir}/bfd* rm -f $RPM_BUILD_ROOT%{_infodir}/standard* rm -f $RPM_BUILD_ROOT%{_infodir}/configure* +rm -f $RPM_BUILD_ROOT%{_infodir}/sframe-spec* rm -rf $RPM_BUILD_ROOT%{_includedir} -rm -rf $RPM_BUILD_ROOT/%{_libdir}/lib{bfd*,opcodes*,iberty*,ctf*} +rm -rf $RPM_BUILD_ROOT/%{_libdir}/lib{bfd*,opcodes*,iberty*,ctf*,sframe*} %if %{build_testsuite} rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/gdbinit diff --git a/gdbserver-switch-to-right-process-in-find_one_thread.patch b/gdbserver-switch-to-right-process-in-find_one_thread.patch deleted file mode 100644 index 170b2b4..0000000 --- a/gdbserver-switch-to-right-process-in-find_one_thread.patch +++ /dev/null @@ -1,255 +0,0 @@ -gdbserver: switch to right process in find_one_thread - -New in this version: add a dedicated test. - -When I do this: - - $ ./gdb -nx --data-directory=data-directory -q \ - /bin/sleep \ - -ex "maint set target-non-stop on" \ - -ex "tar ext :1234" \ - -ex "set remote exec-file /bin/sleep" \ - -ex "run 1231 &" \ - -ex add-inferior \ - -ex "inferior 2" - Reading symbols from /bin/sleep... - (No debugging symbols found in /bin/sleep) - Remote debugging using :1234 - Starting program: /bin/sleep 1231 - Reading /lib64/ld-linux-x86-64.so.2 from remote target... - warning: File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead. - Reading /lib64/ld-linux-x86-64.so.2 from remote target... - Reading /usr/lib/debug/.build-id/a6/7a1408f18db3576757eea210d07ba3fc560dff.debug from remote target... - [New inferior 2] - Added inferior 2 on connection 1 (extended-remote :1234) - [Switching to inferior 2 [] ()] - (gdb) Reading /lib/x86_64-linux-gnu/libc.so.6 from remote target... - attach 3659848 - Attaching to process 3659848 - /home/smarchi/src/binutils-gdb/gdb/thread.c:85: internal-error: inferior_thread: Assertion `current_thread_ != nullptr' failed. - -Note the "attach" command just above. When doing it on the command-line -with a -ex switch, the bug doesn't trigger. - -The internal error of GDB is actually caused by GDBserver crashing, and -the error recovery of GDB is not on point. This patch aims to fix just -the GDBserver crash, not the GDB problem. - -GDBserver crashes with a segfault here: - - (gdb) bt - #0 0x00005555557fb3f4 in find_one_thread (ptid=...) at /home/smarchi/src/binutils-gdb/gdbserver/thread-db.cc:177 - #1 0x00005555557fd5cf in thread_db_thread_handle (ptid=, handle=0x7fffffffc400, handle_len=0x7fffffffc3f0) - at /home/smarchi/src/binutils-gdb/gdbserver/thread-db.cc:461 - #2 0x000055555578a0b6 in linux_process_target::thread_handle (this=0x5555558a64c0 , ptid=, handle=0x7fffffffc400, - handle_len=0x7fffffffc3f0) at /home/smarchi/src/binutils-gdb/gdbserver/linux-low.cc:6905 - #3 0x00005555556dfcc6 in handle_qxfer_threads_worker (thread=0x60b000000510, buffer=0x7fffffffc8a0) at /home/smarchi/src/binutils-gdb/gdbserver/server.cc:1645 - #4 0x00005555556e00e6 in operator() (__closure=0x7fffffffc5e0, thread=0x60b000000510) at /home/smarchi/src/binutils-gdb/gdbserver/server.cc:1696 - #5 0x00005555556f54be in for_each_thread >(struct {...}) (func=...) at /home/smarchi/src/binutils-gdb/gdbserver/gdbthread.h:159 - #6 0x00005555556e0242 in handle_qxfer_threads_proper (buffer=0x7fffffffc8a0) at /home/smarchi/src/binutils-gdb/gdbserver/server.cc:1694 - #7 0x00005555556e04ba in handle_qxfer_threads (annex=0x629000000213 "", readbuf=0x621000019100 '\276' ..., writebuf=0x0, offset=0, len=4097) - at /home/smarchi/src/binutils-gdb/gdbserver/server.cc:1732 - #8 0x00005555556e1989 in handle_qxfer (own_buf=0x629000000200 "qXfer:threads", packet_len=26, new_packet_len_p=0x7fffffffd630) at /home/smarchi/src/binutils-gdb/gdbserver/server.cc:2045 - #9 0x00005555556e720a in handle_query (own_buf=0x629000000200 "qXfer:threads", packet_len=26, new_packet_len_p=0x7fffffffd630) at /home/smarchi/src/binutils-gdb/gdbserver/server.cc:2685 - #10 0x00005555556f1a01 in process_serial_event () at /home/smarchi/src/binutils-gdb/gdbserver/server.cc:4176 - #11 0x00005555556f4457 in handle_serial_event (err=0, client_data=0x0) at /home/smarchi/src/binutils-gdb/gdbserver/server.cc:4514 - #12 0x0000555555820f56 in handle_file_event (file_ptr=0x607000000250, ready_mask=1) at /home/smarchi/src/binutils-gdb/gdbsupport/event-loop.cc:573 - #13 0x0000555555821895 in gdb_wait_for_event (block=1) at /home/smarchi/src/binutils-gdb/gdbsupport/event-loop.cc:694 - #14 0x000055555581f533 in gdb_do_one_event (mstimeout=-1) at /home/smarchi/src/binutils-gdb/gdbsupport/event-loop.cc:264 - #15 0x00005555556ec9fb in start_event_loop () at /home/smarchi/src/binutils-gdb/gdbserver/server.cc:3512 - #16 0x00005555556f0769 in captured_main (argc=4, argv=0x7fffffffe0d8) at /home/smarchi/src/binutils-gdb/gdbserver/server.cc:3992 - #17 0x00005555556f0e3f in main (argc=4, argv=0x7fffffffe0d8) at /home/smarchi/src/binutils-gdb/gdbserver/server.cc:4078 - -The reason is a wrong current process when find_one_thread is called. -The current process is the 2nd one, which was just attached. It does -not yet have thread_db data (proc->priv->thread_db is nullptr). As we -iterate on all threads of all process to fulfull the qxfer:threads:read -request, we get to a thread of process 1 for which we haven't read -thread_db information yet (lwp_info::thread_known is false), so we get -into find_one_thread. find_one_thread uses -`current_process ()->priv->thread_db`, assuming the current process -matches the ptid passed as a parameter, which is wrong. A segfault -happens when trying to dereference that thread_db pointer. - -Fix this by making find_one_thread not assume what the current process / -current thread is. If it needs to call into libthread_db, which we know -will try to read memory from the current process, then temporarily set -the current process. - -In the case where the thread is already know and we return early, we -don't need to switch process. - -Add a test to reproduce this specific situation. - -Change-Id: I09b00883e8b73b7e5f89d0f47cb4e9c0f3d6caaa -Approved-By: Andrew Burgess - ---- - gdb/testsuite/gdb.multi/attach-while-running.c | 26 +++++++++ - gdb/testsuite/gdb.multi/attach-while-running.exp | 73 ++++++++++++++++++++++++ - gdbserver/thread-db.cc | 29 ++++++---- - 3 files changed, 116 insertions(+), 12 deletions(-) - -diff --git a/gdb/testsuite/gdb.multi/attach-while-running.c b/gdb/testsuite/gdb.multi/attach-while-running.c -new file mode 100644 -index 00000000000..dd321dfe007 ---- /dev/null -+++ b/gdb/testsuite/gdb.multi/attach-while-running.c -@@ -0,0 +1,26 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2022 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 . */ -+ -+#include -+ -+int global_var = 123; -+ -+int -+main (void) -+{ -+ sleep (30); -+} -diff --git a/gdb/testsuite/gdb.multi/attach-while-running.exp b/gdb/testsuite/gdb.multi/attach-while-running.exp -new file mode 100644 -index 00000000000..125273d0524 ---- /dev/null -+++ b/gdb/testsuite/gdb.multi/attach-while-running.exp -@@ -0,0 +1,73 @@ -+# Copyright 2022 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 . -+ -+# This test was introduced to reproduce a specific bug in GDBserver, where -+# attaching an inferior while another one was running would trigger a segfault -+# in GDBserver. Reproducing the bug required specific circumstances: -+# -+# - The first process must be far enough to have loaded its libc or -+# libpthread (whatever triggers the loading of libthread_db), such that -+# its proc->priv->thread_db is not nullptr -+# -+# - However, its lwp must still be in the `!lwp->thread_known` state, -+# meaning GDBserver hasn't asked libthread_db to compute the thread -+# handle yet. That means, GDB must not have refreshed the thread list -+# yet, since that would cause the thread handles to be computed. That -+# means, no stopping on a breakpoint, since that causes a thread list -+# update. That's why the first inferior needs to be started with "run -+# &". -+# -+# - Attaching the second process would segfault GDBserver. -+# -+# All of this to say, if modifying this test, please keep in mind the original -+# intent. -+ -+standard_testfile -+ -+if [use_gdb_stub] { -+ unsupported "test requires running" -+ return -+} -+ -+if { [build_executable "failed to prepare" ${testfile} ${srcfile}] } { -+ return -+} -+ -+proc do_test {} { -+ save_vars { $::GDBFLAGS } { -+ append ::GDBFLAGS " -ex \"maint set target-non-stop on\"" -+ clean_restart $::binfile -+ } -+ -+ gdb_test_multiple "run &" "" { -+ -re ".*$::gdb_prompt " { -+ pass $gdb_test_name -+ } -+ } -+ gdb_test "add-inferior" "Added inferior 2 on connection 1 .*" -+ gdb_test "inferior 2" "Switching to inferior 2 .*" -+ -+ set spawn_id [spawn_wait_for_attach $::binfile] -+ set pid [spawn_id_get_pid $spawn_id] -+ -+ # This call would crash GDBserver. -+ gdb_attach $pid -+ -+ # Read a variable from the inferior, just to make sure the attach worked -+ # fine. -+ gdb_test "print global_var" " = 123" -+} -+ -+do_test -diff --git a/gdbserver/thread-db.cc b/gdbserver/thread-db.cc -index 6e0e2228a5f..bf98ca9557a 100644 ---- a/gdbserver/thread-db.cc -+++ b/gdbserver/thread-db.cc -@@ -155,30 +155,35 @@ thread_db_state_str (td_thr_state_e state) - } - #endif - --/* Get thread info about PTID, accessing memory via the current -- thread. */ -+/* Get thread info about PTID. */ - - static int - find_one_thread (ptid_t ptid) - { -- td_thrhandle_t th; -- td_thrinfo_t ti; -- td_err_e err; -- struct lwp_info *lwp; -- struct thread_db *thread_db = current_process ()->priv->thread_db; -- int lwpid = ptid.lwp (); -- - thread_info *thread = find_thread_ptid (ptid); -- lwp = get_thread_lwp (thread); -+ lwp_info *lwp = get_thread_lwp (thread); - if (lwp->thread_known) - return 1; - -- /* Get information about this thread. */ -- err = thread_db->td_ta_map_lwp2thr_p (thread_db->thread_agent, lwpid, &th); -+ /* Get information about this thread. libthread_db will need to read some -+ memory, which will be done on the current process, so make PTID's process -+ the current one. */ -+ process_info *proc = find_process_pid (ptid.pid ()); -+ gdb_assert (proc != nullptr); -+ -+ scoped_restore_current_thread restore_thread; -+ switch_to_process (proc); -+ -+ thread_db *thread_db = proc->priv->thread_db; -+ td_thrhandle_t th; -+ int lwpid = ptid.lwp (); -+ td_err_e err = thread_db->td_ta_map_lwp2thr_p (thread_db->thread_agent, lwpid, -+ &th); - if (err != TD_OK) - error ("Cannot get thread handle for LWP %d: %s", - lwpid, thread_db_err_str (err)); - -+ td_thrinfo_t ti; - err = thread_db->td_thr_get_info_p (&th, &ti); - if (err != TD_OK) - error ("Cannot get thread info for LWP %d: %s", diff --git a/make-gdb.ada-float-bits.exp-more-generic.patch b/make-gdb.ada-float-bits.exp-more-generic.patch deleted file mode 100644 index 2f06924..0000000 --- a/make-gdb.ada-float-bits.exp-more-generic.patch +++ /dev/null @@ -1,145 +0,0 @@ -Make gdb.ada/float-bits.exp more generic - -There are assumptions in the test about the long double format -being used. While the results are OK for i387 128-bit long doubles, it -is not correct for IEEE quad 128-bit long doubles. - -Also, depending on the target (64-bit/32-bit), long doubles may not -be available at all. And it may be the case that the compiler for a 64-bit -target doesn't support 128-bit long doubles, but GDB might still support it -internally. - -Lastly, not every long double format has invalid values. Some formats -consider all values as valid floating point numbers. - -These divergences cause the following FAIL's on aarch64/arm: - -FAIL: gdb.ada/float-bits.exp: print val_long_double -FAIL: gdb.ada/float-bits.exp: print val_long_double after assignment - -With the above in mind, extend the test a little so it behaves well on -different architectures and so it works with different long double -formats. - -Main changes: - -- Use long double values appropriate for the long double format. -- Test long double assignment to compiler-generated long - double variables. -- Test long double assignment to GDB internal variables. - -Tested on x86_64 (16 PASS), i686 (16 PASS), aarch64 (12 PASS) and arm (9 PASS). - ---- - gdb/testsuite/gdb.ada/float-bits.exp | 87 ++++++++++++++++++++++++++++-------- - 1 file changed, 68 insertions(+), 19 deletions(-) - -diff --git a/gdb/testsuite/gdb.ada/float-bits.exp b/gdb/testsuite/gdb.ada/float-bits.exp -index 4ca8dbf88e5..55a0566580c 100644 ---- a/gdb/testsuite/gdb.ada/float-bits.exp -+++ b/gdb/testsuite/gdb.ada/float-bits.exp -@@ -25,6 +25,27 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} { - return -1 - } - -+# Given a floating point EXPRESSION, return the size of the result. -+ -+proc float_size { expression } { -+ -+ set size 0 -+ gdb_test_multiple "ptype ${expression}" "" { -+ -re -wrap "<16-byte float>" { -+ set size 16 -+ } -+ -re -wrap "<12-byte float>" { -+ set size 12 -+ } -+ -re -wrap "<\\d+-byte float>" { -+ # Assume 8 for anything less than or equal to 8. -+ set size 8 -+ } -+ } -+ -+ return $size -+} -+ - clean_restart ${testfile} - - set bp_location [gdb_get_line_number "BREAK" ${testdir}/prog.adb] -@@ -42,29 +63,57 @@ gdb_test "print val_double := 16lf#bc0d83c94fb6d2ac#" " = -2.0e-19" - gdb_test "print val_double" " = -2.0e-19" \ - "print val_double after assignment" - --set 16llf_supported 0 --gdb_test_multiple "ptype long_long_float" "" { -- -re -wrap "<16-byte float>" { -- set 16llf_supported 1 -- pass $gdb_test_name -- } -- -re -wrap "<\\d+-byte float>" { -- pass $gdb_test_name -+# Fetch the size of a compiler-generated long double. -+set compiler_long_double_size [float_size "long_long_float" ] -+ -+# Fetch the size of an internal long double type in GDB. -+set gdb_long_double_size [float_size "16llf#0#" ] -+ -+# Different architectures use different long double formats. For -+# example, IEEE quad versus i387 long doubles. Account for that in the -+# tests below. -+ -+# Set default values for 128-bit IEEE quad long doubles. -+set valid_long_double "16llf#4000921fb54442d18469898cc51701b8#" -+set printed_long_double "3.1415926535897932384626433832795028" -+set invalid_long_double "" -+set has_invalid_long_double 0 -+ -+if { [istarget x86_64-*-* ] || [istarget i?86-*-*] } { -+ # i387 long double have invalid values -+ set has_invalid_long_double 1 -+ if { $compiler_long_double_size == 16 } { -+ # 5.0e+25 in i387 128-bit long double. -+ set valid_long_double "16llf#7ffff7ff4054a56fa5b99019a5c8#" -+ set invalid_long_double "16llf#a56fa5b99019a5c800007ffff7ff4054#" -+ set printed_long_double "5.0e\\+25" -+ } elseif { $compiler_long_double_size == 12 } { -+ # 5.0e+25 in i387 80-bit long double. -+ set valid_long_double "16llf#56554054a56fa5b99019a5c8#" -+ set invalid_long_double "16llf#9019a5c800007ffff7ff4054#" -+ set printed_long_double "5.0e\\+25" - } - } - --if { $16llf_supported } { -- gdb_test "print 16llf#7FFFF7FF4054A56FA5B99019A5C8#" " = 5.0e\\+25" -+# Exercise GDB-side long doubles. -+if { $gdb_long_double_size > 8 } { -+ gdb_test "print ${valid_long_double}" " = ${printed_long_double}" -+ gdb_test "print \$foo:=${valid_long_double}" "= ${printed_long_double}" -+ gdb_test "print \$foo" "= ${printed_long_double}" \ -+ "print internal long double variable after assignment" - } --gdb_test "print val_long_double" " = 5.0e\\+25" --if { $16llf_supported } { -- gdb_test "print val_long_double := 16llf#7FFFF7FF4054A56FA5B99019A5C8#" \ -- " = 5.0e\\+25" -+ -+# Exercise compiler-side long doubles. -+if { $compiler_long_double_size > 8 } { -+ gdb_test "print val_long_double" " = 5.0e\\+25" -+ gdb_test "print val_long_double := ${valid_long_double}" \ -+ " = ${printed_long_double}" -+ gdb_test "print val_long_double" " = ${printed_long_double}" \ -+ "print val_long_double after assignment" - } --gdb_test "print val_long_double" " = 5.0e\\+25" \ -- "print val_long_double after assignment" - --if { $16llf_supported } { -- gdb_test "print 16llf#a56fa5b99019a5c800007ffff7ff4054#" \ -- " = " -+# If the target has invalid long double values, test it now. -+if { $has_invalid_long_double } { -+ gdb_test "print ${invalid_long_double}" \ -+ " = " "print invalid long double value" - } diff --git a/move-step_until-procedure.patch b/move-step_until-procedure.patch new file mode 100644 index 0000000..4f78895 --- /dev/null +++ b/move-step_until-procedure.patch @@ -0,0 +1,162 @@ +From d1e39adc6c93765434e8c6ddfe6192e85318241b Mon Sep 17 00:00:00 2001 +From: Carl Love +Date: Wed, 1 Mar 2023 11:45:43 -0500 +Subject: [PATCH 8/9] Move step_until procedure + +Procedure step_until from test gdb.reverse/step-indirect-call-thunk.exp +is moved to lib/gdb.exp and renamed repeat_cmd_until. The existing procedure +gdb_step_until in lib/gdb.exp is simpler variant of the new repeat_cmd_until +procedure. The existing procedure gdb_step_until is changed to just call +the new repeat_cmd_until procedure with the command set to "step" and an +optional CURRENT string. The default CURRENT string is set to "\}" to work +with the existing uses of procedure gdb_step_until. +--- + .../gdb.reverse/step-indirect-call-thunk.exp | 49 +++---------------- + gdb/testsuite/lib/gdb.exp | 47 ++++++++++++------ + 2 files changed, 41 insertions(+), 55 deletions(-) + +diff --git a/gdb/testsuite/gdb.reverse/step-indirect-call-thunk.exp b/gdb/testsuite/gdb.reverse/step-indirect-call-thunk.exp +index a9d22e45cfc..9970ff57a1b 100644 +--- a/gdb/testsuite/gdb.reverse/step-indirect-call-thunk.exp ++++ b/gdb/testsuite/gdb.reverse/step-indirect-call-thunk.exp +@@ -30,39 +30,6 @@ if { ![runto_main] } { + return -1 + } + +-# Do repeated stepping COMMANDs in order to reach TARGET from CURRENT +-# +-# COMMAND is a stepping command +-# CURRENT is a string matching the current location +-# TARGET is a string matching the target location +-# TEST is the test name +-# +-# The function issues repeated COMMANDs as long as the location matches +-# CURRENT up to a maximum of 100 steps. +-# +-# TEST passes if the resulting location matches TARGET and fails +-# otherwise. +-# +-proc step_until { command current target test } { +- global gdb_prompt +- +- set count 0 +- gdb_test_multiple "$command" "$test" { +- -re "$current.*$gdb_prompt $" { +- incr count +- if { $count < 100 } { +- send_gdb "$command\n" +- exp_continue +- } else { +- fail "$test" +- } +- } +- -re "$target.*$gdb_prompt $" { +- pass "$test" +- } +- } +-} +- + gdb_test_no_output "record" + gdb_test "next" ".*" "record trace" + +@@ -82,20 +49,20 @@ gdb_test "reverse-next" "apply\.2.*" \ + "reverse-step through thunks and over inc" + + # We can use instruction stepping to step into thunks. +-step_until "stepi" "apply\.2" "indirect_thunk" "stepi into call thunk" +-step_until "stepi" "indirect_thunk" "inc" \ ++repeat_cmd_until "stepi" "apply\.2" "indirect_thunk" "stepi into call thunk" ++repeat_cmd_until "stepi" "indirect_thunk" "inc" \ + "stepi out of call thunk into inc" + set alphanum_re "\[a-zA-Z0-9\]" + set pic_thunk_re "__$alphanum_re*\\.get_pc_thunk\\.$alphanum_re* \\(\\)" +-step_until "stepi" "(inc|$pic_thunk_re)" "return_thunk" "stepi into return thunk" +-step_until "stepi" "return_thunk" "apply" \ ++repeat_cmd_until "stepi" "(inc|$pic_thunk_re)" "return_thunk" "stepi into return thunk" ++repeat_cmd_until "stepi" "return_thunk" "apply" \ + "stepi out of return thunk back into apply" + +-step_until "reverse-stepi" "apply" "return_thunk" \ ++repeat_cmd_until "reverse-stepi" "apply" "return_thunk" \ + "reverse-stepi into return thunk" +-step_until "reverse-stepi" "return_thunk" "inc" \ ++repeat_cmd_until "reverse-stepi" "return_thunk" "inc" \ + "reverse-stepi out of return thunk into inc" +-step_until "reverse-stepi" "(inc|$pic_thunk_re)" "indirect_thunk" \ ++repeat_cmd_until "reverse-stepi" "(inc|$pic_thunk_re)" "indirect_thunk" \ + "reverse-stepi into call thunk" +-step_until "reverse-stepi" "indirect_thunk" "apply" \ ++repeat_cmd_until "reverse-stepi" "indirect_thunk" "apply" \ + "reverse-stepi out of call thunk into apply" +diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp +index cd043ce3436..b36d3a9d8c1 100644 +--- a/gdb/testsuite/lib/gdb.exp ++++ b/gdb/testsuite/lib/gdb.exp +@@ -9336,31 +9336,50 @@ gdb_caching_proc arm_cc_for_target { + + # Step until the pattern REGEXP is found. Step at most + # MAX_STEPS times, but stop stepping once REGEXP is found. +-# ++# CURRENT matches current location + # If REGEXP is found then a single pass is emitted, otherwise, after + # MAX_STEPS steps, a single fail is emitted. + # + # TEST_NAME is the name used in the pass/fail calls. + +-proc gdb_step_until { regexp {test_name ""} {max_steps 10} } { +- if { $test_name == "" } { +- set test_name "stepping until regexp" +- } ++proc gdb_step_until { regexp {test_name "stepping until regexp"} \ ++ {current "\}"} { max_steps 10 } } { ++ repeat_cmd_until "step" $current $regexp $test_name "10" ++} ++ ++# Do repeated stepping COMMANDs in order to reach TARGET from CURRENT ++# ++# COMMAND is a stepping command ++# CURRENT is a string matching the current location ++# TARGET is a string matching the target location ++# TEST_NAME is the test name ++# MAX_STEPS is number of steps attempted before fail is emitted ++# ++# The function issues repeated COMMANDs as long as the location matches ++# CURRENT up to a maximum of MAX_STEPS. ++# ++# TEST_NAME passes if the resulting location matches TARGET and fails ++# otherwise. ++ ++proc repeat_cmd_until { command current target \ ++ {test_name "stepping until regexp"} \ ++ {max_steps 100} } { ++ global gdb_prompt + + set count 0 +- gdb_test_multiple "step" "$test_name" { +- -re "$regexp\r\n$::gdb_prompt $" { +- pass $test_name +- } +- -re ".*$::gdb_prompt $" { +- if {$count < $max_steps} { +- incr count +- send_gdb "step\n" ++ gdb_test_multiple "$command" "$test_name" { ++ -re "$current.*$gdb_prompt $" { ++ incr count ++ if { $count < $max_steps } { ++ send_gdb "$command\n" + exp_continue + } else { +- fail $test_name ++ fail "$test_name" + } + } ++ -re "$target.*$gdb_prompt $" { ++ pass "$test_name" ++ } + } + } + +-- +2.35.3 + diff --git a/pass-const-frame_info_ptr-reference-for-skip_-langua.patch b/pass-const-frame_info_ptr-reference-for-skip_-langua.patch new file mode 100644 index 0000000..4e3ec5d --- /dev/null +++ b/pass-const-frame_info_ptr-reference-for-skip_-langua.patch @@ -0,0 +1,118 @@ +From 406fd9f71067fce649343dfd609ca8e5e97b2164 Mon Sep 17 00:00:00 2001 +From: Mark Wielaard +Date: Tue, 2 May 2023 20:23:32 +0200 +Subject: [PATCH] Pass const frame_info_ptr reference for + skip_[language_]trampoline +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +g++ 13.1.1 produces a -Werror=dangling-pointer= + +In file included from ../../binutils-gdb/gdb/frame.h:75, + from ../../binutils-gdb/gdb/symtab.h:40, + from ../../binutils-gdb/gdb/language.c:33: +In member function ‘void intrusive_list::push_empty(T&) [with T = frame_info_ptr; AsNode = intrusive_base_node]’, + inlined from ‘void intrusive_list::push_back(reference) [with T = frame_info_ptr; AsNode = intrusive_base_node]’ at gdbsupport/intrusive_list.h:332:24, + inlined from ‘frame_info_ptr::frame_info_ptr(const frame_info_ptr&)’ at gdb/frame.h:241:26, + inlined from ‘CORE_ADDR skip_language_trampoline(frame_info_ptr, CORE_ADDR)’ at gdb/language.c:530:49: +gdbsupport/intrusive_list.h:415:12: error: storing the address of local variable ‘’ in ‘frame_info_ptr::frame_list.intrusive_list::m_back’ [-Werror=dangling-pointer=] + 415 | m_back = &elem; + | ~~~~~~~^~~~~~~ +gdb/language.c: In function ‘CORE_ADDR skip_language_trampoline(frame_info_ptr, CORE_ADDR)’: +gdb/language.c:530:49: note: ‘’ declared here + 530 | CORE_ADDR real_pc = lang->skip_trampoline (frame, pc); + | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~ +gdb/frame.h:359:41: note: ‘frame_info_ptr::frame_list’ declared here + 359 | static intrusive_list frame_list; + | ^~~~~~~~~~ + +Each new frame_info_ptr is being pushed on a static frame list and g++ +cannot see why that is safe in case the frame_info_ptr is created and +destroyed immediately when passed as value. + +It isn't clear why only in this one place g++ sees the issue (probably +because it can inline enough code in this specific case). + +Since passing the frame_info_ptr as const reference is cheaper, use +that as workaround for this warning. + +PR build/30413 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30413 + +Tested-by: Kevin Buettner +Reviewed-by: Kevin Buettner +Reviewed-by: Tom Tromey +--- + gdb/c-lang.c | 2 +- + gdb/language.c | 2 +- + gdb/language.h | 4 ++-- + gdb/objc-lang.c | 2 +- + 4 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/gdb/c-lang.c b/gdb/c-lang.c +index 52010fa8cb1..a46343c837a 100644 +--- a/gdb/c-lang.c ++++ b/gdb/c-lang.c +@@ -1003,7 +1003,7 @@ class cplus_language : public language_defn + + /* See language.h. */ + +- CORE_ADDR skip_trampoline (frame_info_ptr fi, ++ CORE_ADDR skip_trampoline (const frame_info_ptr &fi, + CORE_ADDR pc) const override + { + return cplus_skip_trampoline (fi, pc); +diff --git a/gdb/language.c b/gdb/language.c +index 5037867b256..655d0794394 100644 +--- a/gdb/language.c ++++ b/gdb/language.c +@@ -528,7 +528,7 @@ add_set_language_command () + Return the result from the first that returns non-zero, or 0 if all + `fail'. */ + CORE_ADDR +-skip_language_trampoline (frame_info_ptr frame, CORE_ADDR pc) ++skip_language_trampoline (const frame_info_ptr &frame, CORE_ADDR pc) + { + for (const auto &lang : language_defn::languages) + { +diff --git a/gdb/language.h b/gdb/language.h +index cf94923ecc1..88c3bc90efe 100644 +--- a/gdb/language.h ++++ b/gdb/language.h +@@ -471,7 +471,7 @@ struct language_defn + If that PC falls in a trampoline belonging to this language, return + the address of the first pc in the real function, or 0 if it isn't a + language tramp for this language. */ +- virtual CORE_ADDR skip_trampoline (frame_info_ptr fi, CORE_ADDR pc) const ++ virtual CORE_ADDR skip_trampoline (const frame_info_ptr &fi, CORE_ADDR pc) const + { + return (CORE_ADDR) 0; + } +@@ -789,7 +789,7 @@ extern const char *language_str (enum language); + + /* Check for a language-specific trampoline. */ + +-extern CORE_ADDR skip_language_trampoline (frame_info_ptr, CORE_ADDR pc); ++extern CORE_ADDR skip_language_trampoline (const frame_info_ptr &, CORE_ADDR pc); + + /* Return demangled language symbol, or NULL. */ + extern gdb::unique_xmalloc_ptr language_demangle +diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c +index e17a4c406c0..5bcf1e4f3f0 100644 +--- a/gdb/objc-lang.c ++++ b/gdb/objc-lang.c +@@ -282,7 +282,7 @@ class objc_language : public language_defn + + /* See language.h. */ + +- CORE_ADDR skip_trampoline (frame_info_ptr frame, ++ CORE_ADDR skip_trampoline (const frame_info_ptr &frame, + CORE_ADDR stop_pc) const override + { + struct gdbarch *gdbarch = get_frame_arch (frame); + +base-commit: 4b9342bc7f1d79b1453afd6c15e1a5cdefa92d9e +-- +2.35.3 + diff --git a/powerpc-add-support-for-ieee-128-bit-format.patch b/powerpc-add-support-for-ieee-128-bit-format.patch deleted file mode 100644 index 80d5bd5..0000000 --- a/powerpc-add-support-for-ieee-128-bit-format.patch +++ /dev/null @@ -1,192 +0,0 @@ -PowerPC: Add support for IEEE 128-bit format. - -The test gdb.base/infcall-nested-structs-c.exp fails on a gdb assert -in function ppc64_sysv_abi_return_value in file gdb/ppc-sysv-tdep.c. The -assert is due to the missing IEEE 128-bit support in file -gdb/ppc-sysv-tdep.c. - -The IBM long double was the initial float 128-bit support added by IBM -The IEEE 128-bit support, which is similar IBM long double support, was -made the default starting with GCC 12. The floating point format -differences include the number of bits used to encode the exponent -and significand. Also, IBM long double values are passed in a pair of -floating point registers. The IEEE 128-bit value is passed in a single -vector register. - -This patch fixes the gdb_assert (ok); in function -ppc64_sysv_abi_return_value in gdb/ppc-sysv-tdep.c by adding IEEE FLOAT -128-bit type support for PowerPC. - -The patch has been tested on Power 10, ELFv2. It fixes the following list -of regression failures on Power 10: - -gdb.base/infcall-nested-structs-c.exp 192 -gdb.base/infcall-nested-structs-c++.exp 76 -gdb.base/structs.exp 9 - -The patch has been tested on Power 8 BE which is ELFv1. - ---- - gdb/ppc-sysv-tdep.c | 87 ++++++++++++++++++++++++++++++++++++++++++----------- - 1 file changed, 69 insertions(+), 18 deletions(-) - -diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c -index 9a3b02f028d..b7106542b5d 100644 ---- a/gdb/ppc-sysv-tdep.c -+++ b/gdb/ppc-sysv-tdep.c -@@ -450,12 +450,17 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - } - } - else if (len == 16 -- && type->code () == TYPE_CODE_ARRAY -- && type->is_vector () -- && tdep->vector_abi == POWERPC_VEC_ALTIVEC) -+ && ((type->code () == TYPE_CODE_ARRAY -+ && type->is_vector () -+ && tdep->vector_abi == POWERPC_VEC_ALTIVEC) -+ || (type->code () == TYPE_CODE_FLT -+ && (gdbarch_long_double_format (gdbarch) -+ == floatformats_ia64_quad)))) - { - /* Vector parameter passed in an Altivec register, or -- when that runs out, 16 byte aligned stack location. */ -+ when that runs out, 16 byte aligned stack location. -+ IEEE FLOAT 128-bit also passes parameters in vector -+ registers. */ - if (vreg <= 13) - { - if (write_pass) -@@ -1180,7 +1185,8 @@ ppc64_aggregate_candidate (struct type *type, - - static int - ppc64_elfv2_abi_homogeneous_aggregate (struct type *type, -- struct type **elt_type, int *n_elts) -+ struct type **elt_type, int *n_elts, -+ struct gdbarch *gdbarch) - { - /* Complex types at the top level are treated separately. However, - complex types can be elements of homogeneous aggregates. */ -@@ -1193,9 +1199,20 @@ ppc64_elfv2_abi_homogeneous_aggregate (struct type *type, - - if (field_count > 0) - { -- int n_regs = ((field_type->code () == TYPE_CODE_FLT -- || field_type->code () == TYPE_CODE_DECFLOAT)? -- (TYPE_LENGTH (field_type) + 7) >> 3 : 1); -+ int n_regs; -+ -+ if (field_type->code () == TYPE_CODE_FLT -+ && (gdbarch_long_double_format (gdbarch) -+ == floatformats_ia64_quad)) -+ /* IEEE Float 128-bit uses one vector register. */ -+ n_regs = 1; -+ -+ else if (field_type->code () == TYPE_CODE_FLT -+ || field_type->code () == TYPE_CODE_DECFLOAT) -+ n_regs = (TYPE_LENGTH (field_type) + 7) >> 3; -+ -+ else -+ n_regs = 1; - - /* The ELFv2 ABI allows homogeneous aggregates to occupy - up to 8 registers. */ -@@ -1422,7 +1439,16 @@ ppc64_sysv_abi_push_param (struct gdbarch *gdbarch, - ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); - - if (type->code () == TYPE_CODE_FLT -- || type->code () == TYPE_CODE_DECFLOAT) -+ && TYPE_LENGTH (type) == 16 -+ && (gdbarch_long_double_format (gdbarch) -+ == floatformats_ia64_quad)) -+ { -+ /* IEEE FLOAT128, args in vector registers. */ -+ ppc64_sysv_abi_push_val (gdbarch, val, TYPE_LENGTH (type), 0, argpos); -+ ppc64_sysv_abi_push_vreg (gdbarch, val, argpos); -+ } -+ else if (type->code () == TYPE_CODE_FLT -+ || type->code () == TYPE_CODE_DECFLOAT) - { - /* Floating-point scalars are passed in floating-point registers. */ - ppc64_sysv_abi_push_val (gdbarch, val, TYPE_LENGTH (type), 0, argpos); -@@ -1494,14 +1520,22 @@ ppc64_sysv_abi_push_param (struct gdbarch *gdbarch, - single floating-point value, at any level of nesting of - single-member structs, are passed in floating-point registers. */ - if (type->code () == TYPE_CODE_STRUCT -- && type->num_fields () == 1) -+ && type->num_fields () == 1 && tdep->elf_abi == POWERPC_ELF_V1) - { - while (type->code () == TYPE_CODE_STRUCT - && type->num_fields () == 1) - type = check_typedef (type->field (0).type ()); - -- if (type->code () == TYPE_CODE_FLT) -- ppc64_sysv_abi_push_freg (gdbarch, type, val, argpos); -+ if (type->code () == TYPE_CODE_FLT) { -+ /* Handle the case of 128-bit floats for both IEEE and IBM long double -+ formats. */ -+ if (TYPE_LENGTH (type) == 16 -+ && (gdbarch_long_double_format (gdbarch) -+ == floatformats_ia64_quad)) -+ ppc64_sysv_abi_push_vreg (gdbarch, val, argpos); -+ else -+ ppc64_sysv_abi_push_freg (gdbarch, type, val, argpos); -+ } - } - - /* In the ELFv2 ABI, homogeneous floating-point or vector -@@ -1511,13 +1545,23 @@ ppc64_sysv_abi_push_param (struct gdbarch *gdbarch, - struct type *eltype; - int i, nelt; - -- if (ppc64_elfv2_abi_homogeneous_aggregate (type, &eltype, &nelt)) -+ if (ppc64_elfv2_abi_homogeneous_aggregate (type, &eltype, &nelt, -+ gdbarch)) - for (i = 0; i < nelt; i++) - { - const gdb_byte *elval = val + i * TYPE_LENGTH (eltype); - - if (eltype->code () == TYPE_CODE_FLT -- || eltype->code () == TYPE_CODE_DECFLOAT) -+ && TYPE_LENGTH (eltype) == 16 -+ && (gdbarch_long_double_format (gdbarch) -+ == floatformats_ia64_quad)) -+ /* IEEE FLOAT128, args in vector registers. */ -+ ppc64_sysv_abi_push_vreg (gdbarch, elval, argpos); -+ -+ else if (eltype->code () == TYPE_CODE_FLT -+ || eltype->code () == TYPE_CODE_DECFLOAT) -+ /* IBM long double and all other floats and decfloats, args -+ are in a pair of floating point registers. */ - ppc64_sysv_abi_push_freg (gdbarch, eltype, elval, argpos); - else if (eltype->code () == TYPE_CODE_ARRAY - && eltype->is_vector () -@@ -1871,10 +1915,16 @@ ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype, - return 1; - } - -- /* AltiVec vectors are returned in VRs starting at v2. */ -+ /* AltiVec vectors are returned in VRs starting at v2. -+ IEEE FLOAT 128-bit are stored in vector register. */ -+ - if (TYPE_LENGTH (valtype) == 16 -- && valtype->code () == TYPE_CODE_ARRAY && valtype->is_vector () -- && tdep->vector_abi == POWERPC_VEC_ALTIVEC) -+ && ((valtype->code () == TYPE_CODE_ARRAY -+ && valtype->is_vector () -+ && tdep->vector_abi == POWERPC_VEC_ALTIVEC) -+ || (valtype->code () == TYPE_CODE_FLT -+ && (gdbarch_long_double_format (gdbarch) -+ == floatformats_ia64_quad)))) - { - int regnum = tdep->ppc_vr0_regnum + 2 + index; - -@@ -2012,7 +2062,8 @@ ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct value *function, - /* In the ELFv2 ABI, homogeneous floating-point or vector - aggregates are returned in registers. */ - if (tdep->elf_abi == POWERPC_ELF_V2 -- && ppc64_elfv2_abi_homogeneous_aggregate (valtype, &eltype, &nelt) -+ && ppc64_elfv2_abi_homogeneous_aggregate (valtype, &eltype, &nelt, -+ gdbarch) - && (eltype->code () == TYPE_CODE_FLT - || eltype->code () == TYPE_CODE_DECFLOAT - || (eltype->code () == TYPE_CODE_ARRAY diff --git a/powerpc-correct-the-gdb-ioctl-values-for-tcgets-tcsets-tcsetsw-and-tcsetsf.patch b/powerpc-correct-the-gdb-ioctl-values-for-tcgets-tcsets-tcsetsw-and-tcsetsf.patch deleted file mode 100644 index 0c25a3c..0000000 --- a/powerpc-correct-the-gdb-ioctl-values-for-tcgets-tcsets-tcsetsw-and-tcsetsf.patch +++ /dev/null @@ -1,66 +0,0 @@ -PowerPC, correct the gdb ioctl values for TCGETS, TCSETS, TCSETSW and TCSETSF. - -Some of the ioctl numbers are based on the size of kernel termios structure. -Currently the PowerPC GDB definitions are "hard coded" into the ioctl -number. - -The current PowerPC values for TCGETS, TCSETS, TCSETSW and TCSETSF are -defined in gdb/ppc-linux-tdep.c as: - - record_tdep->ioctl_TCGETS = 0x403c7413; - record_tdep->ioctl_TCSETS = 0x803c7414; - record_tdep->ioctl_TCSETSW = 0x803c7415; - record_tdep->ioctl_TCSETSF = 0x803c7416; - -Where the termios structure size is in hex digits [5:4] as 0x3c. - -The definition for the PowerPC termios structure is given in: - arch/powerpc/include/uapi/asm/termbits.h - -The size of the termios data structure in this file is 0x2c not 0x3c. - -This patch changes the hex digits for the size of the PowerPC termios size -in the ioctl values for TCGETS, TCSETS, TCSETSW and TCSETSF to 0x2c. -This patch also changes the hard coding to generate the number based on a -it easier to update the ioctl numbers. - ---- - gdb/ppc-linux-tdep.c | 14 ++++++++++---- - 1 file changed, 10 insertions(+), 4 deletions(-) - -diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c -index 0b165fe2ca3..2881fcda71d 100644 ---- a/gdb/ppc-linux-tdep.c -+++ b/gdb/ppc-linux-tdep.c -@@ -1738,6 +1738,11 @@ static void - ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep, - int wordsize) - { -+ /* The values for TCGETS, TCSETS, TCSETSW, TCSETSF are based on the -+ size of struct termios in the kernel source. -+ include/uapi/asm-generic/termbits.h */ -+#define SIZE_OF_STRUCT_TERMIOS 0x2c -+ - /* Simply return if it had been initialized. */ - if (record_tdep->size_pointer != 0) - return; -@@ -1899,14 +1904,15 @@ ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep, - /* These values are the second argument of system call "sys_ioctl". - They are obtained from Linux Kernel source. - See arch/powerpc/include/uapi/asm/ioctls.h. */ -- record_tdep->ioctl_TCGETS = 0x403c7413; -- record_tdep->ioctl_TCSETS = 0x803c7414; -- record_tdep->ioctl_TCSETSW = 0x803c7415; -- record_tdep->ioctl_TCSETSF = 0x803c7416; - record_tdep->ioctl_TCGETA = 0x40147417; - record_tdep->ioctl_TCSETA = 0x80147418; - record_tdep->ioctl_TCSETAW = 0x80147419; - record_tdep->ioctl_TCSETAF = 0x8014741c; -+ record_tdep->ioctl_TCGETS = 0x40007413 | (SIZE_OF_STRUCT_TERMIOS << 16); -+ record_tdep->ioctl_TCSETS = 0x80007414 | (SIZE_OF_STRUCT_TERMIOS << 16); -+ record_tdep->ioctl_TCSETSW = 0x80007415 | (SIZE_OF_STRUCT_TERMIOS << 16); -+ record_tdep->ioctl_TCSETSF = 0x80007416 | (SIZE_OF_STRUCT_TERMIOS << 16); -+ - record_tdep->ioctl_TCSBRK = 0x2000741d; - record_tdep->ioctl_TCXONC = 0x2000741e; - record_tdep->ioctl_TCFLSH = 0x2000741f; diff --git a/powerpc-fix-for-gdb.base-eh_return.exp.patch b/powerpc-fix-for-gdb.base-eh_return.exp.patch deleted file mode 100644 index e51b4f0..0000000 --- a/powerpc-fix-for-gdb.base-eh_return.exp.patch +++ /dev/null @@ -1,72 +0,0 @@ -PowerPC: fix for gdb.base/eh_return.exp - -Disable the Traceback Table generation on PowerPC for this test. The -Traceback Table consists of a series of bit fields to indicate things like -the Traceback Table version, language, and specific information about the -function. The Traceback Table is generated following the end of the code -for every function by default. The Traceback Table is defined in the -PowerPC ELF ABI and is intended to support debuggers and exception -handlers. The Traceback Table is displayed in the disassembly of functions -by default and is part of the function length. The table is typically -interpreted by the disassembler as data represented by .long xxx entries. - -Generation of the Traceback Table is disabled in this test using the -PowerPC specific gcc compiler option -mtraceback=no, the xlc option -additional_flags-qtable=none and the clang optons - -mllvm -xcoff-traceback-table=false. Disabling the Traceback Table -generation in this test results in the gdb_test_multiple statement -correctly locating the address of the bclr instruction before the statement -"End of assembler dump." in the disassembly output. - ---- - gdb/testsuite/gdb.base/eh_return.exp | 36 +++++++++++++++++++++++++++++++++++- - 1 file changed, 35 insertions(+), 1 deletion(-) - -diff --git a/gdb/testsuite/gdb.base/eh_return.exp b/gdb/testsuite/gdb.base/eh_return.exp -index df55dbc72da..6e4b9bd0bba 100644 ---- a/gdb/testsuite/gdb.base/eh_return.exp -+++ b/gdb/testsuite/gdb.base/eh_return.exp -@@ -18,8 +18,42 @@ - - standard_testfile - -+# Set compiler flags. -+if {[istarget "powerpc*"]} then { -+ # PowerPC generates a Traceback Table, as defined in the PPC64 ABI, -+ # following each function by default. The Traceback Table information is -+ # typically interpreted by the disassembler as data represented with -+ # .long xxxx following the last instruction in the function. For example: -+ # -+ # Dump of assembler code for function eh2: -+ # 0x00000000100009e0 <+0>: lis r2,4098 -+ # ... -+ # 0x0000000010000b04 <+292>: add r1,r1,r10 -+ # 0x0000000010000b08 <+296>: blr -+ # 0x0000000010000b0c <+300>: .long 0x0 -+ # 0x0000000010000b10 <+304>: .long 0x1000000 -+ # 0x0000000010000b14 <+308>: .long 0x1000180 -+ # End of assembler dump. -+ # -+ # Disable the Traceback Table generation, using the PowerPC specific -+ # compiler option, so the test gdb_test_multiple "disassemble eh2" will -+ # locate the address of the blr instruction not the last .long statement. -+ if { [test_compiler_info "gcc-*"] } { -+ set compile_flags {debug nopie additional_flags=-mtraceback=no} -+ } elseif { [test_compiler_info "xlc-*"] } { -+ set compile_flags {debug nopie additional_flags=-qtbtable=none} -+ } elseif { [test_compiler_info "clang-*"] } { -+ set compile_flags [list debug nopie additional_flags=-mllvm \ -+ additional_flags=-xcoff-traceback-table=false] -+ } else { -+ set compile_flags {debug nopie } -+ } -+} else { -+ set compile_flags {debug nopie} -+} -+ - if {[prepare_for_testing "failed to prepare" $testfile $srcfile \ -- {debug nopie}]} { -+ $compile_flags]} { - return -1 - } - diff --git a/powerpc-fix-for-gdb.reverse-finish-precsave.exp-and-.patch b/powerpc-fix-for-gdb.reverse-finish-precsave.exp-and-.patch new file mode 100644 index 0000000..5818eca --- /dev/null +++ b/powerpc-fix-for-gdb.reverse-finish-precsave.exp-and-.patch @@ -0,0 +1,498 @@ +From 338e9f159a818a3f565af96ace486781c450bd00 Mon Sep 17 00:00:00 2001 +From: Carl Love +Date: Thu, 9 Mar 2023 16:10:18 -0500 +Subject: [PATCH 5/9] PowerPC: fix for gdb.reverse/finish-precsave.exp and + gdb.reverse/finish-reverse.exp + +PPC64 multiple entry points, a normal entry point and an alternate entry +point. The alternate entry point is to setup the Table of Contents (TOC) +register before continuing at the normal entry point. When the TOC is +already valid, the normal entry point is used, this is typically the case. +The alternate entry point is typically referred to as the global entry +point (GEP) in IBM. The normal entry point is typically referred to as +the local entry point (LEP). + +When GDB is executing the finish command in reverse, the function +finish_backward currently sets the break point at the alternate entry point. +This issue is if the function, when executing in the forward direction, +entered the function via the normal entry point, execution in the reverse +direction will never sees the break point at the alternate entry point. In +this case, the reverse execution continues until the next break point is +encountered thus stopping at the wrong place. + +This patch adds a new address to struct execution_control_state to hold the +address of the alternate entry point (GEP). The finish_backwards function +is updated, if the stopping point is between the normal entry point (LEP) +and the end of the function, a breakpoint is set at the normal entry point. +If the stopping point is between the entry points, a breakpoint is set at +the alternate entry point. This ensures that GDB will always stop at the +normal entry point. If the function did enter via the alternate entry +point, GDB will detect that and continue to execute backwards in the +function until the alternate entry point is reached. + +The patch fixes the behavior of the reverse-finish command on PowerPC to +match the behavior of the command on other platforms, specifically X86. +The patch does not change the behavior of the command on X86. + +A new test is added to verify the reverse-finish command on PowerPC +correctly stops at the instruction where the function call is made. + +The patch fixes 11 regression errors in test gdb.reverse/finish-precsave.exp +and 11 regression errors in test gdb.reverse/finish-reverse.exp. + +The patch has been tested on Power 10 and X86 processor with no new +regression failures. +--- + gdb/infcmd.c | 32 ++- + gdb/infrun.c | 24 ++ + .../gdb.reverse/finish-reverse-next.c | 91 +++++++ + .../gdb.reverse/finish-reverse-next.exp | 224 ++++++++++++++++++ + 4 files changed, 362 insertions(+), 9 deletions(-) + create mode 100644 gdb/testsuite/gdb.reverse/finish-reverse-next.c + create mode 100644 gdb/testsuite/gdb.reverse/finish-reverse-next.exp + +diff --git a/gdb/infcmd.c b/gdb/infcmd.c +index 0ddc541e787..313fe2e025e 100644 +--- a/gdb/infcmd.c ++++ b/gdb/infcmd.c +@@ -1714,6 +1714,10 @@ finish_backward (struct finish_command_fsm *sm) + struct thread_info *tp = inferior_thread (); + CORE_ADDR pc; + CORE_ADDR func_addr; ++ CORE_ADDR alt_entry_point = sal.pc; ++ CORE_ADDR entry_point = alt_entry_point; ++ frame_info_ptr frame = get_selected_frame (nullptr); ++ struct gdbarch *gdbarch = get_frame_arch (frame); + + pc = get_frame_pc (get_current_frame ()); + +@@ -1722,6 +1726,15 @@ finish_backward (struct finish_command_fsm *sm) + + sal = find_pc_line (func_addr, 0); + ++ if (gdbarch_skip_entrypoint_p (gdbarch)) ++ /* Some architectures, like PowerPC use local and global entry points. ++ There is only one Entry Point (GEP = LEP) for other architectures. ++ The GEP is an alternate entry point. The LEP is the normal entry point. ++ The value of entry_point was initialized to the alternate entry point ++ (GEP). It will be adjusted to the normal entry point if the function ++ has two entry points. */ ++ entry_point = gdbarch_skip_entrypoint (gdbarch, sal.pc); ++ + tp->control.proceed_to_finish = 1; + /* Special case: if we're sitting at the function entry point, + then all we need to do is take a reverse singlestep. We +@@ -1732,15 +1745,12 @@ finish_backward (struct finish_command_fsm *sm) + no way that a function up the stack can have a return address + that's equal to its entry point. */ + +- if (sal.pc != pc) ++ if ((pc < alt_entry_point) || (pc > entry_point)) + { +- frame_info_ptr frame = get_selected_frame (nullptr); +- struct gdbarch *gdbarch = get_frame_arch (frame); +- +- /* Set a step-resume at the function's entry point. Once that's +- hit, we'll do one more step backwards. */ ++ /* We are in the body of the function. Set a breakpoint to go back to ++ the normal entry point. */ + symtab_and_line sr_sal; +- sr_sal.pc = sal.pc; ++ sr_sal.pc = entry_point; + sr_sal.pspace = get_frame_program_space (frame); + insert_step_resume_breakpoint_at_sal (gdbarch, + sr_sal, null_frame_id); +@@ -1749,8 +1759,12 @@ finish_backward (struct finish_command_fsm *sm) + } + else + { +- /* We're almost there -- we just need to back up by one more +- single-step. */ ++ /* We are either at one of the entry points or between the entry points. ++ If we are not at the alt_entry point, go back to the alt_entry_point ++ If we at the normal entry point step back one instruction, when we ++ stop we will determine if we entered via the entry point or the ++ alternate entry point. If we are at the alternate entry point, ++ single step back to the function call. */ + tp->control.step_range_start = tp->control.step_range_end = 1; + proceed ((CORE_ADDR) -1, GDB_SIGNAL_DEFAULT); + } +diff --git a/gdb/infrun.c b/gdb/infrun.c +index d5f97e33625..9c1b1f04e4d 100644 +--- a/gdb/infrun.c ++++ b/gdb/infrun.c +@@ -1868,6 +1868,7 @@ struct execution_control_state + + struct target_waitstatus ws; + int stop_func_filled_in = 0; ++ CORE_ADDR stop_func_alt_start = 0; + CORE_ADDR stop_func_start = 0; + CORE_ADDR stop_func_end = 0; + const char *stop_func_name = nullptr; +@@ -4680,6 +4681,11 @@ fill_in_stop_func (struct gdbarch *gdbarch, + ecs->stop_func_start + += gdbarch_deprecated_function_start_offset (gdbarch); + ++ /* PowerPC functions have a Local Entry Point (LEP) and a Global ++ Entry Point (GEP). There is only one Entry Point (GEP = LEP) for ++ other architectures. */ ++ ecs->stop_func_alt_start = ecs->stop_func_start; ++ + if (gdbarch_skip_entrypoint_p (gdbarch)) + ecs->stop_func_start + = gdbarch_skip_entrypoint (gdbarch, ecs->stop_func_start); +@@ -7269,6 +7275,24 @@ process_event_stop_test (struct execution_control_state *ecs) + } + } + ++ if (execution_direction == EXEC_REVERSE ++ && ecs->event_thread->control.proceed_to_finish ++ && ecs->event_thread->stop_pc () >= ecs->stop_func_alt_start ++ && ecs->event_thread->stop_pc () < ecs->stop_func_start) ++ { ++ /* We are executing the reverse-finish command. ++ If the system supports multiple entry points and we are finishing a ++ function in reverse. If we are between the entry points singe-step ++ back to the alternate entry point. If we are at the alternate entry ++ point -- just need to back up by one more single-step, which ++ should take us back to the function call. */ ++ ecs->event_thread->control.step_range_start ++ = ecs->event_thread->control.step_range_end = 1; ++ keep_going (ecs); ++ return; ++ ++ } ++ + if (ecs->event_thread->control.step_range_end == 1) + { + /* It is stepi or nexti. We always want to stop stepping after +diff --git a/gdb/testsuite/gdb.reverse/finish-reverse-next.c b/gdb/testsuite/gdb.reverse/finish-reverse-next.c +new file mode 100644 +index 00000000000..e95ee8e33a6 +--- /dev/null ++++ b/gdb/testsuite/gdb.reverse/finish-reverse-next.c +@@ -0,0 +1,91 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2012-2023 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 . */ ++ ++/* The reverse finish command should return from a function and stop on ++ the first instruction of the source line where the function call is made. ++ Specifically, the behavior should match doing a reverse next from the ++ first instruction in the function. GDB should only require one reverse ++ step or next statement to reach the previous source code line. ++ ++ This test verifies the fix for gdb bugzilla: ++ ++ https://sourceware.org/bugzilla/show_bug.cgi?id=29927 ++ ++ PowerPC supports two entry points to a function. The normal entry point ++ is called the local entry point (LEP). The alternate entry point is called ++ the global entry point (GEP). The GEP is only used if the table of ++ contents (TOC) value stored in register r2 needs to be setup prior to ++ execution starting at the LEP. A function call via a function pointer ++ will entry via the GEP. A normal function call will enter via the LEP. ++ ++ This test has been expanded to include tests to verify the reverse-finish ++ command works properly if the function is called via the GEP. The original ++ test only verified the reverse-finish command for a normal call that used ++ the LEP. */ ++ ++int ++function2 (int a, int b) ++{ ++ int ret = 0; ++ ret = ret + a + b; ++ return ret; ++} ++ ++int ++function1 (int a, int b) // FUNCTION1 ++{ ++ int ret = 0; ++ int (*funp) (int, int) = &function2; ++ /* The assembly code for this function when compiled for PowerPC is as ++ follows: ++ ++ 0000000010000758 : ++ 10000758: 02 10 40 3c lis r2,4098 <- GEP ++ 1000075c: 00 7f 42 38 addi r2,r2,32512 ++ 10000760: a6 02 08 7c mflr r0 <- LEP ++ 10000764: 10 00 01 f8 std r0,16(r1) ++ .... ++ ++ When the function is called on PowerPC with function1 (a, b) the call ++ enters at the Local Entry Point (LEP). When the function is called via ++ a function pointer, the Global Entry Point (GEP) for function1 is used. ++ The GEP sets up register 2 before reaching the LEP. ++ */ ++ ret = funp (a + 1, b + 2); ++ return ret; ++} ++ ++int ++main(int argc, char* argv[]) ++{ ++ int a, b; ++ int (*funp) (int, int) = &function1; ++ ++ /* Call function via Local Entry Point (LEP). */ ++ ++ a = 1; ++ b = 5; ++ ++ function1 (a, b); // CALL VIA LEP ++ ++ /* Call function via Global Entry Point (GEP). */ ++ a = 10; ++ b = 50; ++ ++ funp (a, b); // CALL VIA GEP ++ return 0; ++} +diff --git a/gdb/testsuite/gdb.reverse/finish-reverse-next.exp b/gdb/testsuite/gdb.reverse/finish-reverse-next.exp +new file mode 100644 +index 00000000000..1f53b649a7d +--- /dev/null ++++ b/gdb/testsuite/gdb.reverse/finish-reverse-next.exp +@@ -0,0 +1,224 @@ ++# Copyright 2008-2023 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 . */ ++ ++# This file is part of the GDB testsuite. It tests reverse stepping. ++# Lots of code borrowed from "step-test.exp". ++ ++# The reverse finish command should return from a function and stop on ++# the first instruction of the source line where the function call is made. ++# Specifically, the behavior should match doing a reverse next from the ++# first instruction in the function. GDB should only take one reverse step ++# or next statement to reach the previous source code line. ++ ++# This testcase verifies the reverse-finish command stops at the first ++# instruction in the source code line where the function was called. There ++# are two scenarios that must be checked: ++# 1) gdb is at the entry point instruction for the function ++# 2) gdb is in the body of the function. ++ ++# This test verifies the fix for gdb bugzilla: ++# https://sourceware.org/bugzilla/show_bug.cgi?id=29927 ++ ++# PowerPC supports two entry points to a function. The normal entry point ++# is called the local entry point (LEP). The alternate entry point is called ++# the global entry point (GEP). A function call via a function pointer ++# will entry via the GEP. A normal function call will enter via the LEP. ++# ++# This test has been expanded to include tests to verify the reverse-finish ++# command works properly if the function is called via the GEP. The original ++# test only verified the reverse-finish command for a normal call that used ++# the LEP. ++ ++if ![supports_reverse] { ++ return ++} ++ ++standard_testfile ++ ++if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } { ++ return -1 ++} ++ ++runto_main ++set target_remote [gdb_is_target_remote] ++ ++if [supports_process_record] { ++ # Activate process record/replay. ++ gdb_test_no_output "record" "turn on process record for test1" ++} ++ ++ ++### TEST 1: reverse finish from the entry point instruction (LEP) in ++### function1 when called using the normal entry point (LEP). ++ ++# Set breakpoint at call to function1 in main. ++set bp_LEP_test [gdb_get_line_number "CALL VIA LEP" $srcfile] ++gdb_breakpoint $srcfile:$bp_LEP_test temporary ++ ++# Continue to break point at function1 call in main. ++gdb_continue_to_breakpoint \ ++ "stopped at function1 entry point instruction to stepi into function" \ ++ ".*$srcfile:$bp_LEP_test\r\n.*" ++ ++# stepi until we see "{" indicating we entered function1 ++repeat_cmd_until "stepi" "CALL VIA LEP" "{" "stepi into function1 call" "100" ++ ++# The reverse-finish command should stop on the function call instruction ++# which is the last instruction in the source code line. A reverse-next ++# instruction should then stop at the first instruction in the same source ++# code line. Another revers-next instruction stops at the previous source ++# code line. ++gdb_test "reverse-finish" ".*function1 \\(a, b\\); // CALL VIA LEP.*" \ ++ "reverse-finish function1 LEP call from LEP " ++gdb_test "reverse-next" ".*function1 \\(a, b\\); // CALL VIA LEP" \ ++ "reverse next 1 LEP entry point function call from LEP" ++gdb_test "reverse-next" ".*b = 5;.*" "reverse next 2, at b = 5, call from LEP" ++ ++ ++gdb_test "reverse-continue" ".*" "setup for test 2" ++ ++# Turn off record to clear logs and turn on again ++gdb_test "record stop" "Process record is stopped.*" \ ++ "turn off process record for test1" ++gdb_test_no_output "record" "turn on process record for test2" ++ ++ ++### TEST 2: reverse finish from the body of function1. ++ ++# Set breakpoint at call to function1 in main. ++gdb_breakpoint $srcfile:$bp_LEP_test temporary ++ ++# Continue to break point at function1 call in main. ++gdb_continue_to_breakpoint \ ++ "at function1 entry point instruction to step to body of function" \ ++ ".*$srcfile:$bp_LEP_test\r\n.*" ++ ++# do a step instruction to get to the body of the function ++gdb_test "step" ".*int ret = 0;.*" "step test 1" ++ ++# The reverse-finish command should stop on the function call instruction ++# which is the last instruction in the source code line. A reverse-next ++# instruction should then stop at the first instruction in the same source ++# code line. Another revers-next instruction stops at the previous source ++# code line. ++gdb_test "reverse-finish" ".*function1 \\(a, b\\); // CALL VIA LEP.*" \ ++ "reverse-finish function1 LEP call from function body" ++gdb_test "reverse-next" ".*function1 \\(a, b\\); // CALL VIA LEP.*" \ ++ "reverse next 1 LEP from function body" ++gdb_test "reverse-next" ".*b = 5;.*" \ ++ "reverse next 2 at b = 5, from function body" ++ ++gdb_test "reverse-continue" ".*" "setup for test 3" ++ ++# Turn off record to clear logs and turn on again ++gdb_test "record stop" "Process record is stopped.*" \ ++ "turn off process record for test2" ++gdb_test_no_output "record" "turn on process record for test3" ++ ++ ++### TEST 3: reverse finish from the alternate entry point instruction (GEP) in ++### function1 when called using the alternate entry point (GEP). ++ ++# Set breakpoint at call to funp in main. ++set bp_GEP_test [gdb_get_line_number "CALL VIA GEP" $srcfile] ++gdb_breakpoint $srcfile:$bp_GEP_test temporary ++ ++# Continue to break point at funp call in main. ++gdb_continue_to_breakpoint \ ++ "stopped at function1 entry point instruction to stepi into funp" \ ++ ".*$srcfile:$bp_GEP_test\r\n.*" ++ ++# stepi until we see "{" indicating we entered function. ++repeat_cmd_until "stepi" "CALL VIA GEP" "{" "stepi into funp call" ++ ++# The reverse-finish command should stop on the function call instruction ++# which is the last instruction in the source code line. A reverse-next ++# instruction should then stop at the first instruction in the same source ++# code line. Another revers-next instruction stops at the previous source ++# code line. ++gdb_test "reverse-finish" ".*funp \\(a, b\\);.*" \ ++ "function1 GEP call call from GEP" ++gdb_test "reverse-next" ".*funp \\(a, b\\);.*" \ ++ "reverse next 1 GEP entry point function call from GEP" ++gdb_test "reverse-next" ".*b = 50;.*" "reverse next 2 at b = 50, call from GEP" ++ ++gdb_test "reverse-continue" ".*" "setup for test 4" ++ ++# Turn off record to clear logs and turn on again ++gdb_test "record stop" "Process record is stopped.*" \ ++ "turn off process record for test3" ++gdb_test_no_output "record" "turn on process record for test4" ++ ++### TEST 4: reverse finish from between the GEP and LEP in ++### function1 when called using the alternate entry point (GEP). ++ ++# Set breakpoint at call to funp in main. ++set bp_GEP_test [gdb_get_line_number "CALL VIA GEP" $srcfile] ++gdb_breakpoint $srcfile:$bp_GEP_test temporary ++ ++# Continue to break point at funp call in main. ++gdb_continue_to_breakpoint \ ++ "stopped at function1 entry point instruction to stepi into funp again" \ ++ ".*$srcfile:$bp_GEP_test\r\n.*" ++ ++# stepi until we see "{" indicating we entered function. ++repeat_cmd_until "stepi" "CALL VIA GEP" "{" "stepi into funp call again" ++ ++# do one more stepi so we are between the GEP and LEP. ++gdb_test "stepi" "{" "stepi to between GEP and LEP" ++ ++# The reverse-finish command should stop on the function call instruction ++# which is the last instruction in the source code line. A reverse-next ++# instruction should then stop at the first instruction in the same source ++# code line. Another revers-next instruction stops at the previous source ++# code line. ++gdb_test "reverse-finish" ".*funp \\(a, b\\);.*" \ ++ "function1 GEP call call from GEP again" ++gdb_test "reverse-next" ".*funp \\(a, b\\);.*" \ ++ "reverse next 1 GEP entry point function call from GEP again" ++gdb_test "reverse-next" ".*b = 50;.*" \ ++ "reverse next 2 at b = 50, call from GEP again" ++ ++gdb_test "reverse-continue" ".*" "setup for test 5" ++ ++# Turn off record to clear logs and turn on again ++gdb_test "record stop" "Process record is stopped.*" \ ++ "turn off process record for test4" ++gdb_test_no_output "record" "turn on process record for test5" ++ ++ ++### TEST 5: reverse finish from the body of function 1 when calling using the ++### alternate entrypoint (GEP). ++gdb_breakpoint $srcfile:$bp_GEP_test temporary ++ ++# Continue to break point at funp call. ++gdb_continue_to_breakpoint \ ++ "at function1 entry point instruction to step to body of funp call" \ ++ ".*$srcfile:$bp_GEP_test\r\n.*" ++ ++# Step into body of funp, called via GEP. ++gdb_test "step" ".*int ret = 0;.*" "step test 2" ++ ++# The reverse-finish command should stop on the function call instruction ++# which is the last instruction in the source code line. A reverse-next ++# instruction should then stop at the first instruction in the same source ++# code line. Another revers-next instruction stops at the previous source ++# code line. ++gdb_test "reverse-finish" ".*funp \\(a, b\\);.*" \ ++ "reverse-finish function1 GEP call, from function body " ++gdb_test "reverse-next" ".*funp \\(a, b\\);.*" \ ++ "reverse next 1 GEP call from function body" ++gdb_test "reverse-next" ".*b = 50;.*" \ ++ "reverse next 2 at b = 50 from function body" +-- +2.35.3 + diff --git a/powerpc-fix-gdb.base-watchpoint.exp-on-power-9.patch b/powerpc-fix-gdb.base-watchpoint.exp-on-power-9.patch deleted file mode 100644 index 548908b..0000000 --- a/powerpc-fix-gdb.base-watchpoint.exp-on-power-9.patch +++ /dev/null @@ -1,138 +0,0 @@ -PowerPC, fix gdb.base/watchpoint.exp on Power 9 - -Test gdb.base/watchpoint.exp generates 4 test errors on Power 9. The -test uses the test [target_info exists gdb,no_hardware_watchpoints] to -determine if the processor supports hardware watchpoints. The check -only examines the processor type to determine if it supports hardware -watchpoints. - -The PowerPC processors support hardware watchpoints with the -exception of Power 9. The hardware watchpoint support is disabled on -Power 9. The test skip_hw_watchpoint_tests must be used to correctly -determine if the PowerPC processor supports hardware watchpoints. - -This patch replaces the [target_info exists gdb,no_hardware_watchpoints] -with the skip_hw_watchpoint_tests_p check. With the patch, the test runs -on Power 9 with hardware watchpoint force-disabled. The test runs on -all other PowerPC processors with and without hardware watchpoints -enabled. - -The patch has been tested on Power 9 to verify the test only runs with -hardware breakpoints disabled. The patch has been tested on X86-64 with -no regression failures. The test fails on Power 10 due to an internal GDB -error due to resource management. The resource management issue will be -addressed in another patch. - ---- - gdb/testsuite/gdb.base/watchpoint.exp | 26 +++++++++++++++++++------- - 1 file changed, 19 insertions(+), 7 deletions(-) - -diff --git a/gdb/testsuite/gdb.base/watchpoint.exp b/gdb/testsuite/gdb.base/watchpoint.exp -index 377d3f9ff43..1916cd37cf5 100644 ---- a/gdb/testsuite/gdb.base/watchpoint.exp -+++ b/gdb/testsuite/gdb.base/watchpoint.exp -@@ -15,6 +15,13 @@ - - # This file was written by Fred Fish. (fnf@cygnus.com) - -+# The skip_hw_watchpoint_tests checks if watchpoints are supported by the -+# processor. On PowerPC, the check runs a small test program under gdb -+# to determine if the Power processor supports HW watchpoints. The check -+# must be done before starting the test so as to not disrupt the execution -+# of the actual test. -+ -+set skip_hw_watchpoint_tests_p [skip_hw_watchpoint_tests] - - standard_testfile - -@@ -628,13 +635,14 @@ proc test_watch_location {} { - proc test_wide_location_1 {} { - global no_hw - global gdb_prompt -+ global skip_hw_watchpoint_tests_p - - # This test watches two words on most 32-bit ABIs, and one word on - # most 64-bit ABIs. - - # Platforms where the target can't watch such a large region - # should clear hw_expected below. -- if { $no_hw || [target_info exists gdb,no_hardware_watchpoints] -+ if { $no_hw || $skip_hw_watchpoint_tests_p - || [istarget arm*-*-*] - || ([istarget powerpc*-*-*] && ![is_lp64_target])} { - set hw_expected 0 -@@ -675,13 +683,14 @@ proc test_wide_location_1 {} { - proc test_wide_location_2 {} { - global no_hw - global gdb_prompt -+ global skip_hw_watchpoint_tests_p - - # This test watches four words on most 32-bit ABIs, and two words - # on 64-bit ABIs. - - # Platforms where the target can't watch such a large region - # should clear hw_expected below. -- if { $no_hw || [target_info exists gdb,no_hardware_watchpoints] -+ if { $no_hw || $skip_hw_watchpoint_tests_p - || [istarget arm*-*-*] - || [istarget powerpc*-*-*]} { - set hw_expected 0 -@@ -798,6 +807,7 @@ proc test_inaccessible_watchpoint {} { - - proc test_no_hw_watchpoints {} { - global testfile -+ global skip_hw_watchpoint_tests_p - - clean_restart $testfile - -@@ -843,7 +853,7 @@ proc test_no_hw_watchpoints {} { - - - # Re-enable hardware watchpoints if necessary. -- if ![target_info exists gdb,no_hardware_watchpoints] { -+ if {!$skip_hw_watchpoint_tests_p} { - gdb_test_no_output "set can-use-hw-watchpoints 1" "" - } - } -@@ -895,8 +905,9 @@ proc test_watchpoint_in_big_blob {} { - - proc test_watch_register_location {} { - global no_hw -+ global skip_hw_watchpoint_tests_p - -- if {!$no_hw && ![target_info exists gdb,no_hardware_watchpoints]} { -+ if {!$no_hw && !$skip_hw_watchpoint_tests_p} { - # Non-memory read/access watchpoints are not supported, they would - # require software read/access watchpoint support (which is not - # currently available). -@@ -920,10 +931,11 @@ test_no_hw_watchpoints - proc do_tests {} { - global testfile - global no_hw -+ global skip_hw_watchpoint_tests_p - - clean_restart $testfile - -- if {$no_hw || [target_info exists gdb,no_hardware_watchpoints]} { -+ if {$no_hw || $skip_hw_watchpoint_tests_p} { - gdb_test_no_output "set can-use-hw-watchpoints 0" "" - } - -@@ -942,7 +954,7 @@ proc do_tests {} { - # `initialize' anymore. - clean_restart $testfile - -- if {$no_hw || [target_info exists gdb,no_hardware_watchpoints]} { -+ if {$no_hw || $skip_hw_watchpoint_tests_p} { - gdb_test_no_output "set can-use-hw-watchpoints 0" "" - } - -@@ -979,7 +991,7 @@ proc do_tests {} { - # watchpoints force-disabled. - - do_tests --if ![target_info exists gdb,no_hardware_watchpoints] { -+if {!$skip_hw_watchpoint_tests_p} { - with_test_prefix "no-hw" { - set no_hw 1 - do_tests diff --git a/powerpc-regression-fix-for-reverse-finish-command.patch b/powerpc-regression-fix-for-reverse-finish-command.patch new file mode 100644 index 0000000..228220a --- /dev/null +++ b/powerpc-regression-fix-for-reverse-finish-command.patch @@ -0,0 +1,74 @@ +From 64870827ac45e94375c3a217b9131de69fc5b753 Mon Sep 17 00:00:00 2001 +From: Carl Love +Date: Mon, 20 Mar 2023 16:59:33 -0400 +Subject: [PATCH 6/9] PowerPC: regression fix for reverse-finish command. + +The recent commit: + + commit 2a8339b71f37f2d02f5b2194929c9d702ef27223 + Author: Carl Love + Date: Thu Mar 9 16:10:18 2023 -0500 + + PowerPC: fix for gdb.reverse/finish-precsave.exp and gdb.reverse/finish-reverse.exp + + PPC64 multiple entry points, a normal entry point and an alternate entry + point. The alternate entry point is to setup the Table of Contents (TOC) + register before continuing at the normal entry point. When the TOC is + already valid, the normal entry point is used, this is typically the case. + The alternate entry point is typically referred to as the global entry + point (GEP) in IBM. The normal entry point is typically referred to as + the local entry point (LEP). + ..... + +Is causing regression failures on on PowerPC platforms. The regression +failures are in tests: + + gdb.reverse/finish-precsave.exp + gdb.btrace/tailcall.exp + gdb.mi/mi-reverse.exp + gdb.btrace/step.exp + gdb.reverse/until-precsave.exp + gdb.reverse/finish-reverse.exp + gdb.btrace/tailcall-only.exp + +The issue is in gdb/infcmd.c, function finish_command. The value of the +two new variables ALT_ENTRY_POINT and ENTRY_POINT are being initializezed +to SAL.PC. However, SAL has just been declared. The value of SAL.PC is +zero at this point. The intialization of ALT_ENTRY_POINT and ENTRY_POINT +needs to be after the initialization of SAL. + +This patch moves the initialization of ALT_ENTRY_POINT and ENTRY_POINT +variables to fix the regression failures. + +The patch has been tested on Power10 and on X86. +--- + gdb/infcmd.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/gdb/infcmd.c b/gdb/infcmd.c +index 313fe2e025e..d94dc0c059d 100644 +--- a/gdb/infcmd.c ++++ b/gdb/infcmd.c +@@ -1714,8 +1714,8 @@ finish_backward (struct finish_command_fsm *sm) + struct thread_info *tp = inferior_thread (); + CORE_ADDR pc; + CORE_ADDR func_addr; +- CORE_ADDR alt_entry_point = sal.pc; +- CORE_ADDR entry_point = alt_entry_point; ++ CORE_ADDR alt_entry_point; ++ CORE_ADDR entry_point; + frame_info_ptr frame = get_selected_frame (nullptr); + struct gdbarch *gdbarch = get_frame_arch (frame); + +@@ -1725,6 +1725,8 @@ finish_backward (struct finish_command_fsm *sm) + error (_("Cannot find bounds of current function")); + + sal = find_pc_line (func_addr, 0); ++ alt_entry_point = sal.pc; ++ entry_point = alt_entry_point; + + if (gdbarch_skip_entrypoint_p (gdbarch)) + /* Some architectures, like PowerPC use local and global entry points. +-- +2.35.3 + diff --git a/powerpc-update-expected-floating-point-output-for-gdb.arch-altivec-regs.exp-and-gdb.arch-vsx-regs.exp.patch b/powerpc-update-expected-floating-point-output-for-gdb.arch-altivec-regs.exp-and-gdb.arch-vsx-regs.exp.patch deleted file mode 100644 index cb158d9..0000000 --- a/powerpc-update-expected-floating-point-output-for-gdb.arch-altivec-regs.exp-and-gdb.arch-vsx-regs.exp.patch +++ /dev/null @@ -1,129 +0,0 @@ -PowerPC: Update expected floating point output for gdb.arch/altivec-regs.exp and gdb.arch/vsx-regs.exp - -The format for printing the floating point values was changed by commit: - - commit 56262a931b7ca8ee3ec9104bc7e9e0b40cf3d64e - Author: Tom Tromey - Date: Thu Feb 17 13:43:59 2022 -0700 - - Change how "print/x" displays floating-point value - - Currently, "print/x" will display a floating-point value by first - casting it to an integer type. This yields weird results like: - - (gdb) print/x 1.5 - $1 = 0x1 - ... - Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=16242 - -The above change results in 417 regression test failures since the expected -Power vector register output no longer match. - -This patch updates the expected Altivec floating point register prints to -the hexadecimal format for both big endian and little endian systems. The -patch also fixes a formatting isue with the decimal_vector expected value -assign statements. - -The expected VSX vector_register1, vector_register1_vr, vector_register2, -vector_register2_vr variables are updated to include the new float128 entry. -Additionally, the comment in the vsx expect file about the initialization -of the vs registers is updated. - -The patch has been tested on Power 10, Power 8 LE and Power 8 BE. - ---- - gdb/testsuite/gdb.arch/altivec-regs.exp | 8 ++++---- - gdb/testsuite/gdb.arch/vsx-regs.exp | 31 ++++++++++++++++--------------- - 2 files changed, 20 insertions(+), 19 deletions(-) - -diff --git a/gdb/testsuite/gdb.arch/altivec-regs.exp b/gdb/testsuite/gdb.arch/altivec-regs.exp -index 7bae979b984..d4c13afa8a1 100644 ---- a/gdb/testsuite/gdb.arch/altivec-regs.exp -+++ b/gdb/testsuite/gdb.arch/altivec-regs.exp -@@ -84,9 +84,9 @@ set endianness [get_endianness] - # b) the register read (below) also works. - - if {$endianness == "big"} { --set vector_register ".uint128 = 0x1000000010000000100000001, v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0x1, 0x1, 0x1, 0x1., v8_int16 = .0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1., v16_int8 = .0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1.." -+set vector_register ".uint128 = 0x1000000010000000100000001, v4_float = .0x1, 0x1, 0x1, 0x1., v4_int32 = .0x1, 0x1, 0x1, 0x1., v8_int16 = .0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1., v16_int8 = .0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1.." - } else { --set vector_register ".uint128 = 0x1000000010000000100000001, v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0x1, 0x1, 0x1, 0x1., v8_int16 = .0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0., v16_int8 = .0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0.." -+set vector_register ".uint128 = 0x1000000010000000100000001, v4_float = .0x1, 0x1, 0x1, 0x1., v4_int32 = .0x1, 0x1, 0x1, 0x1., v8_int16 = .0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0., v16_int8 = .0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0.." - } - - for {set i 0} {$i < 32} {incr i 1} { -@@ -104,9 +104,9 @@ gdb_test "info reg vscr" "vscr.*0x1\[ \t\]+1" "info reg vscr" - # the way gdb works. - - if {$endianness == "big"} { -- set decimal_vector ".uint128 = 79228162532711081671548469249, v4_float = .1.*e-45, 1.*e-45, 1.*e-45, 1.*e-45., v4_int32 = .1, 1, 1, 1., v8_int16 = .0, 1, 0, 1, 0, 1, 0, 1., v16_int8 = .0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1.." -+ set decimal_vector ".uint128 = 79228162532711081671548469249, v4_float = .1.*e-45, 1.*e-45, 1.*e-45, 1.*e-45., v4_int32 = .1, 1, 1, 1., v8_int16 = .0, 1, 0, 1, 0, 1, 0, 1., v16_int8 = .0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1.." - } else { -- set decimal_vector ".uint128 = 79228162532711081671548469249, v4_float = .1.*e-45, 1.*e-45, 1.*e-45, 1.*e-45., v4_int32 = .1, 1, 1, 1., v8_int16 = .1, 0, 1, 0, 1, 0, 1, 0., v16_int8 = .1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.." -+ set decimal_vector ".uint128 = 79228162532711081671548469249, v4_float = .1.*e-45, 1.*e-45, 1.*e-45, 1.*e-45., v4_int32 = .1, 1, 1, 1., v8_int16 = .1, 0, 1, 0, 1, 0, 1, 0., v16_int8 = .1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.." - } - - for {set i 0} {$i < 32} {incr i 1} { -diff --git a/gdb/testsuite/gdb.arch/vsx-regs.exp b/gdb/testsuite/gdb.arch/vsx-regs.exp -index 8b3841362fe..56fea796a9b 100644 ---- a/gdb/testsuite/gdb.arch/vsx-regs.exp -+++ b/gdb/testsuite/gdb.arch/vsx-regs.exp -@@ -61,29 +61,29 @@ set endianness [get_endianness] - # Data sets used throughout the test - - if {$endianness == "big"} { -- set vector_register1 ".uint128 = 0x3ff4cccccccccccd0000000000000000, v2_double = .0x1, 0x0., v4_float = .0x1, 0xf9999998, 0x0, 0x0., v4_int32 = .0x3ff4cccc, 0xcccccccd, 0x0, 0x0., v8_int16 = .0x3ff4, 0xcccc, 0xcccc, 0xcccd, 0x0, 0x0, 0x0, 0x0., v16_int8 = .0x3f, 0xf4, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcd, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0.." -+ set vector_register1 ".float128 = 0x3ff4cccccccccccd0000000000000000, uint128 = 0x3ff4cccccccccccd0000000000000000, v2_double = .0x3ff4cccccccccccd, 0x0., v4_float = .0x3ff4cccc, 0xcccccccd, 0x0, 0x0., v4_int32 = .0x3ff4cccc, 0xcccccccd, 0x0, 0x0., v8_int16 = .0x3ff4, 0xcccc, 0xcccc, 0xcccd, 0x0, 0x0, 0x0, 0x0., v16_int8 = .0x3f, 0xf4, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcd, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0.." - -- set vector_register1_vr ".uint128 = 0x3ff4cccccccccccd0000000100000001, v4_float = .0x1, 0xf9999998, 0x0, 0x0., v4_int32 = .0x3ff4cccc, 0xcccccccd, 0x1, 0x1., v8_int16 = .0x3ff4, 0xcccc, 0xcccc, 0xcccd, 0x0, 0x1, 0x0, 0x1., v16_int8 = .0x3f, 0xf4, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcd, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1.." -+ set vector_register1_vr ".uint128 = 0x3ff4cccccccccccd0000000100000001, v4_float = .0x3ff4cccc, 0xcccccccd, 0x1, 0x1., v4_int32 = .0x3ff4cccc, 0xcccccccd, 0x1, 0x1., v8_int16 = .0x3ff4, 0xcccc, 0xcccc, 0xcccd, 0x0, 0x1, 0x0, 0x1., v16_int8 = .0x3f, 0xf4, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcd, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1.." - -- set vector_register2 "uint128 = 0xdeadbeefdeadbeefdeadbeefdeadbeef, v2_double = .0x8000000000000000, 0x8000000000000000., v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef., v8_int16 = .0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef., v16_int8 = .0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef.." -+ set vector_register2 ".float128 = 0xdeadbeefdeadbeefdeadbeefdeadbeef, uint128 = 0xdeadbeefdeadbeefdeadbeefdeadbeef, v2_double = .0xdeadbeefdeadbeef, 0xdeadbeefdeadbeef., v4_float = .0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef., v4_int32 = .0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef., v8_int16 = .0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef., v16_int8 = .0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef.." - -- set vector_register2_vr "uint128 = 0xdeadbeefdeadbeefdeadbeefdeadbeef, v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef., v8_int16 = .0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef., v16_int8 = .0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef.." -+ set vector_register2_vr ".uint128 = 0xdeadbeefdeadbeefdeadbeefdeadbeef, v4_float = .0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef., v4_int32 = .0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef., v8_int16 = .0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef., v16_int8 = .0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef.." - -- set vector_register3 ".uint128 = 0x1000000010000000100000001, v2_double = .0x0, 0x0., v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0x1, 0x1, 0x1, 0x1., v8_int16 = .0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1., v16_int8 = .0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1.." -+ set vector_register3 ".float128 = 0x1000000010000000100000001, uint128 = 0x1000000010000000100000001, v2_double = .0x100000001, 0x100000001., v4_float = .0x1, 0x1, 0x1, 0x1., v4_int32 = .0x1, 0x1, 0x1, 0x1., v8_int16 = .0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1., v16_int8 = .0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1.." - -- set vector_register3_vr ".uint128 = 0x1000000010000000100000001, v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0x1, 0x1, 0x1, 0x1., v8_int16 = .0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1., v16_int8 = .0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1.." -+ set vector_register3_vr ".uint128 = 0x1000000010000000100000001, v4_float = .0x1, 0x1, 0x1, 0x1., v4_int32 = .0x1, 0x1, 0x1, 0x1., v8_int16 = .0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1., v16_int8 = .0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1.." - } else { -- set vector_register1 ".uint128 = 0x3ff4cccccccccccd0000000000000000, v2_double = .0x0, 0x1., v4_float = .0x0, 0x0, 0xf9999998, 0x1., v4_int32 = .0x0, 0x0, 0xcccccccd, 0x3ff4cccc., v8_int16 = .0x0, 0x0, 0x0, 0x0, 0xcccd, 0xcccc, 0xcccc, 0x3ff4., v16_int8 = .0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xcd, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xf4, 0x3f.." -+ set vector_register1 ".float128 = 0x3ff4cccccccccccd0000000000000000, uint128 = 0x3ff4cccccccccccd0000000000000000, v2_double = .0x0, 0x3ff4cccccccccccd., v4_float = .0x0, 0x0, 0xcccccccd, 0x3ff4cccc., v4_int32 = .0x0, 0x0, 0xcccccccd, 0x3ff4cccc., v8_int16 = .0x0, 0x0, 0x0, 0x0, 0xcccd, 0xcccc, 0xcccc, 0x3ff4., v16_int8 = .0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xcd, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xf4, 0x3f.." - -- set vector_register1_vr ".uint128 = 0x3ff4cccccccccccd0000000100000001, v4_float = .0x0, 0x0, 0xf9999998, 0x1., v4_int32 = .0x1, 0x1, 0xcccccccd, 0x3ff4cccc., v8_int16 = .0x1, 0x0, 0x1, 0x0, 0xcccd, 0xcccc, 0xcccc, 0x3ff4., v16_int8 = .0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0xcd, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xf4, 0x3f.." -+ set vector_register1_vr ".uint128 = 0x3ff4cccccccccccd0000000100000001, v4_float = .0x1, 0x1, 0xcccccccd, 0x3ff4cccc., v4_int32 = .0x1, 0x1, 0xcccccccd, 0x3ff4cccc., v8_int16 = .0x1, 0x0, 0x1, 0x0, 0xcccd, 0xcccc, 0xcccc, 0x3ff4., v16_int8 = .0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0xcd, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xf4, 0x3f.." - -- set vector_register2 "uint128 = 0xdeadbeefdeadbeefdeadbeefdeadbeef, v2_double = .0x8000000000000000, 0x8000000000000000., v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef., v8_int16 = .0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead., v16_int8 = .0xef, 0xbe, 0xad, 0xde, 0xef, 0xbe, 0xad, 0xde, 0xef, 0xbe, 0xad, 0xde, 0xef, 0xbe, 0xad, 0xde.." -+ set vector_register2 ".float128 = 0xdeadbeefdeadbeefdeadbeefdeadbeef, uint128 = 0xdeadbeefdeadbeefdeadbeefdeadbeef, v2_double = .0xdeadbeefdeadbeef, 0xdeadbeefdeadbeef., v4_float = .0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef., v4_int32 = .0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef., v8_int16 = .0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead., v16_int8 = .0xef, 0xbe, 0xad, 0xde, 0xef, 0xbe, 0xad, 0xde, 0xef, 0xbe, 0xad, 0xde, 0xef, 0xbe, 0xad, 0xde.." - -- set vector_register2_vr "uint128 = 0xdeadbeefdeadbeefdeadbeefdeadbeef, v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef., v8_int16 = .0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead., v16_int8 = .0xef, 0xbe, 0xad, 0xde, 0xef, 0xbe, 0xad, 0xde, 0xef, 0xbe, 0xad, 0xde, 0xef, 0xbe, 0xad, 0xde.." -+ set vector_register2_vr ".uint128 = 0xdeadbeefdeadbeefdeadbeefdeadbeef, v4_float = .0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef., v4_int32 = .0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef., v8_int16 = .0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead., v16_int8 = .0xef, 0xbe, 0xad, 0xde, 0xef, 0xbe, 0xad, 0xde, 0xef, 0xbe, 0xad, 0xde, 0xef, 0xbe, 0xad, 0xde.." - -- set vector_register3 ".uint128 = 0x1000000010000000100000001, v2_double = .0x0, 0x0., v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0x1, 0x1, 0x1, 0x1., v8_int16 = .0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0., v16_int8 = .0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0.." -+ set vector_register3 ".float128 = 0x1000000010000000100000001, uint128 = 0x1000000010000000100000001, v2_double = .0x100000001, 0x100000001., v4_float = .0x1, 0x1, 0x1, 0x1., v4_int32 = .0x1, 0x1, 0x1, 0x1., v8_int16 = .0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0., v16_int8 = .0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0.." - -- set vector_register3_vr ".uint128 = 0x1000000010000000100000001, v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0x1, 0x1, 0x1, 0x1., v8_int16 = .0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0., v16_int8 = .0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0.." -+ set vector_register3_vr ".uint128 = 0x1000000010000000100000001, v4_float = .0x1, 0x1, 0x1, 0x1., v4_int32 = .0x1, 0x1, 0x1, 0x1., v8_int16 = .0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0., v16_int8 = .0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0.." - } - - set float_register ".raw 0xdeadbeefdeadbeef." -@@ -93,12 +93,13 @@ set float_register ".raw 0xdeadbeefdeadbeef." - # after updates to F*. - # Since dl_main uses some VS* registers, and per inspection their values are - # no longer zero when our test reaches main(), we need to explicitly --# initialize the doubleword1 portions before we run our tests against --# values currently in those registers. -+# initialize the VS* registers before we run our tests against the values -+# currently in those registers. - --# 0: Initialize the (doubleword 1) portion of the VS0-VS31 registers. -+# 0: Initialize the (doubleword 0 and 1) portion of the VS0-VS31 registers. - for {set i 0} {$i < 32} {incr i 1} { - gdb_test_no_output "set \$vs$i.v2_double\[0\] = 0" -+ gdb_test_no_output "set \$vs$i.v2_double\[1\] = 0" - } - - # 1: Set F0~F31 registers and check if it reflects on VS0~VS31. diff --git a/qa-local.sh b/qa-local.sh index c9d1b3e..2723b07 100644 --- a/qa-local.sh +++ b/qa-local.sh @@ -1,5 +1,7 @@ #!/bin/sh +set -e + pwd=$(pwd -P) root=$pwd/tmp-qa-local @@ -15,6 +17,8 @@ SLE-12 SLE-11 " +version=13.2 + usage () { echo "usage: $0 <1-4>" @@ -100,16 +104,19 @@ case "$n" in if ! have_combo $arch $c; then continue fi - osc build \ - --clean \ - --no-verify \ - --trust-all-projects \ - --no-service \ - $c $arch \ - > $logs/$n/LOG.$c.$arch \ - 2>&1 + if osc build \ + --clean \ + --no-verify \ + --trust-all-projects \ + --no-service \ + $c $arch \ + > $logs/$n/LOG.$c.$arch \ + 2>&1; \ + st=$?; then + true + fi - if [ $? -eq 0 ]; then + if [ $st -eq 0 ]; then echo PASS: $c $arch else echo FAIL: $c $arch @@ -132,40 +139,46 @@ case "$n" in continue fi mkdir -p $pkgs/$c.$arch - osc build \ - --clean \ - --no-verify \ - --trust-all-projects \ - --no-service \ - -k $pkgs/$c.$arch \ - $c $arch \ - -M testsuite \ - > $logs/$n/LOG.$c.$arch \ - 2>&1 - if [ $? -eq 0 ]; then + if osc build \ + --clean \ + --no-verify \ + --trust-all-projects \ + --no-service \ + -k $pkgs/$c.$arch \ + $c $arch \ + -M testsuite \ + > $logs/$n/LOG.$c.$arch \ + 2>&1; \ + st=$?; then + true + fi + if [ $st -eq 0 ]; then ok=true else - ok=false - fi - - rpm=gdb-testresults-12.1-0.$arch.rpm - if [ -f $pkgs/$c.$arch/$rpm ]; then - ( - cd $pkgs/$c.$arch - extract gdb-testresults-12.1-0.$arch.rpm - ) - mv \ - $pkgs/$c.$arch/usr/share/doc/packages/gdb-testresults \ - $pkgs/gdb-testresults.$c.$arch - rm -Rf $pkgs/$c.$arch - else + reason="Build failed" ok=false fi if $ok; then - echo PASS: $c $arch + rpm=gdb-testresults-$version-0.$arch.rpm + if [ -f $pkgs/$c.$arch/$rpm ]; then + ( + cd $pkgs/$c.$arch + extract gdb-testresults-$version-0.$arch.rpm + ) + mv \ + $pkgs/$c.$arch/usr/share/doc/packages/gdb-testresults \ + $pkgs/gdb-testresults.$c.$arch + rm -Rf $pkgs/$c.$arch + else + ok=false + reason="Couldn't find $rpm" + fi + fi + if $ok; then + echo "PASS: $c $arch" else - echo FAIL: $c $arch + echo "FAIL: $c $arch ($reason)" fi sudo rm -Rf /var/tmp/build-root/$c-$arch @@ -182,16 +195,16 @@ case "$n" in echo "CONFIG: $c $arch" case $c in openSUSE_Factory) - bash qa.sh -local -factory $pkgs/gdb-testresults.$c.$arch + bash qa.sh -local -$arch -factory $pkgs/gdb-testresults.$c.$arch ;; SLE-12) - bash qa.sh -local -sle12 $pkgs/gdb-testresults.$c.$arch + bash qa.sh -local -$arch -sle12 $pkgs/gdb-testresults.$c.$arch ;; SLE-11) - bash qa.sh -local -sle11 $pkgs/gdb-testresults.$c.$arch + bash qa.sh -local -$arch -sle11 $pkgs/gdb-testresults.$c.$arch ;; *) - bash qa.sh -local $pkgs/gdb-testresults.$c.$arch + bash qa.sh -local -$arch $pkgs/gdb-testresults.$c.$arch ;; esac done diff --git a/qa.sh b/qa.sh index d98a24e..70dce54 100644 --- a/qa.sh +++ b/qa.sh @@ -23,7 +23,7 @@ usage () { echo "usage: $0 <1-5>" - echo " $0 -local [ -sle11 | -sle12 | -factory | -aarch64 | -powerpc64le | -s390 | -s390x ] " + echo " $0 -local [ -sle11 | -sle12 | -factory | -i586 | -x86_64 | -aarch64 | -powerpc64le | -s390 | -s390x ] " echo echo "Verify remote results at:" echo " ./binaries-testsuite.distro.arch/gdb-testresults" @@ -53,6 +53,8 @@ have_aarch64=false have_powerpc64le=false have_s390=false have_s390x=false +have_i586=false +have_x86_64=false if [ "$n" = "-local" ]; then while [ $# -gt 1 ]; do case $1 in @@ -77,6 +79,12 @@ if [ "$n" = "-local" ]; then -s390x) have_s390x=true ;; + -i586) + have_i586=true + ;; + -x86_64) + have_x86_64=true + ;; *) echo "Don't know how to handle arg: $1" usage @@ -140,6 +148,7 @@ report_sum () } kfail=( + # https://sourceware.org/bugzilla/show_bug.cgi?id=26971 "FAIL: gdb.arch/amd64-init-x87-values.exp: check_x87_regs_around_init: check post FLD1 value of .fop" "FAIL: gdb.arch/amd64-init-x87-values.exp: check_x87_regs_around_init: check post FLD1 value of .fioff" @@ -296,9 +305,17 @@ kfail=( # subsequent info threads shows all threads stopped, and a previous # info threads show all threads running. Not harmful. "FAIL: gdb.threads/interrupt-while-step-over.exp: displaced-stepping=off: iter=[0-9]*: wait for stops \(timeout\)" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=29040 + "FAIL: gdb.threads/next-fork-other-thread.exp:" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=30521 + "FAIL: gdb.base/printcmds.exp: print {unsigned char\[\]}{0xffffffff}" + ) # kfail kfail_sle12=( + # https://sourceware.org/bugzilla/show_bug.cgi?id=26292 "FAIL: gdb.base/checkpoint-ns.exp: .* \(timeout\)" "FAIL: gdb.base/checkpoint.exp: .* \(timeout\)" @@ -334,9 +351,9 @@ kfail_sle12=( # https://sourceware.org/bugzilla/show_bug.cgi?id=29244 "FAIL: gdb.arch/amd64-disp-step-avx.exp: running to main in runto" - "FAIL: gdb.arch/amd64-init-x87-values.exp: check_setting_mxcsr_before_enable: running to main in runto" - "FAIL: gdb.arch/amd64-init-x87-values.exp: check_setting_x87_regs_before_enable: running to main in runto" - "FAIL: gdb.arch/amd64-init-x87-values.exp: check_x87_regs_around_init: running to main in runto" + "FAIL: gdb.arch/amd64-init-x87-values.exp: check_x87_regs_around_init: runto: run to main" + "FAIL: gdb.arch/amd64-init-x87-values.exp: check_setting_mxcsr_before_enable: runto: run to main" + "FAIL: gdb.arch/amd64-init-x87-values.exp: check_setting_x87_regs_before_enable: runto: run to main" "FAIL: gdb.dwarf2/frame-inlined-in-outer-frame.exp: frame" "FAIL: gdb.dwarf2/frame-inlined-in-outer-frame.exp: starti prompt" "FAIL: gdb.dwarf2/frame-inlined-in-outer-frame.exp: step back into _start \(the program is no longer running\)" @@ -354,7 +371,8 @@ kfail_sle12=( "FAIL: gdb.base/longjmp.exp: next over patt3" "FAIL: gdb.base/premature-dummy-frame-removal.exp: p some_func \(\)" "FAIL: gdb.base/premature-dummy-frame-removal.exp: set debug frame on" - + "FAIL: gdb.base/longjmp-until-in-main.exp: until \\\$line, in main" + # Commit 2d77a94ff17 ("[gdb/testsuite] Require debug info for # gdb.tui/tui-layout-asm-short-prog.exp") "FAIL: gdb.tui/tui-layout-asm-short-prog.exp: check asm box contents" @@ -362,12 +380,12 @@ kfail_sle12=( # Test-cases that use -static but may turn out to be PIE when using # unix/-fPIE/-fpie. - "FAIL: gdb.base/break-entry.exp: running to .* in runto" + # https://sourceware.org/bugzilla/show_bug.cgi?id=29244 + "FAIL: gdb.base/break-entry.exp: runto: run to *" "FAIL: gdb.base/catch-fork-static.exp: run to fork" + "FAIL: gdb.threads/staticthreads.exp: runto: run to main" "FAIL: gdb.threads/staticthreads.exp: continue to main's call of sem_post" "FAIL: gdb.threads/staticthreads.exp: handle SIG32 helps" - "FAIL: gdb.threads/staticthreads.exp: running to main in runto" - "FAIL: gdb.threads/staticthreads.exp: running to main in runto" "FAIL: gdb.dwarf2/frame-inlined-in-outer-frame.exp: step back into _start" "FAIL: gdb.dwarf2/frame-inlined-in-outer-frame.exp: step back into foo" "FAIL: gdb.dwarf2/frame-inlined-in-outer-frame.exp: step into bar" @@ -377,9 +395,15 @@ kfail_sle12=( # on s390x/-m31 for SLE-12-SP5 with trunk. "FAIL: gdb.guile/scm-disasm.exp: disassemble via memory port" "FAIL: gdb.guile/scm-disasm.exp: memory-port: disassemble" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=30180 + "FAIL: gdb.fortran/module.exp: print var_d" + "FAIL: gdb.fortran/module.exp: print var_x value 31" + ) # kfail_sle12 kfail_sle11=( + "${kfail_sle12[@]}" # For SLE-11, libipt is not enabled, so on intel we can run into @@ -423,9 +447,11 @@ kfail_sle11=( # https://sourceware.org/bugzilla/show_bug.cgi?id=30154 "FAIL: gdb.multi/multi-target-no-resumed.exp: inf_A=.: inf_B=.: send_gdb control C \(timeout\)" + ) kfail_factory=( + # https://sourceware.org/bugzilla/show_bug.cgi?id=28463 "FAIL: gdb.ada/set_pckd_arr_elt.exp: scenario=minimal: print va.t\(1\) := 15" "FAIL: gdb.ada/set_pckd_arr_elt.exp: scenario=minimal: continue to update_small for va.t" @@ -438,7 +464,7 @@ kfail_factory=( # Similar error message to the one above, see if fixing that one fixes this. "FAIL: gdb.threads/clone-new-thread-event.exp: catch SIGUSR1" # https://sourceware.org/bugzilla/show_bug.cgi?id=27238 - "FAIL: gdb.go/package.exp: setting breakpoint at package2.Foo" + "FAIL: gdb.go/package.exp: gdb_breakpoint: set breakpoint at package2.Foo" "FAIL: gdb.go/package.exp: going to first breakpoint \(the program exited\)" # https://sourceware.org/bugzilla/show_bug.cgi?id=28551 "FAIL: gdb.go/package.exp: going to first breakpoint \\(GDB internal error\\)" @@ -479,9 +505,34 @@ kfail_factory=( # https://sourceware.org/bugzilla/show_bug.cgi?id=29965 "FAIL: gdb.threads/process-exit-status-is-leader-exit-status.exp: iteration=.*: continue \(the program exited\)" + + # To be investigated. + "FAIL: gdb.ada/mi_task_arg.exp: -stack-list-arguments 1 \(unexpected output\)" + "FAIL: gdb.ada/str_binop_equal.exp: print my_str = \"ABCD\"" + "FAIL: gdb.ada/widewide.exp: print my_wws = \" helo\"" + "FAIL: gdb.ada/widewide.exp: print my_ws = \"wide\"" + + # Looks like a problem with modern debug info, where stepping out of a + # function takes more one step. + "FAIL: gdb.base/rtld-step.exp: finish out of foo 1" + "FAIL: gdb.base/rtld-step.exp: next over baz in bar" + "FAIL: gdb.base/rtld-step.exp: step into foo 2" + "FAIL: gdb.base/rtld-step.exp: next over baz in foo" + "FAIL: gdb.base/rtld-step.exp: step out of foo back into bar" + "FAIL: gdb.base/rtld-step.exp: continue until exit" + + # Sets breakpoints in gdb build with lto. This is known to be slow, and + # likely to cause timeouts. + gdb.gdb/python-helper.exp + + # https://sourceware.org/bugzilla/show_bug.cgi?id=30540 + FAIL: gdb.base/auxv.exp: info auxv on live process + FAIL: gdb.base/auxv.exp: info auxv on gcore-created dump + ) # kfail_factory kfail_aarch64=( + # https://sourceware.org/bugzilla/show_bug.cgi?id=29408 "FAIL: gdb.base/large-frame.exp: optimize=-O0: backtrace" "FAIL: gdb.base/large-frame.exp: optimize=-O1: backtrace" @@ -501,9 +552,11 @@ kfail_aarch64=( # https://sourceware.org/bugzilla/show_bug.cgi?id=29423 "FAIL: gdb.base/watchpoint-unaligned.exp: continue \(timeout\)" "FAIL: gdb.base/watchpoint-unaligned.exp: size8twice write" + ) # kfail_aarch64 kfail_powerpc64le=( + # https://sourceware.org/bugzilla/show_bug.cgi?id=29420 "FAIL: gdb.ada/convvar_comp.exp: print \\\$item.started" @@ -520,10 +573,6 @@ kfail_powerpc64le=( # Commit f68eca29d3b ("PowerPC, fix gdb.base/retval-large-struct.exp"). "FAIL: gdb.base/retval-large-struct.exp: finish from return_large_struct" - # https://sourceware.org/bugzilla/show_bug.cgi?id=29793 - "FAIL: gdb.cp/gdb2495.exp: call a function that raises an exception without a handler." - "FAIL: gdb.cp/gdb2495.exp: bt after returning from a popped frame" - # https://sourceware.org/bugzilla/show_bug.cgi?id=29792 "FAIL: gdb.opt/solib-intra-step.exp: second-hit" @@ -558,7 +607,7 @@ kfail_powerpc64le=( # Commit e7d69e72bfd ("gdb: always add the default register groups"). "FAIL: gdb.xml/tdesc-regs.exp: maintenance print reggroups" - # Commit 91836f41e20 ("Powerpc fix for gdb.base/unwind-on-each-insn.exp"). + # https://sourceware.org/bugzilla/show_bug.cgi?id=30548 "FAIL: gdb.base/inline-frame-cycle-unwind.exp: cycle at level [0-9]*: backtrace when the unwind is broken at frame [0-9]*" # https://sourceware.org/bugzilla/show_bug.cgi?id=29815 @@ -579,25 +628,41 @@ kfail_powerpc64le=( # https://sourceware.org/bugzilla/show_bug.cgi?id=29897 "FAIL: gdb.base/run-control-while-bg-execution.exp: action1=.*: action2=start: start \(GDB internal error\)" "FAIL: gdb.base/run-control-while-bg-execution.exp: action1=.*: action2=run: run \(GDB internal error\)" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=30021 + "FAIL: gdb.base/unwind-on-each-insn.exp: instruction 6: \\\$fba_value == \\\$main_fba" + "FAIL: gdb.base/unwind-on-each-insn.exp: instruction 6: \[string equal \\\$fid \\\$main_fid\]" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=30542 + "FAIL: gdb.base/watch-before-fork.exp: test: continue to catch fork" + + + # https://sourceware.org/bugzilla/show_bug.cgi?id=30543 + "FAIL: gdb.python/py-send-packet.exp: call python run_auxv_send_packet_test function" ) kfail_powerpc64le_sle12=( + # Commit 85819864f7c ("[gdb/testsuite] Fix gdb.arch/altivec-regs.exp with # gcc 4.8.5"). "FAIL: gdb.arch/altivec-regs.exp: down to vector_fun" "FAIL: gdb.arch/altivec-regs.exp: finish returned correct value" "FAIL: gdb.arch/altivec-regs.exp: print vector parameter a" "FAIL: gdb.arch/altivec-regs.exp: print vector parameter b" + ) kfail_s390x_s390=( + # Commit 167f3beb655 ("[gdb/testsuite] Fix gdb.base/write_mem.exp for big # endian") "FAIL: gdb.base/write_mem.exp: x /xh main" + ) # Plain s390 or s390x/-m31. kfail_s390=( + "${kfail_s390x_s390[@]}" # https://sourceware.org/bugzilla/show_bug.cgi?id=29841 @@ -630,11 +695,51 @@ kfail_s390=( "FAIL: gdb.base/info-shared.exp:" "FAIL: gdb.python/py-strfns.exp: p /d {char\[4\]} arg" "FAIL: gdb.python/py-strfns.exp: p arg" + ) # s390x/-m64. kfail_s390x=( + "${kfail_s390x_s390[@]}" + +) + +kfail_i586=( + + # https://sourceware.org/bugzilla/show_bug.cgi?id=30518 + "FAIL: gdb.python/py-disasm.exp: memory source api: disassemble test" + "FAIL: gdb.python/py-disasm.exp: memory source api: python analyzing_disassembler.find_replacement_candidate\(\)" + "FAIL: gdb.python/py-disasm.exp: memory source api: second disassembler pass" + "FAIL: gdb.python/py-disasm.exp: memory source api: python analyzing_disassembler.check\(\)" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=30519 + "FAIL: gdb.python/py-parameter.exp: test_integer_parameter: kind=PARAM_UINTEGER: test default value" + "FAIL: gdb.python/py-parameter.exp: test_integer_parameter: kind=PARAM_UINTEGER: test default value via gdb.parameter" + "FAIL: gdb.python/py-parameter.exp: test_integer_parameter: kind=PARAM_UINTEGER: {test set to -1}" + "FAIL: gdb.python/py-parameter.exp: test_integer_parameter: kind=PARAM_UINTEGER: test value of -1" + "FAIL: gdb.python/py-parameter.exp: test_integer_parameter: kind=PARAM_UINTEGER: test value of -1 via gdb.parameter" + "FAIL: gdb.python/py-parameter.exp: test_integer_parameter: kind=PARAM_UINTEGER: test set to 1" + "FAIL: gdb.python/py-parameter.exp: test_integer_parameter: kind=PARAM_UINTEGER: test value of 1" + "FAIL: gdb.python/py-parameter.exp: test_integer_parameter: kind=PARAM_UINTEGER: test value of 1 via gdb.parameter" + "FAIL: gdb.python/py-parameter.exp: test_integer_parameter: kind=PARAM_UINTEGER: {test set to -5}" + "FAIL: gdb.python/py-parameter.exp: test_integer_parameter: kind=PARAM_UINTEGER: test value of -5 via gdb.parameter" + "FAIL: gdb.python/py-parameter.exp: test_integer_parameter: kind=PARAM_UINTEGER: test set to 5" + "FAIL: gdb.python/py-parameter.exp: test_integer_parameter: kind=PARAM_UINTEGER: test value of 5 via gdb.parameter" + "FAIL: gdb.python/py-parameter.exp: test_integer_parameter: kind=PARAM_UINTEGER: {test set to None}" + "FAIL: gdb.python/py-parameter.exp: test_integer_parameter: kind=PARAM_UINTEGER: test value of None" + "FAIL: gdb.python/py-parameter.exp: test_integer_parameter: kind=PARAM_UINTEGER: test value of None via gdb.parameter" + "FAIL: gdb.python/py-parameter.exp: test_integer_parameter: kind=PARAM_UINTEGER: test set to 0" + "FAIL: gdb.python/py-parameter.exp: test_integer_parameter: kind=PARAM_UINTEGER: test value of 0 via gdb.parameter" + +) + +kfail_armv7hl=( + + # https://sourceware.org/bugzilla/show_bug.cgi?id=30537 + "FAIL: gdb.fortran/intrinsics.exp: p cmplx \(4,4,16\) \(GDB internal error\)" + "FAIL: gdb.fortran/intrinsics.exp: ptype cmplx \(4,4,16\) \(GDB internal error\)" + ) case $n in @@ -645,8 +750,10 @@ case $n in # Todo: apply kfail_factory/kfail_sle12 only when appropriate. kfail+=("${kfail_factory[@]}") kfail+=("${kfail_sle12[@]}") + kfail+=("${kfail_sle11[@]}") kfail+=("${kfail_s390[@]}") kfail+=("${kfail_powerpc64le[@]}") + kfail+=("${kfail_armv7hl[@]}") kfail_re=$(join "|" "${kfail[@]}") grep "^FAIL:.*internal error" binaries-testsuite*/gdb-testresults/*.sum \ | grep -E -v "$kfail_re" @@ -659,6 +766,11 @@ case $n in kfail+=( # https://sourceware.org/bugzilla/show_bug.cgi?id=28323 "SLE-12.x86_64.*gdb.ada/mi_dyn_arr.exp" + + "UNRESOLVED: gdb.base/gcore-excessive-memory.exp: verify we can get to main" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=30547 + "UNRESOLVED: gdb.base/vfork-follow-parent.exp: resolution_method=schedule-multiple: continue to break_parent" ) kfail_re=$(join "|" "${kfail[@]}") @@ -699,6 +811,12 @@ case $n in # https://sourceware.org/bugzilla/show_bug.cgi?id=29897 "displaced-stepping.c:[0-9]*: internal-error: prepare: Assertion \`buf.current_thread != thread' failed." + + # https://sourceware.org/bugzilla/show_bug.cgi?id=30537 + "f-lang.c:[0-9]*: internal-error: eval_op_f_cmplx: Assertion \`kind_arg->code \(\) == TYPE_CODE_COMPLEX' failed." + + # Test-case gdb.base/gcore-excessive-memory.exp. + "utils.c:[0-9]*: internal-error: virtual memory exhausted: can't allocate [0-9]* bytes." ) kfail_re=$(join "|" "${kfail[@]}") @@ -708,43 +826,81 @@ case $n in ;; 4) - sums=() + ( + # Known clean config: Leap 15.3 x86_64 + config=openSUSE_Leap_15.3.x86_64/gdb-testresults + sums=("$config/gdb-x86_64-suse-linux-m64.-fno-PIE.-no-pie.sum" + "$config/gdb-x86_64-suse-linux-m64.sum" + "$config/gdb-x86_64-suse-linux-m32.-fno-PIE.-no-pie.sum" + "$config/gdb-x86_64-suse-linux-m32.sum") - # Known clean config: Leap 15.3 x86_64 - config=openSUSE_Leap_15.3.x86_64/gdb-testresults - sums+=("$config/gdb-x86_64-suse-linux-m64.-fno-PIE.-no-pie.sum" - "$config/gdb-x86_64-suse-linux-m64.sum" - "$config/gdb-x86_64-suse-linux-m32.-fno-PIE.-no-pie.sum" - "$config/gdb-x86_64-suse-linux-m32.sum") + # + + for sum in "${sums[@]}"; do + sum=binaries-testsuite.$sum + report_sum "$sum" + done + ) - # Known clean config: Leap 15.3 i586 - config=openSUSE_Leap_15.3.i586/gdb-testresults - sums+=("$config/gdb-i586-suse-linux-m32.-fno-PIE.-no-pie.sum" - "$config/gdb-i586-suse-linux-m32.sum") + ( + # Known clean config: Leap 15.3 i586 + config=openSUSE_Leap_15.3.i586/gdb-testresults + sums=("$config/gdb-i586-suse-linux-m32.-fno-PIE.-no-pie.sum" + "$config/gdb-i586-suse-linux-m32.sum") - # Known clean config: Leap 15.4 x86_64 - config=openSUSE_Leap_15.4.x86_64/gdb-testresults - sums+=("$config/gdb-x86_64-suse-linux-m64.-fno-PIE.-no-pie.sum" - "$config/gdb-x86_64-suse-linux-m64.sum" - "$config/gdb-x86_64-suse-linux-m32.-fno-PIE.-no-pie.sum" - "$config/gdb-x86_64-suse-linux-m32.sum") + kfail+=("${kfail_i586[@]}") + + for sum in "${sums[@]}"; do + sum=binaries-testsuite.$sum + report_sum "$sum" + done + ) - # Known clean config: Leap 15.4 i586 - config=openSUSE_Leap_15.4.i586/gdb-testresults - sums+=("$config/gdb-i586-suse-linux-m32.-fno-PIE.-no-pie.sum" - "$config/gdb-i586-suse-linux-m32.sum") + ( + # Known clean config: Leap 15.4 x86_64 + config=openSUSE_Leap_15.4.x86_64/gdb-testresults + sums=("$config/gdb-x86_64-suse-linux-m64.-fno-PIE.-no-pie.sum" + "$config/gdb-x86_64-suse-linux-m64.sum" + "$config/gdb-x86_64-suse-linux-m32.-fno-PIE.-no-pie.sum" + "$config/gdb-x86_64-suse-linux-m32.sum") - # Known clean config: SLE 15 x86_64. - config=SLE-15.x86_64/gdb-testresults - sums+=("$config/gdb-x86_64-suse-linux-m64.-fno-PIE.-no-pie.sum" - "$config/gdb-x86_64-suse-linux-m64.sum" - "$config/gdb-x86_64-suse-linux-m32.-fno-PIE.-no-pie.sum" - "$config/gdb-x86_64-suse-linux-m32.sum") + # - for sum in "${sums[@]}"; do - sum=binaries-testsuite.$sum - report_sum "$sum" - done + for sum in "${sums[@]}"; do + sum=binaries-testsuite.$sum + report_sum "$sum" + done + ) + + ( + # Known clean config: Leap 15.4 i586 + config=openSUSE_Leap_15.4.i586/gdb-testresults + sums=("$config/gdb-i586-suse-linux-m32.-fno-PIE.-no-pie.sum" + "$config/gdb-i586-suse-linux-m32.sum") + + kfail+=("${kfail_i586[@]}") + + for sum in "${sums[@]}"; do + sum=binaries-testsuite.$sum + report_sum "$sum" + done + ) + + ( + # Known clean config: SLE 15 x86_64. + config=SLE-15.x86_64/gdb-testresults + sums=("$config/gdb-x86_64-suse-linux-m64.-fno-PIE.-no-pie.sum" + "$config/gdb-x86_64-suse-linux-m64.sum" + "$config/gdb-x86_64-suse-linux-m32.-fno-PIE.-no-pie.sum" + "$config/gdb-x86_64-suse-linux-m32.sum") + + # + + for sum in "${sums[@]}"; do + sum=binaries-testsuite.$sum + report_sum "$sum" + done + ) ( # Known clean config: SLE 12 x86_64. @@ -770,11 +926,6 @@ case $n in "$config/gdb-x86_64-suse-linux-m32.-fno-PIE.-no-pie.sum" "$config/gdb-x86_64-suse-linux-m32.sum") - # Known clean config: Factory i586 - config=openSUSE_Factory.i586/gdb-testresults - sums+=("$config/gdb-i586-suse-linux-m32.-fno-PIE.-no-pie.sum" - "$config/gdb-i586-suse-linux-m32.sum") - kfail+=("${kfail_factory[@]}") for sum in "${sums[@]}"; do @@ -783,6 +934,21 @@ case $n in done ) + ( + # Known clean config: Factory i586 + config=openSUSE_Factory.i586/gdb-testresults + sums=("$config/gdb-i586-suse-linux-m32.-fno-PIE.-no-pie.sum" + "$config/gdb-i586-suse-linux-m32.sum") + + kfail+=("${kfail_factory[@]}") + kfail+=("${kfail_i586[@]}") + + for sum in "${sums[@]}"; do + sum=binaries-testsuite.$sum + report_sum "$sum" + done + ) + ( # Known clean config: SLE 15 aarch64. config=SLE-15.aarch64/gdb-testresults @@ -798,14 +964,14 @@ case $n in ) ( - kfail+=("${kfail_powerpc64le[@]}") - # Known clean config: SLE 15 / openSUSE 15.4 powerpc64le. for config in SLE-15.ppc64le/gdb-testresults openSUSE_Leap_15.4.ppc64le/gdb-testresults; do sums=("$config/gdb-ppc64le-suse-linux-m64.-fno-PIE.-no-pie.sum" "$config/gdb-ppc64le-suse-linux-m64.sum") done + kfail+=("${kfail_powerpc64le[@]}") + for sum in "${sums[@]}"; do sum=binaries-testsuite.$sum report_sum "$sum" @@ -865,10 +1031,15 @@ case $n in if $have_s390; then kfail+=("${kfail_s390[@]}") fi - if $have_s390x; then kfail+=("${kfail_s390x[@]}") fi + if $have_i586; then + kfail+=("${kfail_i586[@]}") + fi + if $have_x86_64; then + kfail+=("${kfail_x86_64[@]}") + fi for sum in "${sums[@]}"; do report_sum "$sum" diff --git a/remove-some-unnecessary-includes-from-exp.y.patch b/remove-some-unnecessary-includes-from-exp.y.patch new file mode 100644 index 0000000..9e22e52 --- /dev/null +++ b/remove-some-unnecessary-includes-from-exp.y.patch @@ -0,0 +1,171 @@ +From b4fdd96b50a92866886618f58d7408b2d086eeb0 Mon Sep 17 00:00:00 2001 +From: Tom Tromey +Date: Sat, 18 Mar 2023 08:27:17 -0600 +Subject: [PATCH] Remove some unnecessary includes from *-exp.y + +I noticed a weird comment in one of the .y files, and then ended up +removing some unnecessary #includes from these files. + +Tested by rebuilding. + +Approved-By: Simon Marchi +--- + gdb/ada-exp.y | 3 --- + gdb/c-exp.y | 3 --- + gdb/d-exp.y | 3 --- + gdb/f-exp.y | 3 --- + gdb/go-exp.y | 3 --- + gdb/m2-exp.y | 13 +++++-------- + gdb/p-exp.y | 4 ---- + 7 files changed, 5 insertions(+), 27 deletions(-) + +diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y +index 2f466e4de0a..a7052776b3a 100644 +--- a/gdb/ada-exp.y ++++ b/gdb/ada-exp.y +@@ -42,9 +42,6 @@ + #include "parser-defs.h" + #include "language.h" + #include "ada-lang.h" +-#include "bfd.h" /* Required by objfiles.h. */ +-#include "symfile.h" /* Required by objfiles.h. */ +-#include "objfiles.h" /* For have_full_symbols and have_partial_symbols */ + #include "frame.h" + #include "block.h" + #include "ada-exp.h" +diff --git a/gdb/c-exp.y b/gdb/c-exp.y +index 00599b0da7f..9ee4115560a 100644 +--- a/gdb/c-exp.y ++++ b/gdb/c-exp.y +@@ -43,9 +43,6 @@ + #include "language.h" + #include "c-lang.h" + #include "c-support.h" +-#include "bfd.h" /* Required by objfiles.h. */ +-#include "symfile.h" /* Required by objfiles.h. */ +-#include "objfiles.h" /* For have_full_symbols and have_partial_symbols */ + #include "charset.h" + #include "block.h" + #include "cp-support.h" +diff --git a/gdb/d-exp.y b/gdb/d-exp.y +index 1c299bf7ac6..3a4e7ee0434 100644 +--- a/gdb/d-exp.y ++++ b/gdb/d-exp.y +@@ -46,9 +46,6 @@ + #include "language.h" + #include "c-lang.h" + #include "d-lang.h" +-#include "bfd.h" /* Required by objfiles.h. */ +-#include "symfile.h" /* Required by objfiles.h. */ +-#include "objfiles.h" /* For have_full_symbols and have_partial_symbols */ + #include "charset.h" + #include "block.h" + #include "type-stack.h" +diff --git a/gdb/f-exp.y b/gdb/f-exp.y +index 30da537ea84..96d38af363c 100644 +--- a/gdb/f-exp.y ++++ b/gdb/f-exp.y +@@ -48,9 +48,6 @@ + #include "parser-defs.h" + #include "language.h" + #include "f-lang.h" +-#include "bfd.h" /* Required by objfiles.h. */ +-#include "symfile.h" /* Required by objfiles.h. */ +-#include "objfiles.h" /* For have_full_symbols and have_partial_symbols */ + #include "block.h" + #include + #include +diff --git a/gdb/go-exp.y b/gdb/go-exp.y +index 242e7103b94..cbaa79ee18c 100644 +--- a/gdb/go-exp.y ++++ b/gdb/go-exp.y +@@ -59,9 +59,6 @@ + #include "language.h" + #include "c-lang.h" + #include "go-lang.h" +-#include "bfd.h" /* Required by objfiles.h. */ +-#include "symfile.h" /* Required by objfiles.h. */ +-#include "objfiles.h" /* For have_full_symbols and have_partial_symbols */ + #include "charset.h" + #include "block.h" + #include "expop.h" +diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y +index 6629974a73e..3124aaad44b 100644 +--- a/gdb/m2-exp.y ++++ b/gdb/m2-exp.y +@@ -43,9 +43,6 @@ + #include "value.h" + #include "parser-defs.h" + #include "m2-lang.h" +-#include "bfd.h" /* Required by objfiles.h. */ +-#include "symfile.h" /* Required by objfiles.h. */ +-#include "objfiles.h" /* For have_full_symbols and have_partial_symbols */ + #include "block.h" + #include "m2-exp.h" + +@@ -140,7 +137,7 @@ using namespace expr; + %left '+' '-' + %left '*' '/' DIV MOD + %right UNARY +-%right '^' DOT '[' '(' ++%right '^' DOT_ID '[' '(' + %right NOT '~' + %left COLONCOLON QID + /* This is not an actual token ; it is used for precedence. +@@ -262,7 +259,7 @@ exp : DEC '(' exp ',' exp ')' + } + ; + +-exp : exp DOT NAME ++exp : exp DOT_ID NAME + { + pstate->push_new + (pstate->pop (), copy_name ($3)); +@@ -297,7 +294,7 @@ exp : exp '[' + that follow in the list. It is *not* specific to + function types */ + { pstate->start_arglist(); } +- non_empty_arglist ']' %prec DOT ++ non_empty_arglist ']' %prec DOT_ID + { + gdb_assert (pstate->arglist_len > 0); + std::vector args +@@ -311,7 +308,7 @@ exp : exp '(' + /* This is to save the value of arglist_len + being accumulated by an outer function call. */ + { pstate->start_arglist (); } +- arglist ')' %prec DOT ++ arglist ')' %prec DOT_ID + { + std::vector args + = pstate->pop_vector (pstate->end_arglist ()); +@@ -793,7 +790,7 @@ yylex (void) + else + { + pstate->lexptr++; +- return DOT; ++ return DOT_ID; + } + + /* These are character tokens that appear as-is in the YACC grammar */ +diff --git a/gdb/p-exp.y b/gdb/p-exp.y +index 6e03f1a5381..cf170408ac9 100644 +--- a/gdb/p-exp.y ++++ b/gdb/p-exp.y +@@ -50,11 +50,7 @@ + #include "parser-defs.h" + #include "language.h" + #include "p-lang.h" +-#include "bfd.h" /* Required by objfiles.h. */ +-#include "symfile.h" /* Required by objfiles.h. */ +-#include "objfiles.h" /* For have_full_symbols and have_partial_symbols. */ + #include "block.h" +-#include "completer.h" + #include "expop.h" + + #define parse_type(ps) builtin_type (ps->gdbarch ()) + +base-commit: ea9f87de71b8d5cd0f9d62ebca57cef7ee879324 +-- +2.35.3 +