Rebase to 17.2.
Resolves: RHEL-221050
This commit is contained in:
parent
2492d373c6
commit
e836eae49c
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
/gdb-17.1.tar.xz
|
||||
/gdb-17.2.tar.xz
|
||||
|
||||
@ -84,8 +84,6 @@ control files. These control files are:
|
||||
|
||||
- `_gdb.spec.Patch.include`: This file contains the `Patch:` directives.
|
||||
|
||||
- `_gdb.spec.patch.include`: This file contains the `%patch` directives.
|
||||
|
||||
- `_patch_order`: This file contains the patches, in the exact order
|
||||
that they must be applied. It is used when importing the patches
|
||||
into the git repository.
|
||||
|
||||
@ -19,63 +19,59 @@ Patch002: gdb-add-index.patch
|
||||
# RPMs to install when GDB finds an objfile with no debug info.
|
||||
Patch003: gdb-rpm-suggestion-script.patch
|
||||
|
||||
# Backport Guinevere Larsen's build warning fixes (RH BZ 2424325).
|
||||
Patch004: gdb-rhbz2424325-c23-const-build-warnings.patch
|
||||
|
||||
# Backport Keith Seitz's C23 const-correctness fixes (pending upstream review).
|
||||
# Mailing list: https://sourceware.org/pipermail/binutils/2026-January/...
|
||||
# Posted 2026-01-07, not yet approved.
|
||||
Patch005: gdb-rhbz2424325-c23-more-const-fixes.patch
|
||||
|
||||
# Backport Tom de Vries fix regarding implicit lambda captures
|
||||
# (RH BZ 2424325).
|
||||
Patch006: gdb-rhbz2424325-c++20-implicit-lambda-capture.patch
|
||||
# Backport test fix for flaky thread-specific-bp.exp (Tom de Vries).
|
||||
Patch004: gdb-backport-tom-32688-thread-specific-bp-fix.patch
|
||||
|
||||
# Backport of upstream commit 70b66cf338b14336 to address RHBZ
|
||||
# 2402580. This backport can be dropped when rebasing to GDB 18.
|
||||
# There were some moderate merge conflicts which needed resolving
|
||||
# when backporting this fix.
|
||||
Patch007: gdb-rhbz2403580-misplaced-symtabs.patch
|
||||
|
||||
# Backport of upstream commit f08ffbbf2691bad2d5df660ee644647687775f0c
|
||||
# Can be dropped on a rebase to gdb 17.2 or 18.1
|
||||
Patch008: gdb-rhbz2435950-skip-revert.patch
|
||||
Patch005: gdb-rhbz2403580-misplaced-symtabs.patch
|
||||
|
||||
# Backport of upstream commit c1da013915e from Kevin Buettner
|
||||
# (RHBZ 2413405).
|
||||
Patch009: gdb-rhbz2413405-gcore-unreadable-pages.patch
|
||||
Patch006: gdb-rhbz2413405-gcore-unreadable-pages.patch
|
||||
|
||||
# Backport of upstream commit d2cc16cd7fc from Jan Vrany fixing
|
||||
# FAILs in gdb.base/fileio.exp caused by macro expansion of
|
||||
# path components in OUTDIR.gdb/testsuite: fix FAILs in fileio.exp
|
||||
Patch010: gdb-fileio-test-fixes.patch
|
||||
# path components in OUTDIR.
|
||||
Patch007: gdb-fileio-test-fixes.patch
|
||||
|
||||
# Backport upstream commit 8bd08ee92c4 to address rhbz2366461. This
|
||||
# commit will drop out with GDB 18.
|
||||
Patch011: gdb-rhbz2366461-missing-thread.patch
|
||||
Patch008: gdb-rhbz2366461-missing-thread.patch
|
||||
|
||||
# Backport upstream commit cd289df068e to address rhbz2366461. This
|
||||
# commit will drop out with GDB 18.
|
||||
Patch012: gdb-rhbz2366461-bad-solib-entry-addr.patch
|
||||
|
||||
# Fix use of deprecated trace variable subcommand
|
||||
# (Tom de Vries)
|
||||
Patch013: gdb-fix-testsuite-newer-tcl.patch
|
||||
Patch009: gdb-rhbz2366461-bad-solib-entry-addr.patch
|
||||
|
||||
# Backport the following upstream commits in order to address RHBZ
|
||||
# 2467251: d980317c7f1, 958d06262a7, 7d1d7386561, 8915de0883c,
|
||||
# 8f65ab7b71f. These commits will all drop out when we rebase to GDB
|
||||
# 18.
|
||||
Patch014: gdb-rhbz2467251-computed-location-synthetic-pointers.patch
|
||||
Patch010: gdb-rhbz2467251-computed-location-synthetic-pointers.patch
|
||||
|
||||
# Fix EILSEQ problems for UTF8 related tests when using expect
|
||||
# enabled with Tcl 9 and full set of Tcl 9 compatibility fixes
|
||||
# from upstream PR80674 branch. Required for testing GDB on
|
||||
# Fedora 44 and rawhide (Fedora 45).
|
||||
#
|
||||
# At the time of this Fedora commit, this patch was not upstream yet.
|
||||
# For its status, see:
|
||||
#
|
||||
# https://inbox.sourceware.org/gdb-patches/20260526192701.3835262-2-kevinb@redhat.com/T/#u
|
||||
Patch015: gdb-tcl9-utf8-encoding-fix.patch
|
||||
# Backport of upstream commit e492fb22b70
|
||||
# gdb: backport DAP core file support
|
||||
Patch011: gdb-backport-dap-core-file-support.patch
|
||||
|
||||
# Backport of upstream commit be3a9405ceb4d6d6 to fix RHBZ 2368350, an
|
||||
# out of memory issue with the D demangler.
|
||||
#
|
||||
# The commit being pulled in here is a commit that syncs multiple
|
||||
# commits to libiberty from gcc to binutils-gdb. Most of these commits
|
||||
# are spelling and white space fixes, which should have no real impact.
|
||||
# The only commit we actually care about is gcc commit bc4d9b6aeb3,
|
||||
# which fixes the D demangler issue.
|
||||
#
|
||||
# This commit will not be needed once we rebase to GDB 18.
|
||||
Patch012: gdb-backport-libiberty-sync.patch
|
||||
|
||||
# Backport of upstream commit 93f536d813c41527e8c939a5f8a90a4 to fix
|
||||
# RHBZ2498034.
|
||||
Patch013: gdb-backport-corefile-use-after-free-fix.patch
|
||||
|
||||
# Backporting upstream commit f3ce0ce31fb3f0563510b9af0ae49aff96a72057
|
||||
# to fix a rebase regression.
|
||||
Patch018: gdb-backport-s390x-return-crash.patch
|
||||
|
||||
|
||||
@ -1,15 +0,0 @@
|
||||
%patch -p1 -P001
|
||||
%patch -p1 -P002
|
||||
%patch -p1 -P003
|
||||
%patch -p1 -P004
|
||||
%patch -p1 -P005
|
||||
%patch -p1 -P006
|
||||
%patch -p1 -P007
|
||||
%patch -p1 -P008
|
||||
%patch -p1 -P009
|
||||
%patch -p1 -P010
|
||||
%patch -p1 -P011
|
||||
%patch -p1 -P012
|
||||
%patch -p1 -P013
|
||||
%patch -p1 -P014
|
||||
%patch -p1 -P015
|
||||
@ -1 +1 @@
|
||||
631a49c452a4a456dd9889d172541ea789f8bcae
|
||||
7adf9fa6b1ccb3c70f86cb630368b9d3dffcf3aa
|
||||
|
||||
11
_patch_order
11
_patch_order
@ -1,15 +1,14 @@
|
||||
gdb-test-show-version.patch
|
||||
gdb-add-index.patch
|
||||
gdb-rpm-suggestion-script.patch
|
||||
gdb-rhbz2424325-c23-const-build-warnings.patch
|
||||
gdb-rhbz2424325-c23-more-const-fixes.patch
|
||||
gdb-rhbz2424325-c++20-implicit-lambda-capture.patch
|
||||
gdb-backport-tom-32688-thread-specific-bp-fix.patch
|
||||
gdb-rhbz2403580-misplaced-symtabs.patch
|
||||
gdb-rhbz2435950-skip-revert.patch
|
||||
gdb-rhbz2413405-gcore-unreadable-pages.patch
|
||||
gdb-fileio-test-fixes.patch
|
||||
gdb-rhbz2366461-missing-thread.patch
|
||||
gdb-rhbz2366461-bad-solib-entry-addr.patch
|
||||
gdb-fix-testsuite-newer-tcl.patch
|
||||
gdb-rhbz2467251-computed-location-synthetic-pointers.patch
|
||||
gdb-tcl9-utf8-encoding-fix.patch
|
||||
gdb-backport-dap-core-file-support.patch
|
||||
gdb-backport-libiberty-sync.patch
|
||||
gdb-backport-corefile-use-after-free-fix.patch
|
||||
gdb-backport-s390x-return-crash.patch
|
||||
|
||||
11
gating.yaml
11
gating.yaml
@ -7,8 +7,13 @@ rules:
|
||||
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
|
||||
--- !Policy
|
||||
product_versions:
|
||||
- rhel-*
|
||||
- rhel-8
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.gate-build-fast-lane.functional}
|
||||
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.gate-build-slow-lane.functional}
|
||||
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
|
||||
--- !Policy
|
||||
product_versions:
|
||||
- rhel-9
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
|
||||
|
||||
77
gdb-backport-corefile-use-after-free-fix.patch
Normal file
77
gdb-backport-corefile-use-after-free-fix.patch
Normal file
@ -0,0 +1,77 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Lancelot SIX <lancelot.six@amd.com>
|
||||
Date: Mon, 13 Oct 2025 15:11:09 +0100
|
||||
Subject: gdb-backport-corefile-use-after-free-fix.patch
|
||||
|
||||
;; Backport of upstream commit 93f536d813c41527e8c939a5f8a90a4 to fix
|
||||
;; RHBZ2498034.
|
||||
|
||||
gdb/corelow: Fix use-after-free in gdb_read_core_file_mappings
|
||||
|
||||
A recent refactor (fc8e5a565b3 -- gdb: make structured core file
|
||||
mappings processing global) in gdb/corelow.c:gdb_read_core_file_mappings
|
||||
introduced a use-after-free bug detected by address sanitizer.
|
||||
|
||||
In this change, a cache is built which holds addresses to elements of a
|
||||
std::vector. However, as elements as inserted in the vector, the
|
||||
addresses in the cache should be invalidated, but are not, leading to
|
||||
the use-after-free issue.
|
||||
|
||||
This patch proposes to store the index in the vector in the cache
|
||||
instead of the address of the element, solving the invalidation issue.
|
||||
An alternative approach could be to use a std::list which does not need
|
||||
invalidation of addresses/references/iterators as the container is
|
||||
grown.
|
||||
|
||||
Change-Id: Ib57d87c5d0405ffa3b7d38557fb33f7283c5d063
|
||||
Approved-By: Andrew Burgess <aburgess@redhat.com>
|
||||
|
||||
diff --git a/gdb/corelow.c b/gdb/corelow.c
|
||||
--- a/gdb/corelow.c
|
||||
+++ b/gdb/corelow.c
|
||||
@@ -2090,19 +2090,20 @@ gdb_read_core_file_mappings (struct gdbarch *gdbarch, struct bfd *cbfd)
|
||||
/* A map entry used while building RESULTS. */
|
||||
struct map_entry
|
||||
{
|
||||
- explicit map_entry (core_mapped_file *ptr)
|
||||
- : file_data (ptr)
|
||||
+ explicit map_entry (size_t idx)
|
||||
+ : file_data_index (idx),
|
||||
+ ignore_build_id_p (false)
|
||||
{ /* Nothing. */ }
|
||||
|
||||
/* Points to an entry in RESULTS, this allows entries to be quickly
|
||||
looked up and updated as new mappings are read. */
|
||||
- core_mapped_file *file_data = nullptr;
|
||||
+ size_t file_data_index;
|
||||
|
||||
/* If true then we have seen multiple different build-ids associated
|
||||
with the filename of FILE_DATA. The FILE_DATA->build_id field will
|
||||
have been set to nullptr, and we should not set FILE_DATA->build_id
|
||||
in future. */
|
||||
- bool ignore_build_id_p = false;
|
||||
+ bool ignore_build_id_p;
|
||||
};
|
||||
|
||||
/* All files mapped into the core file. The key is the filename. */
|
||||
@@ -2141,8 +2142,9 @@ gdb_read_core_file_mappings (struct gdbarch *gdbarch, struct bfd *cbfd)
|
||||
results.emplace_back ();
|
||||
|
||||
/* The entry to be added to the lookup map. */
|
||||
- map_entry entry (&results.back ());
|
||||
- entry.file_data->filename = filename;
|
||||
+ map_entry entry (std::distance (&results.front (),
|
||||
+ &results.back ()));
|
||||
+ results[entry.file_data_index].filename = filename;
|
||||
|
||||
/* Add entry to the quick lookup map and update ITER. */
|
||||
auto inserted_result
|
||||
@@ -2151,7 +2153,7 @@ gdb_read_core_file_mappings (struct gdbarch *gdbarch, struct bfd *cbfd)
|
||||
iter = inserted_result.first;
|
||||
}
|
||||
|
||||
- core_mapped_file &file_data = *iter->second.file_data;
|
||||
+ core_mapped_file &file_data = results[iter->second.file_data_index];
|
||||
bool &ignore_build_id_p = iter->second.ignore_build_id_p;
|
||||
|
||||
file_data.regions.emplace_back (start, end, file_ofs);
|
||||
2956
gdb-backport-dap-core-file-support.patch
Normal file
2956
gdb-backport-dap-core-file-support.patch
Normal file
File diff suppressed because it is too large
Load Diff
616
gdb-backport-libiberty-sync.patch
Normal file
616
gdb-backport-libiberty-sync.patch
Normal file
@ -0,0 +1,616 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Burgess <aburgess@redhat.com>
|
||||
Date: Thu, 14 May 2026 09:22:42 +0000
|
||||
Subject: gdb-backport-libiberty-sync.patch
|
||||
|
||||
;; Backport of upstream commit be3a9405ceb4d6d6 to fix RHBZ 2368350, an
|
||||
;; out of memory issue with the D demangler.
|
||||
;;
|
||||
;; The commit being pulled in here is a commit that syncs multiple
|
||||
;; commits to libiberty from gcc to binutils-gdb. Most of these commits
|
||||
;; are spelling and white space fixes, which should have no real impact.
|
||||
;; The only commit we actually care about is gcc commit bc4d9b6aeb3,
|
||||
;; which fixes the D demangler issue.
|
||||
;;
|
||||
;; This commit will not be needed once we rebase to GDB 18.
|
||||
|
||||
libiberty: sync with gcc commit df3510f80e7c02d9
|
||||
|
||||
Sync the libiberty/ directory with gcc commit
|
||||
df3510f80e7c02d9c19d7cb33759cd925880f53a. This pulls in the following
|
||||
gcc commits and the associated updates to 'libiberty/ChangeLog':
|
||||
|
||||
* 06fb00cb66d libiberty: Fix typos in various files
|
||||
* fbf903e5b9f Re-flow lines made longer than 80 characters by typo fixes
|
||||
* cfb945957ee Regenerate some autoconf configure scripts after recent spelling fixes.
|
||||
* bc4d9b6aeb3 libiberty: avoid exponential back reference issue in D demangler
|
||||
|
||||
I have retained the changes that are in the following binutils-gdb
|
||||
commit, which are not in gcc:
|
||||
|
||||
commit 219822fd5db6305592b45677a3b38c02b523360e
|
||||
Date: Tue Apr 9 06:39:21 2024 -0700
|
||||
|
||||
mmap: Avoid the sanitizer configure check failure
|
||||
|
||||
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
|
||||
--- a/libiberty/ChangeLog
|
||||
+++ b/libiberty/ChangeLog
|
||||
@@ -1,3 +1,62 @@
|
||||
+2026-06-07 Andrew Burgess <aburgess@redhat.com>
|
||||
+
|
||||
+ * d-demangle.c (struct dlang_info::options): New field,
|
||||
+ carries options passed to the demangler.
|
||||
+ (struct dlang_info::num_backrefs): Count total number of back
|
||||
+ referenced types that have been processed.
|
||||
+ (struct dlang_info::backref_depth): Count the depth of
|
||||
+ recursive back references.
|
||||
+ (dlang_type_backref): Track recursive back reference depth,
|
||||
+ and the total number of back references encountered. Bail out
|
||||
+ early if the total number gets too high.
|
||||
+ (dlang_demangle_init_info): Initialise new 'struct dlang_info'
|
||||
+ fields.
|
||||
+ (dlang_demangle): Pass demangler options to
|
||||
+ dlang_demangle_init_info.
|
||||
+ * testsuite/d-demangle-expected: Add new test.
|
||||
+
|
||||
+2026-06-01 Jakub Jelinek <jakub@redhat.com>
|
||||
+
|
||||
+ * configure: Regenerate.
|
||||
+
|
||||
+2026-05-30 Dhruv Chawla <dhruvc@nvidia.com>
|
||||
+
|
||||
+ * simple-object-mach-o.c (simple_object_mach_o_write_segment): Reflow
|
||||
+ long line.
|
||||
+
|
||||
+2026-05-30 Dhruv Chawla <dhruvc@nvidia.com>
|
||||
+
|
||||
+ * bcopy.c: Fix typos.
|
||||
+ * bsearch.c: Likewise.
|
||||
+ * bsearch_r.c: Likewise.
|
||||
+ * configure.ac: Likewise.
|
||||
+ * cp-demangle.c (d_print_comp_inner): Likewise.
|
||||
+ (d_print_comp): Likewise.
|
||||
+ * d-demangle.c (dlang_identifier): Likewise.
|
||||
+ * dyn-string.c: Likewise.
|
||||
+ * ldirname.c: Likewise.
|
||||
+ * make-relative-prefix.c (make_relative_prefix_1): Likewise.
|
||||
+ * obstacks.texi: Likewise.
|
||||
+ * pex-win32.c (argv_to_cmdline): Likewise.
|
||||
+ (spawn_script): Likewise.
|
||||
+ * random.c (random): Likewise.
|
||||
+ (setstate): Likewise.
|
||||
+ * regex.c (WIDE_CHAR_SUPPORT): Likewise.
|
||||
+ (convert_mbs_to_wcs): Likewise.
|
||||
+ (PREFIX): Likewise.
|
||||
+ (wcs_compile_range): Likewise.
|
||||
+ (count_mbs_length): Likewise.
|
||||
+ (wcs_re_match_2_internal): Likewise.
|
||||
+ (byte_re_match_2_internal): Likewise.
|
||||
+ * sigsetmask.c: Likewise.
|
||||
+ * simple-object-elf.c (SHT_SYMTAB_SHNDX): Likewise.
|
||||
+ (STV_HIDDEN): Likewise.
|
||||
+ (simple_object_elf_copy_lto_debug_sections): Likewise.
|
||||
+ * simple-object-mach-o.c (struct mach_o_header_32): Likewise.
|
||||
+ (struct mach_o_header_64): Likewise.
|
||||
+ (simple_object_mach_o_write_segment): Likewise.
|
||||
+ * strsignal.c (defined): Likewise.
|
||||
+
|
||||
2025-08-06 Matthieu Longo <matthieu.longo@arm.com>
|
||||
|
||||
* testsuite/test-doubly-linked-list.c: disable debug logging on
|
||||
diff --git a/libiberty/bcopy.c b/libiberty/bcopy.c
|
||||
--- a/libiberty/bcopy.c
|
||||
+++ b/libiberty/bcopy.c
|
||||
@@ -1,4 +1,4 @@
|
||||
-/* bcopy -- copy memory regions of arbitary length
|
||||
+/* bcopy -- copy memory regions of arbitrary length
|
||||
|
||||
@deftypefn Supplemental void bcopy (char *@var{in}, char *@var{out}, int @var{length})
|
||||
|
||||
diff --git a/libiberty/bsearch.c b/libiberty/bsearch.c
|
||||
--- a/libiberty/bsearch.c
|
||||
+++ b/libiberty/bsearch.c
|
||||
@@ -60,7 +60,7 @@ is respectively less than, matching, or greater than the array member.
|
||||
* is odd, moving left simply involves halving lim: e.g., when lim
|
||||
* is 5 we look at item 2, so we change lim to 2 so that we will
|
||||
* look at items 0 & 1. If lim is even, the same applies. If lim
|
||||
- * is odd, moving right again involes halving lim, this time moving
|
||||
+ * is odd, moving right again involves halving lim, this time moving
|
||||
* the base up one item past p: e.g., when lim is 5 we change base
|
||||
* to item 3 and make lim 2 so that we will look at items 3 and 4.
|
||||
* If lim is even, however, we have to shrink it by one before
|
||||
diff --git a/libiberty/bsearch_r.c b/libiberty/bsearch_r.c
|
||||
--- a/libiberty/bsearch_r.c
|
||||
+++ b/libiberty/bsearch_r.c
|
||||
@@ -61,7 +61,7 @@ is respectively less than, matching, or greater than the array member.
|
||||
* is odd, moving left simply involves halving lim: e.g., when lim
|
||||
* is 5 we look at item 2, so we change lim to 2 so that we will
|
||||
* look at items 0 & 1. If lim is even, the same applies. If lim
|
||||
- * is odd, moving right again involes halving lim, this time moving
|
||||
+ * is odd, moving right again involves halving lim, this time moving
|
||||
* the base up one item past p: e.g., when lim is 5 we change base
|
||||
* to item 3 and make lim 2 so that we will look at items 3 and 4.
|
||||
* If lim is even, however, we have to shrink it by one before
|
||||
diff --git a/libiberty/configure b/libiberty/configure
|
||||
--- a/libiberty/configure
|
||||
+++ b/libiberty/configure
|
||||
@@ -5967,7 +5967,7 @@ _ACEOF
|
||||
|
||||
|
||||
|
||||
-# Check for presense of long long
|
||||
+# Check for presence of long long
|
||||
ac_fn_c_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default"
|
||||
if test "x$ac_cv_type_long_long" = xyes; then :
|
||||
|
||||
diff --git a/libiberty/configure.ac b/libiberty/configure.ac
|
||||
--- a/libiberty/configure.ac
|
||||
+++ b/libiberty/configure.ac
|
||||
@@ -302,7 +302,7 @@ AC_CHECK_SIZEOF([int])
|
||||
AC_CHECK_SIZEOF([long])
|
||||
AC_CHECK_SIZEOF([size_t])
|
||||
|
||||
-# Check for presense of long long
|
||||
+# Check for presence of long long
|
||||
AC_CHECK_TYPE([long long],
|
||||
[AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have the `long long' type.]) AC_CHECK_SIZEOF([long long])],
|
||||
[])
|
||||
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
|
||||
--- a/libiberty/cp-demangle.c
|
||||
+++ b/libiberty/cp-demangle.c
|
||||
@@ -82,7 +82,7 @@
|
||||
|
||||
IN_GLIBCPP_V3
|
||||
If defined, this file defines only __cxa_demangle() and
|
||||
- __gcclibcxx_demangle_callback(), and no other publically visible
|
||||
+ __gcclibcxx_demangle_callback(), and no other publicly visible
|
||||
functions or variables.
|
||||
|
||||
STANDALONE_DEMANGLER
|
||||
@@ -5549,7 +5549,7 @@ d_print_comp_inner (struct d_print_info *dpi, int options,
|
||||
const struct d_component_stack *dcse;
|
||||
int found_self_or_parent = 0;
|
||||
|
||||
- /* This traversal is reentering SUB as a substition.
|
||||
+ /* This traversal is reentering SUB as a substitution.
|
||||
If we are not beneath SUB or DC in the tree then we
|
||||
need to restore SUB's template stack temporarily. */
|
||||
for (dcse = dpi->component_stack; dcse != NULL;
|
||||
@@ -6341,7 +6341,7 @@ d_print_comp (struct d_print_info *dpi, int options,
|
||||
dpi->recursion--;
|
||||
}
|
||||
|
||||
-/* Print a Java dentifier. For Java we try to handle encoded extended
|
||||
+/* Print a Java identifier. For Java we try to handle encoded extended
|
||||
Unicode characters. The C++ ABI doesn't mention Unicode encoding,
|
||||
so we don't it for C++. Characters are encoded as
|
||||
__U<hex-char>+_. */
|
||||
diff --git a/libiberty/d-demangle.c b/libiberty/d-demangle.c
|
||||
--- a/libiberty/d-demangle.c
|
||||
+++ b/libiberty/d-demangle.c
|
||||
@@ -175,8 +175,33 @@ struct dlang_info
|
||||
{
|
||||
/* The string we are demangling. */
|
||||
const char *s;
|
||||
+
|
||||
+ /* The options passed to the demangler. */
|
||||
+ int options;
|
||||
+
|
||||
/* The index of the last back reference. */
|
||||
int last_backref;
|
||||
+
|
||||
+ /* The total number of back referenced types, including nested back
|
||||
+ referenced types. This is reset to zero each time a back
|
||||
+ reference is processed at the "top level" (i.e. not a nested back
|
||||
+ reference).
|
||||
+
|
||||
+ Cases have been encountered where a back reference type includes
|
||||
+ references to other back reference types, which include further
|
||||
+ back references. This was observed to a depth of 57. If each
|
||||
+ layer only references the layer before twice then the innermost
|
||||
+ string will be duplicated 2^57 times!
|
||||
+
|
||||
+ We count the number of nested back references and compare this to
|
||||
+ the recursion limit, even though this isn't strictly recursion. */
|
||||
+ int num_backrefs;
|
||||
+
|
||||
+ /* Track the depth of back references. Depth 0 is considered the
|
||||
+ top level. When we encounter a back reference at this depth the
|
||||
+ NUM_BACKREFS field is reset to 0. At greater depths,
|
||||
+ NUM_BACKREFS will be incremented. */
|
||||
+ int backref_depth;
|
||||
};
|
||||
|
||||
/* Pass as the LEN to dlang_parse_template if symbol length is not known. */
|
||||
@@ -411,6 +436,24 @@ dlang_type_backref (string *decl, const char *mangled, struct dlang_info *info,
|
||||
if (mangled - info->s >= info->last_backref)
|
||||
return NULL;
|
||||
|
||||
+ /* A back reference might point to a type that itself contains back
|
||||
+ references, which might themselves contain back references.
|
||||
+ There might not be recursion going on, but we can run into
|
||||
+ problems of exponential growth caused by the inner type appearing
|
||||
+ to be referenced 10s of millions of times. */
|
||||
+ if (info->backref_depth > 0)
|
||||
+ {
|
||||
+ if ((info->options & DMGL_NO_RECURSE_LIMIT) == 0
|
||||
+ && info->num_backrefs > DEMANGLE_RECURSION_LIMIT)
|
||||
+ return NULL;
|
||||
+
|
||||
+ info->num_backrefs++;
|
||||
+ }
|
||||
+ else
|
||||
+ info->num_backrefs = 0;
|
||||
+
|
||||
+ info->backref_depth++;
|
||||
+
|
||||
int save_refpos = info->last_backref;
|
||||
info->last_backref = mangled - info->s;
|
||||
|
||||
@@ -424,6 +467,7 @@ dlang_type_backref (string *decl, const char *mangled, struct dlang_info *info,
|
||||
backref = dlang_type (decl, backref, info);
|
||||
|
||||
info->last_backref = save_refpos;
|
||||
+ info->backref_depth--;
|
||||
|
||||
if (backref == NULL)
|
||||
return NULL;
|
||||
@@ -1067,7 +1111,7 @@ dlang_identifier (string *decl, const char *mangled, struct dlang_info *info)
|
||||
}
|
||||
|
||||
/* Extract the plain identifier from MANGLED and prepend/append it to DECL
|
||||
- with special treatment for some magic compiler generted symbols.
|
||||
+ with special treatment for some magic compiler generated symbols.
|
||||
Return the remaining string on success or NULL on failure. */
|
||||
static const char *
|
||||
dlang_lname (string *decl, const char *mangled, unsigned long len)
|
||||
@@ -1931,17 +1975,20 @@ dlang_parse_template (string *decl, const char *mangled,
|
||||
/* Initialize the information structure we use to pass around information. */
|
||||
static void
|
||||
dlang_demangle_init_info (const char *mangled, int last_backref,
|
||||
- struct dlang_info *info)
|
||||
+ int options, struct dlang_info *info)
|
||||
{
|
||||
info->s = mangled;
|
||||
+ info->options = options;
|
||||
info->last_backref = last_backref;
|
||||
+ info->num_backrefs = 0;
|
||||
+ info->backref_depth = 0;
|
||||
}
|
||||
|
||||
/* Extract and demangle the symbol in MANGLED. Returns the demangled
|
||||
signature on success or NULL on failure. */
|
||||
|
||||
char *
|
||||
-dlang_demangle (const char *mangled, int option ATTRIBUTE_UNUSED)
|
||||
+dlang_demangle (const char *mangled, int options)
|
||||
{
|
||||
string decl;
|
||||
char *demangled = NULL;
|
||||
@@ -1962,7 +2009,7 @@ dlang_demangle (const char *mangled, int option ATTRIBUTE_UNUSED)
|
||||
{
|
||||
struct dlang_info info;
|
||||
|
||||
- dlang_demangle_init_info (mangled, strlen (mangled), &info);
|
||||
+ dlang_demangle_init_info (mangled, strlen (mangled), options, &info);
|
||||
mangled = dlang_parse_mangle (&decl, mangled, &info);
|
||||
|
||||
/* Check that the entire symbol was successfully demangled. */
|
||||
diff --git a/libiberty/dyn-string.c b/libiberty/dyn-string.c
|
||||
--- a/libiberty/dyn-string.c
|
||||
+++ b/libiberty/dyn-string.c
|
||||
@@ -49,8 +49,8 @@ Boston, MA 02110-1301, USA. */
|
||||
function can be used with a dyn_string struct on the stack or
|
||||
embedded in another object. The contents of the string itself
|
||||
are still dynamically allocated. The string initially is capable
|
||||
- of holding at least SPACE characeters, including the terminating
|
||||
- NUL. If SPACE is 0, it will silently be increated to 1.
|
||||
+ of holding at least SPACE characters, including the terminating
|
||||
+ NUL. If SPACE is 0, it will silently be increased to 1.
|
||||
|
||||
If RETURN_ON_ALLOCATION_FAILURE is defined and memory allocation
|
||||
fails, returns 0. Otherwise returns 1. */
|
||||
diff --git a/libiberty/ldirname.c b/libiberty/ldirname.c
|
||||
--- a/libiberty/ldirname.c
|
||||
+++ b/libiberty/ldirname.c
|
||||
@@ -26,7 +26,7 @@ Given a pointer to a string containing a typical pathname
|
||||
(@samp{/usr/src/cmd/ls/ls.c} for example), returns a string containing the
|
||||
passed string up to, but not including, the final directory separator.
|
||||
|
||||
-If the given pathname doesn't contain a directory separator then this funtion
|
||||
+If the given pathname doesn't contain a directory separator then this function
|
||||
returns the empty string; this includes an empty given pathname. @code{NULL}
|
||||
is returned on memory allocation error.
|
||||
|
||||
diff --git a/libiberty/make-relative-prefix.c b/libiberty/make-relative-prefix.c
|
||||
--- a/libiberty/make-relative-prefix.c
|
||||
+++ b/libiberty/make-relative-prefix.c
|
||||
@@ -410,7 +410,7 @@ make_relative_prefix_1 (const char *progname, const char *bin_prefix,
|
||||
/* Do the full job, including symlink resolution.
|
||||
This path will find files installed in the same place as the
|
||||
program even when a soft link has been made to the program
|
||||
- from somwhere else. */
|
||||
+ from somewhere else. */
|
||||
|
||||
char *
|
||||
make_relative_prefix (const char *progname, const char *bin_prefix,
|
||||
diff --git a/libiberty/obstacks.texi b/libiberty/obstacks.texi
|
||||
--- a/libiberty/obstacks.texi
|
||||
+++ b/libiberty/obstacks.texi
|
||||
@@ -695,7 +695,7 @@ Initialize use of an obstack, with an initial chunk of
|
||||
@var{chunk_size} bytes.
|
||||
|
||||
@item int obstack_specify_allocation (struct obstack *@var{obstack-ptr}, size_t chunk_size, size_t alignment, void *(*chunkfun) (size_t), void (*freefun) (void *))
|
||||
-Initialize use of an obstack, specifying intial chunk size, chunk
|
||||
+Initialize use of an obstack, specifying initial chunk size, chunk
|
||||
alignment, and memory allocation functions.
|
||||
|
||||
@item int obstack_specify_allocation_with_arg (struct obstack *@var{obstack-ptr}, size_t chunk_size, size_t alignment, void *(*chunkfun) (void *, size_t), void (*freefun) (void *, void *), void *arg)
|
||||
diff --git a/libiberty/pex-win32.c b/libiberty/pex-win32.c
|
||||
--- a/libiberty/pex-win32.c
|
||||
+++ b/libiberty/pex-win32.c
|
||||
@@ -350,7 +350,7 @@ argv_to_cmdline (char *const *argv)
|
||||
/* We only quote arguments that contain spaces, \t or " characters to
|
||||
prevent wasting 2 chars per argument of the CreateProcess 32k char
|
||||
limit. We need only escape embedded double-quotes and immediately
|
||||
- preceeding backslash characters. A sequence of backslach characters
|
||||
+ preceding backslash characters. A sequence of backslach characters
|
||||
that is not followed by a double quote character will not be
|
||||
escaped. */
|
||||
needs_quotes = 0;
|
||||
@@ -363,7 +363,7 @@ argv_to_cmdline (char *const *argv)
|
||||
|
||||
if (argv[i][j] == '"')
|
||||
{
|
||||
- /* Escape preceeding backslashes. */
|
||||
+ /* Escape preceding backslashes. */
|
||||
for (k = j - 1; k >= 0 && argv[i][k] == '\\'; k--)
|
||||
cmdline_len++;
|
||||
/* Escape the quote character. */
|
||||
@@ -695,7 +695,7 @@ spawn_script (struct pex_obj *obj,
|
||||
int fd = _open (executable, _O_RDONLY);
|
||||
|
||||
/* Try to open script, check header format, extract interpreter path,
|
||||
- and spawn script using that interpretter. */
|
||||
+ and spawn script using that interpreter. */
|
||||
if (fd >= 0)
|
||||
{
|
||||
char buf[MAX_PATH + 5];
|
||||
diff --git a/libiberty/random.c b/libiberty/random.c
|
||||
--- a/libiberty/random.c
|
||||
+++ b/libiberty/random.c
|
||||
@@ -88,7 +88,7 @@ long int random (void);
|
||||
then initialized to contain information for random number generation with
|
||||
that much state information. Good sizes for the amount of state
|
||||
information are 32, 64, 128, and 256 bytes. The state can be switched by
|
||||
- calling the setstate() function with the same array as was initiallized
|
||||
+ calling the setstate() function with the same array as was initialized
|
||||
with initstate(). By default, the package runs with 128 bytes of state
|
||||
information and generates far better random numbers than a linear
|
||||
congruential generator. If the amount of state information is less than
|
||||
@@ -362,7 +362,7 @@ setstate (void *arg_state)
|
||||
|
||||
/* If we are using the trivial TYPE_0 R.N.G., just do the old linear
|
||||
congruential bit. Otherwise, we do our fancy trinomial stuff, which is the
|
||||
- same in all ther other cases due to all the global variables that have been
|
||||
+ same in all the other cases due to all the global variables that have been
|
||||
set up. The basic operation is to add the number at the rear pointer into
|
||||
the one at the front pointer. Then both pointers are advanced to the next
|
||||
location cyclically in the table. The value returned is the sum generated,
|
||||
diff --git a/libiberty/regex.c b/libiberty/regex.c
|
||||
--- a/libiberty/regex.c
|
||||
+++ b/libiberty/regex.c
|
||||
@@ -58,7 +58,7 @@
|
||||
|
||||
# define WIDE_CHAR_SUPPORT (HAVE_WCTYPE_H && HAVE_WCHAR_H && HAVE_BTOWC)
|
||||
|
||||
-/* For platform which support the ISO C amendement 1 functionality we
|
||||
+/* For platform which support the ISO C amendment 1 functionality we
|
||||
support user defined character classes. */
|
||||
# if defined _LIBC || WIDE_CHAR_SUPPORT
|
||||
/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */
|
||||
@@ -1235,7 +1235,7 @@ printchar (int c)
|
||||
|
||||
# ifdef WCHAR
|
||||
/* This convert a multibyte string to a wide character string.
|
||||
- And write their correspondances to offset_buffer(see below)
|
||||
+ And write their correspondences to offset_buffer(see below)
|
||||
and write whether each wchar_t is binary data to is_binary.
|
||||
This assume invalid multibyte sequences as binary data.
|
||||
We assume offset_buffer and is_binary is already allocated
|
||||
@@ -1247,7 +1247,7 @@ static size_t convert_mbs_to_wcs (CHAR_T *dest, const unsigned char* src,
|
||||
static size_t
|
||||
convert_mbs_to_wcs (CHAR_T *dest, const unsigned char*src, size_t len,
|
||||
int *offset_buffer, char *is_binary)
|
||||
- /* It hold correspondances between src(char string) and
|
||||
+ /* It hold correspondences between src(char string) and
|
||||
dest(wchar_t string) for optimization.
|
||||
e.g. src = "xxxyzz"
|
||||
dest = {'X', 'Y', 'Z'}
|
||||
@@ -1281,7 +1281,7 @@ convert_mbs_to_wcs (CHAR_T *dest, const unsigned char*src, size_t len,
|
||||
|
||||
if (consumed <= 0)
|
||||
/* failed to convert. maybe src contains binary data.
|
||||
- So we consume 1 byte manualy. */
|
||||
+ So we consume 1 byte manually. */
|
||||
{
|
||||
*pdest = *psrc;
|
||||
consumed = 1;
|
||||
@@ -2174,7 +2174,7 @@ typedef struct
|
||||
# ifndef DEFINED_ONCE
|
||||
# if defined _LIBC || WIDE_CHAR_SUPPORT
|
||||
/* The GNU C library provides support for user-defined character classes
|
||||
- and the functions from ISO C amendement 1. */
|
||||
+ and the functions from ISO C amendment 1. */
|
||||
# ifdef CHARCLASS_NAME_MAX
|
||||
# define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX
|
||||
# else
|
||||
@@ -3416,7 +3416,7 @@ PREFIX(regex_compile) (const char *ARG_PREFIX(pattern),
|
||||
int32_t idx2 = table[ch];
|
||||
size_t len = weights[idx2];
|
||||
|
||||
- /* Test whether the lenghts match. */
|
||||
+ /* Test whether the lengths match. */
|
||||
if (weights[idx] == len)
|
||||
{
|
||||
/* They do. New compare the bytes of
|
||||
@@ -4389,7 +4389,7 @@ wcs_compile_range (CHAR_T range_start_char, const CHAR_T **p_ptr,
|
||||
{
|
||||
/* range_start is a collating symbol. */
|
||||
int32_t *wextra;
|
||||
- /* Retreive the index and get collation sequence value. */
|
||||
+ /* Retrieve the index and get collation sequence value. */
|
||||
wextra = (int32_t*)(extra + char_set[-range_start_char]);
|
||||
start_val = wextra[1 + *wextra];
|
||||
}
|
||||
@@ -5502,7 +5502,7 @@ count_mbs_length(int *offset_buffer, int length)
|
||||
return 0;
|
||||
|
||||
/* If there are no multibyte character, offset_buffer[i] == i.
|
||||
- Optmize for this case. */
|
||||
+ Optimize for this case. */
|
||||
if (offset_buffer[length] == length)
|
||||
return length;
|
||||
|
||||
@@ -5538,7 +5538,7 @@ wcs_re_match_2_internal (struct re_pattern_buffer *bufp,
|
||||
struct re_registers *regs,
|
||||
int stop,
|
||||
/* string1 == string2 == NULL means string1/2, size1/2 and
|
||||
- mbs_offset1/2 need seting up in this function. */
|
||||
+ mbs_offset1/2 need setting up in this function. */
|
||||
/* We need wchar_t* buffers correspond to cstring1, cstring2. */
|
||||
wchar_t *string1, int size1,
|
||||
wchar_t *string2, int size2,
|
||||
@@ -5739,7 +5739,7 @@ byte_re_match_2_internal (struct re_pattern_buffer *bufp,
|
||||
fill them with converted string. */
|
||||
if (string1 == NULL && string2 == NULL)
|
||||
{
|
||||
- /* We need seting up buffers here. */
|
||||
+ /* We need setting up buffers here. */
|
||||
|
||||
/* We must free wcs buffers in this function. */
|
||||
cant_free_wcs_buf = 0;
|
||||
diff --git a/libiberty/sigsetmask.c b/libiberty/sigsetmask.c
|
||||
--- a/libiberty/sigsetmask.c
|
||||
+++ b/libiberty/sigsetmask.c
|
||||
@@ -1,7 +1,7 @@
|
||||
/* Version of sigsetmask.c
|
||||
Written by Steve Chamberlain (sac@cygnus.com).
|
||||
Contributed by Cygnus Support.
|
||||
- This file is in the public doamin. */
|
||||
+ This file is in the public domain. */
|
||||
|
||||
/*
|
||||
|
||||
diff --git a/libiberty/simple-object-elf.c b/libiberty/simple-object-elf.c
|
||||
--- a/libiberty/simple-object-elf.c
|
||||
+++ b/libiberty/simple-object-elf.c
|
||||
@@ -198,7 +198,7 @@ typedef struct {
|
||||
#define SHT_RELA 4 /* Relocation entries with addends */
|
||||
#define SHT_REL 9 /* Relocation entries, no addends */
|
||||
#define SHT_GROUP 17 /* Section contains a section group */
|
||||
-#define SHT_SYMTAB_SHNDX 18 /* Extended section indeces */
|
||||
+#define SHT_SYMTAB_SHNDX 18 /* Extended section indices */
|
||||
|
||||
/* Values for sh_flags field. */
|
||||
|
||||
@@ -246,7 +246,7 @@ typedef struct
|
||||
#define STB_WEAK 2 /* Weak global */
|
||||
|
||||
#define STV_DEFAULT 0 /* Visibility is specified by binding type */
|
||||
-#define STV_HIDDEN 2 /* Can only be seen inside currect component */
|
||||
+#define STV_HIDDEN 2 /* Can only be seen inside current component */
|
||||
|
||||
/* Functions to fetch and store different ELF types, depending on the
|
||||
endianness and size. */
|
||||
@@ -1512,7 +1512,7 @@ simple_object_elf_copy_lto_debug_sections (simple_object_read *sobj,
|
||||
of __gnu_lto_slim symbol. */
|
||||
if (st_shndx == SHN_COMMON)
|
||||
discard = 1;
|
||||
- /* We also need to remove symbols refering to sections
|
||||
+ /* We also need to remove symbols referring to sections
|
||||
we'll eventually remove as with fat LTO objects
|
||||
we otherwise get duplicate symbols at final link
|
||||
(with GNU ld, gold is fine and ignores symbols in
|
||||
diff --git a/libiberty/simple-object-mach-o.c b/libiberty/simple-object-mach-o.c
|
||||
--- a/libiberty/simple-object-mach-o.c
|
||||
+++ b/libiberty/simple-object-mach-o.c
|
||||
@@ -53,7 +53,7 @@ struct mach_o_header_32
|
||||
unsigned char filetype[4]; /* Type of file. */
|
||||
unsigned char ncmds[4]; /* Number of load commands. */
|
||||
unsigned char sizeofcmds[4]; /* Total size of load commands. */
|
||||
- unsigned char flags[4]; /* Flags for special featues. */
|
||||
+ unsigned char flags[4]; /* Flags for special features. */
|
||||
};
|
||||
|
||||
/* Mach-O header (64-bit version). */
|
||||
@@ -66,7 +66,7 @@ struct mach_o_header_64
|
||||
unsigned char filetype[4]; /* Type of file. */
|
||||
unsigned char ncmds[4]; /* Number of load commands. */
|
||||
unsigned char sizeofcmds[4]; /* Total size of load commands. */
|
||||
- unsigned char flags[4]; /* Flags for special featues. */
|
||||
+ unsigned char flags[4]; /* Flags for special features. */
|
||||
unsigned char reserved[4]; /* Reserved. Duh. */
|
||||
};
|
||||
|
||||
@@ -1204,8 +1204,8 @@ simple_object_mach_o_write_segment (simple_object_write *sobj, int descriptor,
|
||||
unsigned int i;
|
||||
|
||||
/* Write the section header for the wrapper. */
|
||||
- /* Account for any initial aligment - which becomes the alignment for this
|
||||
- created section. */
|
||||
+ /* Account for any initial alignment - which becomes the alignment for
|
||||
+ this created section. */
|
||||
|
||||
secsize = (offset - index[0]);
|
||||
if (!simple_object_mach_o_write_section_header (sobj, descriptor,
|
||||
@@ -1218,7 +1218,7 @@ simple_object_mach_o_write_segment (simple_object_write *sobj, int descriptor,
|
||||
errmsg, err))
|
||||
return 0;
|
||||
|
||||
- /* Subtract the wrapper section start from the begining of each sub
|
||||
+ /* Subtract the wrapper section start from the beginning of each sub
|
||||
section. */
|
||||
|
||||
for (i = 1; i < nsects_in; ++i)
|
||||
diff --git a/libiberty/strsignal.c b/libiberty/strsignal.c
|
||||
--- a/libiberty/strsignal.c
|
||||
+++ b/libiberty/strsignal.c
|
||||
@@ -152,7 +152,7 @@ static const struct signal_info signal_table[] =
|
||||
#endif
|
||||
#if defined (SIGIO)
|
||||
/* "I/O pending" has also been suggested, but is misleading since the
|
||||
- signal only happens when the process has asked for it, not everytime
|
||||
+ signal only happens when the process has asked for it, not every time
|
||||
I/O is pending. */
|
||||
ENTRY(SIGIO, "SIGIO", "I/O possible"),
|
||||
#endif
|
||||
@@ -208,7 +208,7 @@ static const struct signal_info signal_table[] =
|
||||
ENTRY(SIGGRANT, "SIGGRANT", "Monitor mode granted"),
|
||||
#endif
|
||||
#if defined (SIGRETRACT)
|
||||
- ENTRY(SIGRETRACT, "SIGRETRACT", "Need to relinguish monitor mode"),
|
||||
+ ENTRY(SIGRETRACT, "SIGRETRACT", "Need to relinquish monitor mode"),
|
||||
#endif
|
||||
#if defined (SIGMSG)
|
||||
ENTRY(SIGMSG, "SIGMSG", "Monitor mode data available"),
|
||||
diff --git a/libiberty/testsuite/d-demangle-expected b/libiberty/testsuite/d-demangle-expected
|
||||
--- a/libiberty/testsuite/d-demangle-expected
|
||||
+++ b/libiberty/testsuite/d-demangle-expected
|
||||
@@ -1475,3 +1475,15 @@ demangle.anonymous.foo
|
||||
--format=auto
|
||||
_D8demangle9anonymous03fooZ
|
||||
demangle.anonymous.foo
|
||||
+#
|
||||
+# This symbol was seen in the wild. It has a pattern of back
|
||||
+# references that result in exponential growth, with the innermost
|
||||
+# type being referenced 10s of millions of times. We use the
|
||||
+# demangler's recursion limit to place a hard cap on back reference
|
||||
+# usage, which causes the demangler to safely bail out before
|
||||
+# consuming an excessive amount of memory. Trying to demangle this
|
||||
+# without the recursion limit in place will eventually cause the OOM
|
||||
+# killer to kick in.
|
||||
+--format=dlang
|
||||
+_D3std6format5write__T14formattedWriteTDFAxaZvTaTS2ae5utils4text7functor__T13stringifiableTSQBqQBqQBi10primitives__TQCaSQCsQCsQCk11composition__T3seqTSQDxQDxQDpQCh__TQDySQEqQEqQEnQEl__T17formattingFunctorVAyaa2_2573Vii250TQrZ15__lambda_L40_C3TQBmZ7FunctorTSQHzQHzQHrQGj__TQIaSQIsQIsQIpQIn__TQEcVQDma2_2573Vii250TSQKdQKdQKaQJy__TQJtTSQKxQKxQKpQJh__TQKyS4btdu2ui6curses6Curses4Wand__T8withAttrTSQNfQNfQNcQNa__TQMvTSQNzQNzQNrQMj__TQOaSQOsQOsQOkQMa__T6selectTSQPqQPqQPiQOa__TQPrSQQjQQjQQbQOt__T12valueFunctorTbZQrFbZ17__lambda_L143_C57TbZQLbTSQSvQSvQSnQRf__TQSwSQToQToQTlQTj__T5fmtIfVQOlnTbTPFNaNbNiNfZQPdTSQVhQVhQUzQTr__TQViSQKkQKi7browser7Browser6updateMFZ__T17__lambda_L1185_C4TQSeTSQYiQYiQYfQYd__TQXyTSQZcQZcQYuQXm__TQZdSQZvQZvQZnQXd__TQLdTQKzTSQBAtQBAuQBAnQZg__TQBAxSQBBqQBBrQBBpQBBo__TQIgVQWonTbTSQBCvQBCwQBCpQBBi__TQBDaSQBDtQBDuQBDnQBCg__TQNoTSQBErQBEsQBEqQBEp__TQBElTSQBFqQBFrQBFkQBEd__TQBFvSQBGoQBGpQBGiQBDz__TQBDqTSQBHnQBHoQBHhQBGa__TQBHsSQBIlQBImQBIkQBIj__TQBDzVQBDka2_2573Vii250TSQBKcQBKdQBKbQBKa__TQBJwTSQBLbQBLcQBKvQBJo__TQBLgSQBAjQBAiQBAjQBAgQBAd__TQBAcTQBHcTSQBNhQBNiQBNgQBNf__TQBNbTSQBOgQBOhQBOaQBMt__TQBOlSQBDoQBDnQBDoQBDlQBDi__TQBDhTQBKhZQBDrMFEQBFcQBFbQBFcQBEzQBEw9AttributebKQBLzZ19__lambda_L503_C20_1TPSQBHlQBHkQBHlQBHiQBHfTQDfTbTSQBUdQBUeQBUcQBUb__TQBTxTSQBVcQBVdQBUwQBTp__TQBVhSQBWaQBWbQBVuQBTl__TQBTcTQBTcZ3funTQBTmZQBPyZQBWtFQCwZ13StringifiableZQBRcZQBXxFQKwZQBeTQBTkZQBMuMFQJdbQBTzQMwQBUgZ17__lambda_L503_C20TQIfTQKrTbTSQCBpQCBqQCBoQCBn__TQCBjTSQCCoQCCpQCCiQCBb__TQCCtSQCDmQCDnQCDgQCAx__TQCAoTQCAoTSQCEqQCErQCEkQCDd__TQCEvSQCFoQCFpQCFnQCFm__TQCBcVQCAna2_2573Vii250TQTyZ17__lambda_L40_C3_1TQUwZQCArTQCEpZQLnTQCEyTQEkTQCFhZQCBtZQCIoFQHfZQLvZQCClZQCJgFQZkZQMnZ17__lambda_L40_C3_3TQBBlZQCEcTQCIaTQBEpZQPdTQBEyTQCItTQBFiZQCFkZQCMfFQBHuZQPnZQBWuFQBJhZ19__lambda_L143_C57_1TQBKiZQCHoTSQCPjQCPkQCPdQCNw__TQCPoSQCQhQCQiQCQbQCOu__TQCAcTQBHeZQCAmFQBHoZ19__lambda_L143_C57_2TQBIpZQCLgZQBYxFNibQBQoQEeZQWnTQBRaZQCMkTSQCUfQCUgQCTzQCSs__TQCUkSQCVdQCVeQCVcQCVb__TQCBtVQCQcnTbTQBTpTQHgZQCCpFNibQBUgQHwZQBAfTQIfZQCQcZQBAtTQCImTQBXoTQEhZQCRaZQCXvFQBZyZQBBdZQCCaMFQCTqQCBmbSQCOjQCOiQCEbQCDx13ScrollContextPSQCPq5paths11BrowserPathZ20__lambda_L1195_C76_1TQBxZQCVqZQCJhFNibQCJbQCIqZQBGyTQCJpZQCWwTSQDErQDEsQDElQDDe__TQDEwSQDFpQDFqQDFoQDFn__TQCMfVQDAonTbTQCMeTQCLuZQCNcFNibQCMwQCMlZQBKtTQCMvZQDArZQBLiTQCTbTQCQbTQEkZQDBpZQDIkFQCVqZQBLsZQCXeMFQBTnbQCXfZ19__lambda_L503_C20_2TQBSlTQBUyTbTSQDLxQDLyQDLwQDLv__TQDLrTSQDMwQDMxQDMqQDLj__TQDNbSQDNuQDNvQDNoQDLf__TQDKwTSQDOtQDOuQDOnQDNg__TQDOySQDPrQDPsQDPqQDPp__TQDLfVQDKqa2_2573Vii250TQDEdZ17__lambda_L40_C3_7TQDFcZQDKwZQBVnTQEdZQDLkZQDSfFQGoZQBVmZQDMdZQDSyFQDJgZQBWgZ17__lambda_L40_C3_8TQDLeZQDNwZQBYnTQDRzTQDOcZQDOqZQDVlFQDVaZQBYtZQDYbFKQDXqMxAaQDXoZk
|
||||
+_D3std6format5write__T14formattedWriteTDFAxaZvTaTS2ae5utils4text7functor__T13stringifiableTSQBqQBqQBi10primitives__TQCaSQCsQCsQCk11composition__T3seqTSQDxQDxQDpQCh__TQDySQEqQEqQEnQEl__T17formattingFunctorVAyaa2_2573Vii250TQrZ15__lambda_L40_C3TQBmZ7FunctorTSQHzQHzQHrQGj__TQIaSQIsQIsQIpQIn__TQEcVQDma2_2573Vii250TSQKdQKdQKaQJy__TQJtTSQKxQKxQKpQJh__TQKyS4btdu2ui6curses6Curses4Wand__T8withAttrTSQNfQNfQNcQNa__TQMvTSQNzQNzQNrQMj__TQOaSQOsQOsQOkQMa__T6selectTSQPqQPqQPiQOa__TQPrSQQjQQjQQbQOt__T12valueFunctorTbZQrFbZ17__lambda_L143_C57TbZQLbTSQSvQSvQSnQRf__TQSwSQToQToQTlQTj__T5fmtIfVQOlnTbTPFNaNbNiNfZQPdTSQVhQVhQUzQTr__TQViSQKkQKi7browser7Browser6updateMFZ__T17__lambda_L1185_C4TQSeTSQYiQYiQYfQYd__TQXyTSQZcQZcQYuQXm__TQZdSQZvQZvQZnQXd__TQLdTQKzTSQBAtQBAuQBAnQZg__TQBAxSQBBqQBBrQBBpQBBo__TQIgVQWonTbTSQBCvQBCwQBCpQBBi__TQBDaSQBDtQBDuQBDnQBCg__TQNoTSQBErQBEsQBEqQBEp__TQBElTSQBFqQBFrQBFkQBEd__TQBFvSQBGoQBGpQBGiQBDz__TQBDqTSQBHnQBHoQBHhQBGa__TQBHsSQBIlQBImQBIkQBIj__TQBDzVQBDka2_2573Vii250TSQBKcQBKdQBKbQBKa__TQBJwTSQBLbQBLcQBKvQBJo__TQBLgSQBAjQBAiQBAjQBAgQBAd__TQBAcTQBHcTSQBNhQBNiQBNgQBNf__TQBNbTSQBOgQBOhQBOaQBMt__TQBOlSQBDoQBDnQBDoQBDlQBDi__TQBDhTQBKhZQBDrMFEQBFcQBFbQBFcQBEzQBEw9AttributebKQBLzZ19__lambda_L503_C20_1TPSQBHlQBHkQBHlQBHiQBHfTQDfTbTSQBUdQBUeQBUcQBUb__TQBTxTSQBVcQBVdQBUwQBTp__TQBVhSQBWaQBWbQBVuQBTl__TQBTcTQBTcZ3funTQBTmZQBPyZQBWtFQCwZ13StringifiableZQBRcZQBXxFQKwZQBeTQBTkZQBMuMFQJdbQBTzQMwQBUgZ17__lambda_L503_C20TQIfTQKrTbTSQCBpQCBqQCBoQCBn__TQCBjTSQCCoQCCpQCCiQCBb__TQCCtSQCDmQCDnQCDgQCAx__TQCAoTQCAoTSQCEqQCErQCEkQCDd__TQCEvSQCFoQCFpQCFnQCFm__TQCBcVQCAna2_2573Vii250TQTyZ17__lambda_L40_C3_1TQUwZQCArTQCEpZQLnTQCEyTQEkTQCFhZQCBtZQCIoFQHfZQLvZQCClZQCJgFQZkZQMnZ17__lambda_L40_C3_3TQBBlZQCEcTQCIaTQBEpZQPdTQBEyTQCItTQBFiZQCFkZQCMfFQBHuZQPnZQBWuFQBJhZ19__lambda_L143_C57_1TQBKiZQCHoTSQCPjQCPkQCPdQCNw__TQCPoSQCQhQCQiQCQbQCOu__TQCAcTQBHeZQCAmFQBHoZ19__lambda_L143_C57_2TQBIpZQCLgZQBYxFNibQBQoQEeZQWnTQBRaZQCMkTSQCUfQCUgQCTzQCSs__TQCUkSQCVdQCVeQCVcQCVb__TQCBtVQCQcnTbTQBTpTQHgZQCCpFNibQBUgQHwZQBAfTQIfZQCQcZQBAtTQCImTQBXoTQEhZQCRaZQCXvFQBZyZQBBdZQCCaMFQCTqQCBmbSQCOjQCOiQCEbQCDx13ScrollContextPSQCPq5paths11BrowserPathZ20__lambda_L1195_C76_1TQBxZQCVqZQCJhFNibQCJbQCIqZQBGyTQCJpZQCWwTSQDErQDEsQDElQDDe__TQDEwSQDFpQDFqQDFoQDFn__TQCMfVQDAonTbTQCMeTQCLuZQCNcFNibQCMwQCMlZQBKtTQCMvZQDArZQBLiTQCTbTQCQbTQEkZQDBpZQDIkFQCVqZQBLsZQCXeMFQBTnbQCXfZ19__lambda_L503_C20_2TQBSlTQBUyTbTSQDLxQDLyQDLwQDLv__TQDLrTSQDMwQDMxQDMqQDLj__TQDNbSQDNuQDNvQDNoQDLf__TQDKwTSQDOtQDOuQDOnQDNg__TQDOySQDPrQDPsQDPqQDPp__TQDLfVQDKqa2_2573Vii250TQDEdZ17__lambda_L40_C3_7TQDFcZQDKwZQBVnTQEdZQDLkZQDSfFQGoZQBVmZQDMdZQDSyFQDJgZQBWgZ17__lambda_L40_C3_8TQDLeZQDNwZQBYnTQDRzTQDOcZQDOqZQDVlFQDVaZQBYtZQDYbFKQDXqMxAaQDXoZk
|
||||
435
gdb-backport-s390x-return-crash.patch
Normal file
435
gdb-backport-s390x-return-crash.patch
Normal file
@ -0,0 +1,435 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Kevin Buettner <kevinb@redhat.com>
|
||||
Date: Fri, 11 Jul 2025 16:18:13 -0700
|
||||
Subject: gdb-backport-s390x-return-crash.patch
|
||||
|
||||
;; Backporting upstream commit f3ce0ce31fb3f0563510b9af0ae49aff96a72057
|
||||
;; to fix a rebase regression.
|
||||
|
||||
Fix unwinding when restoring a register from one of a greater size
|
||||
|
||||
When debugging functions where a callee-saved register is moved to a
|
||||
register of a larger size (e.g., a 64-bit general-purpose register to
|
||||
a 128-bit vector register), GDB would crash when the user issued the
|
||||
"return" command. For example:
|
||||
|
||||
ldgr %f0, %r11 ; Move 64-bit general-purpose register (r11)
|
||||
; to 128-bit vector register (f0)
|
||||
.cfi_register r11, f0 ; DW_CFA_register: r11 is stored in f0
|
||||
...
|
||||
lgdr %r11, %f0 ; Restore r11 from f0
|
||||
.cfi_restore r11 ; DW_CFA_restore: r11 is restored to its original
|
||||
; register
|
||||
|
||||
(This example uses instructions and registers for the S390x architecture,
|
||||
where this bug was originally found.)
|
||||
|
||||
If GDB is stopped in the "..." section and the user issues the
|
||||
"return" command, GDB crashes due to a buffer size mismatch during
|
||||
unwinding. Specifically, in frame_register_unwind in frame.c, a
|
||||
buffer the size of the original register (the 64-bit r11 in this
|
||||
example) has been allocated and GDB would like to use memcpy to copy
|
||||
the contents of the register where the original register was saved
|
||||
(the 128-bit f0) to the buffer for the original register. But,
|
||||
fortunately, GDB has an assertion which prevents this from happening:
|
||||
|
||||
gdb_assert (buffer.size () >= value->type ()->length ());
|
||||
|
||||
This patch ensures that GDB uses the original register's type (e.g.,
|
||||
r11's type) when unwinding, even if it was marked as saved to a differently
|
||||
typed/sized register (e.g., f0) via .cfi_register (DW_CFA_register).
|
||||
|
||||
The fix adds a 'struct type *' parameter to value_of_register_lazy() to
|
||||
explicitly track the original register's type. The function
|
||||
frame_unwind_got_register is updated to pass the correct type for the
|
||||
original register.
|
||||
|
||||
The call chain from frame_register_unwind to frame_unwind_got_register
|
||||
is shown by this backtrace:
|
||||
|
||||
#0 frame_unwind_got_register (frame=..., regnum=13, new_regnum=128)
|
||||
at gdb/frame-unwind.c:300
|
||||
#1 0x000000000135d894 in dwarf2_frame_prev_register (this_frame=...,
|
||||
this_cache=0x2204528, regnum=13)
|
||||
at gdb/dwarf2/frame.c:1187
|
||||
#2 0x00000000014d9186 in frame_unwind_legacy::prev_register (
|
||||
this=0x211f428 <dwarf2_frame_unwind>, this_frame=...,
|
||||
this_prologue_cache=0x2204528, regnum=13) at gdb/frame-unwind.c:401
|
||||
#3 0x00000000014e1d12 in frame_unwind_register_value (next_frame=...,
|
||||
regnum=13) at gdb/frame.c:1263
|
||||
#4 0x00000000014e16b8 in frame_register_unwind (next_frame=..., regnum=13,
|
||||
optimizedp=0x3ffffff813c, unavailablep=0x3ffffff8138,
|
||||
lvalp=0x3ffffff8134, addrp=0x3ffffff8128, realnump=0x3ffffff8124,
|
||||
buffer=...) at gdb/frame.c:1189
|
||||
|
||||
The register numbers shown above are for s390x. On s390x,
|
||||
S390_R11_REGNUM has value 13. Vector registers (like f0) are numbered
|
||||
differently from floating-point registers of the same name, leading to
|
||||
regnum 128 for f0 despite S390_F0_REGNUM being assigned a different
|
||||
value in s390-tdep.h.
|
||||
|
||||
New test cases for aarch64 and x86_64 check for this on more popular
|
||||
architectures and also without dependency on a particular compiler to
|
||||
generate an unusual prologue in which a general purpose register is
|
||||
being moved to a vector register. In both cases, the test simulates
|
||||
the bug found on s390x where a 64-bit frame pointer was being moved to
|
||||
a much wider vector register. These test cases will cause an internal
|
||||
error on their respective architecture, but will pass with this fix in
|
||||
place.
|
||||
|
||||
When tested on s390x linux (native), this change fixes 59 GDB internal
|
||||
errors and around 200 failures overall. This is the list of internal
|
||||
errors that no longer occur on s390x:
|
||||
|
||||
FAIL: gdb.base/call-sc.exp: tc: return foo; return call-sc-tc (GDB internal error)
|
||||
FAIL: gdb.base/call-sc.exp: td: return foo; return call-sc-td (GDB internal error)
|
||||
FAIL: gdb.base/call-sc.exp: te: return foo; return call-sc-te (GDB internal error)
|
||||
FAIL: gdb.base/call-sc.exp: tf: return foo; return call-sc-tf (GDB internal error)
|
||||
FAIL: gdb.base/call-sc.exp: ti: return foo; return call-sc-ti (GDB internal error)
|
||||
FAIL: gdb.base/call-sc.exp: tl: return foo; return call-sc-tl (GDB internal error)
|
||||
FAIL: gdb.base/call-sc.exp: tld: return foo; return call-sc-tld (GDB internal error)
|
||||
FAIL: gdb.base/call-sc.exp: tll: return foo; return call-sc-tll (GDB internal error)
|
||||
FAIL: gdb.base/call-sc.exp: ts: return foo; return call-sc-ts (GDB internal error)
|
||||
FAIL: gdb.base/gnu_vector.exp: return from vector-valued function (GDB internal error)
|
||||
FAIL: gdb.base/return-3.exp: in foo: return (GDB internal error)
|
||||
FAIL: gdb.base/return-nodebug.exp: double: return from function with no debug info with a cast (GDB internal error)
|
||||
FAIL: gdb.base/return-nodebug.exp: float: return from function with no debug info with a cast (GDB internal error)
|
||||
FAIL: gdb.base/return-nodebug.exp: int: return from function with no debug info with a cast (GDB internal error)
|
||||
FAIL: gdb.base/return-nodebug.exp: long-long: return from function with no debug info with a cast (GDB internal error)
|
||||
FAIL: gdb.base/return-nodebug.exp: long: return from function with no debug info with a cast (GDB internal error)
|
||||
FAIL: gdb.base/return-nodebug.exp: short: return from function with no debug info with a cast (GDB internal error)
|
||||
FAIL: gdb.base/return-nodebug.exp: signed-char: return from function with no debug info with a cast (GDB internal error)
|
||||
FAIL: gdb.base/return.exp: return value 5 (GDB internal error)
|
||||
FAIL: gdb.base/return.exp: return value 5.0 (GDB internal error)
|
||||
FAIL: gdb.base/return2.exp: return from char_func (GDB internal error)
|
||||
FAIL: gdb.base/return2.exp: return from double_func (GDB internal error)
|
||||
FAIL: gdb.base/return2.exp: return from float_func (GDB internal error)
|
||||
FAIL: gdb.base/return2.exp: return from int_func (GDB internal error)
|
||||
FAIL: gdb.base/return2.exp: return from long_func (GDB internal error)
|
||||
FAIL: gdb.base/return2.exp: return from long_long_func (GDB internal error)
|
||||
FAIL: gdb.base/return2.exp: return from short_func (GDB internal error)
|
||||
FAIL: gdb.base/return2.exp: return from void_func (GDB internal error)
|
||||
FAIL: gdb.base/sigstep.exp: return from handleri: leave handler (GDB internal error)
|
||||
FAIL: gdb.base/structs.exp: types=tc-ti: return foo<n>; return 2 structs-tc-ti (GDB internal error)
|
||||
FAIL: gdb.base/structs.exp: types=tc-tl: return foo<n>; return 2 structs-tc-tl (GDB internal error)
|
||||
FAIL: gdb.base/structs.exp: types=tc-ts: return foo<n>; return 2 structs-tc-ts (GDB internal error)
|
||||
FAIL: gdb.base/structs.exp: types=tc: return foo<n>; return 1 structs-tc (GDB internal error)
|
||||
FAIL: gdb.base/structs.exp: types=tc: return foo<n>; return 2 structs-tc (GDB internal error)
|
||||
FAIL: gdb.base/structs.exp: types=tc: return foo<n>; return 3 structs-tc (GDB internal error)
|
||||
FAIL: gdb.base/structs.exp: types=tc: return foo<n>; return 4 structs-tc (GDB internal error)
|
||||
FAIL: gdb.base/structs.exp: types=tc: return foo<n>; return 5 structs-tc (GDB internal error)
|
||||
FAIL: gdb.base/structs.exp: types=tc: return foo<n>; return 6 structs-tc (GDB internal error)
|
||||
FAIL: gdb.base/structs.exp: types=tc: return foo<n>; return 7 structs-tc (GDB internal error)
|
||||
FAIL: gdb.base/structs.exp: types=tc: return foo<n>; return 8 structs-tc (GDB internal error)
|
||||
FAIL: gdb.base/structs.exp: types=td-tf: return foo<n>; return 2 structs-td-tf (GDB internal error)
|
||||
FAIL: gdb.base/structs.exp: types=td: return foo<n>; return 1 structs-td (GDB internal error)
|
||||
FAIL: gdb.base/structs.exp: types=tf-tc: return foo<n>; return 2 structs-tf-tc (GDB internal error)
|
||||
FAIL: gdb.base/structs.exp: types=tf-td: return foo<n>; return 2 structs-tf-td (GDB internal error)
|
||||
FAIL: gdb.base/structs.exp: types=tf: return foo<n>; return 1 structs-tf (GDB internal error)
|
||||
FAIL: gdb.base/structs.exp: types=tf: return foo<n>; return 2 structs-tf (GDB internal error)
|
||||
FAIL: gdb.base/structs.exp: types=ti-tc: return foo<n>; return 2 structs-ti-tc (GDB internal error)
|
||||
FAIL: gdb.base/structs.exp: types=ti: return foo<n>; return 1 structs-ti (GDB internal error)
|
||||
FAIL: gdb.base/structs.exp: types=ti: return foo<n>; return 2 structs-ti (GDB internal error)
|
||||
FAIL: gdb.base/structs.exp: types=tl-tc: return foo<n>; return 2 structs-tl-tc (GDB internal error)
|
||||
FAIL: gdb.base/structs.exp: types=tl: return foo<n>; return 1 structs-tl (GDB internal error)
|
||||
FAIL: gdb.base/structs.exp: types=tl: return foo<n>; return 2 structs-tl (GDB internal error)
|
||||
FAIL: gdb.base/structs.exp: types=tld: return foo<n>; return 1 structs-tld (GDB internal error)
|
||||
FAIL: gdb.base/structs.exp: types=tll: return foo<n>; return 1 structs-tll (GDB internal error)
|
||||
FAIL: gdb.base/structs.exp: types=ts-tc: return foo<n>; return 2 structs-ts-tc (GDB internal error)
|
||||
FAIL: gdb.base/structs.exp: types=ts: return foo<n>; return 1 structs-ts (GDB internal error)
|
||||
FAIL: gdb.base/structs.exp: types=ts: return foo<n>; return 2 structs-ts (GDB internal error)
|
||||
FAIL: gdb.base/structs.exp: types=ts: return foo<n>; return 3 structs-ts (GDB internal error)
|
||||
FAIL: gdb.base/structs.exp: types=ts: return foo<n>; return 4 structs-ts (GDB internal error)
|
||||
|
||||
I have tested this commit on Fedora Linux, with architectures s390x,
|
||||
x86_64, x86_64/-m32, aarch64, ppc64le, and riscv64, with no
|
||||
regressions found.
|
||||
|
||||
This v2 version makes some changes suggested by Andrew Burgess: It
|
||||
adds an assert to frame_unwind_got_register() and always passes the
|
||||
type of REGNUM to value_of_register_lazy(). It also updates value.h's
|
||||
comment describing value_of_register_lazy().
|
||||
|
||||
In his approval message, Andrew requested some changes to the tests.
|
||||
Those have been made exactly as requested.
|
||||
|
||||
Approved-By: Andrew Burgess <aburgess@redhat.com>
|
||||
|
||||
diff --git a/gdb/findvar.c b/gdb/findvar.c
|
||||
--- a/gdb/findvar.c
|
||||
+++ b/gdb/findvar.c
|
||||
@@ -65,14 +65,15 @@ value_of_register (int regnum, const frame_info_ptr &next_frame)
|
||||
/* See value.h. */
|
||||
|
||||
value *
|
||||
-value_of_register_lazy (const frame_info_ptr &next_frame, int regnum)
|
||||
+value_of_register_lazy (const frame_info_ptr &next_frame, int regnum,
|
||||
+ struct type *type)
|
||||
{
|
||||
gdbarch *gdbarch = frame_unwind_arch (next_frame);
|
||||
|
||||
gdb_assert (regnum < gdbarch_num_cooked_regs (gdbarch));
|
||||
gdb_assert (next_frame != nullptr);
|
||||
|
||||
- return value::allocate_register_lazy (next_frame, regnum);
|
||||
+ return value::allocate_register_lazy (next_frame, regnum, type);
|
||||
}
|
||||
|
||||
/* Given a pointer of type TYPE in target form in BUF, return the
|
||||
diff --git a/gdb/frame-unwind.c b/gdb/frame-unwind.c
|
||||
--- a/gdb/frame-unwind.c
|
||||
+++ b/gdb/frame-unwind.c
|
||||
@@ -297,8 +297,16 @@ struct value *
|
||||
frame_unwind_got_register (const frame_info_ptr &frame,
|
||||
int regnum, int new_regnum)
|
||||
{
|
||||
+ struct gdbarch *gdbarch = frame_unwind_arch (frame);
|
||||
+ struct type *regnum_type = register_type (gdbarch, regnum);
|
||||
+ struct type *new_regnum_type = register_type (gdbarch, new_regnum);
|
||||
+
|
||||
+ /* REGNUM has been copied into NEW_REGNUM, therefore, the former
|
||||
+ must be smaller or equal in size to the latter. */
|
||||
+ gdb_assert (regnum_type->length () <= new_regnum_type->length ());
|
||||
+
|
||||
return value_of_register_lazy (get_next_frame_sentinel_okay (frame),
|
||||
- new_regnum);
|
||||
+ new_regnum, regnum_type);
|
||||
}
|
||||
|
||||
/* Return a value which indicates that FRAME saved REGNUM in memory at
|
||||
diff --git a/gdb/testsuite/gdb.arch/aarch64-frameptr-vecreg-unwind.c b/gdb/testsuite/gdb.arch/aarch64-frameptr-vecreg-unwind.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.arch/aarch64-frameptr-vecreg-unwind.c
|
||||
@@ -0,0 +1,62 @@
|
||||
+/* Copyright 2025 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This file is part of GDB.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+volatile void dummy () {}
|
||||
+
|
||||
+long test_function(void)
|
||||
+{
|
||||
+ __asm__ volatile (
|
||||
+ /* Zero d0 (64-bit vector register part of v0). */
|
||||
+ "movi d0, #0\n\t"
|
||||
+
|
||||
+ /* Move the frame pointer (x29) to d0 using fmov. */
|
||||
+ "fmov d0, x29\n\t"
|
||||
+
|
||||
+ /* Describe CFI: Frame pointer is now in d0. */
|
||||
+ ".cfi_register x29, d0\n\t"
|
||||
+
|
||||
+ /* Clobber list: Specify all modified registers. */
|
||||
+ : /* No output operands. */
|
||||
+ : /* No input operands. */
|
||||
+ : "d0"
|
||||
+ );
|
||||
+
|
||||
+ dummy (); /* break-here */
|
||||
+
|
||||
+ __asm__ volatile (
|
||||
+ /* Restore the frame pointer (x29) from d0 using fmov. */
|
||||
+ "fmov x29, d0\n\t"
|
||||
+
|
||||
+ /* Describe CFI: Frame pointer is restored. */
|
||||
+ ".cfi_restore x29\n\t"
|
||||
+
|
||||
+ /* Clobber list: Specify all modified registers. */
|
||||
+ : /* No output operands. */
|
||||
+ : /* No input operands. */
|
||||
+ : "x29", "d0"
|
||||
+ );
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+main ()
|
||||
+{
|
||||
+ long result = test_function ();
|
||||
+ dummy ();
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.arch/aarch64-frameptr-vecreg-unwind.exp b/gdb/testsuite/gdb.arch/aarch64-frameptr-vecreg-unwind.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.arch/aarch64-frameptr-vecreg-unwind.exp
|
||||
@@ -0,0 +1,33 @@
|
||||
+# Copyright 2025 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+require is_aarch64_target
|
||||
+
|
||||
+standard_testfile
|
||||
+
|
||||
+if { [prepare_for_testing "failed to prepare" ${testfile} \
|
||||
+ "${srcfile}" {debug}] } {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+if {![runto_main]} {
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
+gdb_breakpoint [gdb_get_line_number "break-here"]
|
||||
+gdb_continue_to_breakpoint "break-here"
|
||||
+gdb_test "with confirm off --return -1" "result = test_function \\(\\);"
|
||||
+gdb_test "step" "dummy \\(\\);"
|
||||
+gdb_test "print result" "= -1"
|
||||
diff --git a/gdb/testsuite/gdb.arch/amd64-frameptr-vecreg-unwind.c b/gdb/testsuite/gdb.arch/amd64-frameptr-vecreg-unwind.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.arch/amd64-frameptr-vecreg-unwind.c
|
||||
@@ -0,0 +1,63 @@
|
||||
+/* Copyright 2025 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This file is part of GDB.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+volatile void dummy () {}
|
||||
+
|
||||
+long test_function(void)
|
||||
+{
|
||||
+ __asm__ volatile (
|
||||
+ /* Clear xmm0. */
|
||||
+ "vxorps %%xmm0, %%xmm0, %%xmm0\n\t"
|
||||
+
|
||||
+ /* Move the frame pointer (rbp) to xmm0. */
|
||||
+ "movq %%rbp, %%xmm0\n\t"
|
||||
+
|
||||
+ /* CFI: Frame pointer is in xmm0. */
|
||||
+ ".cfi_register %%rbp, %%xmm0\n\t"
|
||||
+
|
||||
+ /* Clobber list: Specify all modified registers */
|
||||
+ : // No output operands
|
||||
+ : // No input operands
|
||||
+ : "xmm0"
|
||||
+ );
|
||||
+
|
||||
+ dummy (); /* break-here */
|
||||
+
|
||||
+ /* Pseudo-epilogue: Restore rbp from xmm0. */
|
||||
+ __asm__ volatile (
|
||||
+ /* Restore rbp. */
|
||||
+ "movq %%xmm0, %%rbp\n\t"
|
||||
+
|
||||
+ /* Describe CFI: Frame pointer is restored. */
|
||||
+ ".cfi_restore %%rbp\n\t"
|
||||
+
|
||||
+ /* Clobber list: Specify all modified registers */
|
||||
+ : /* No output operands. */
|
||||
+ : /* No input operands. */
|
||||
+ : /* Despite clobbering rbp, gcc doesn't let us list it here. */
|
||||
+ );
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+main ()
|
||||
+{
|
||||
+ long result = test_function ();
|
||||
+ dummy ();
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.arch/amd64-frameptr-vecreg-unwind.exp b/gdb/testsuite/gdb.arch/amd64-frameptr-vecreg-unwind.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.arch/amd64-frameptr-vecreg-unwind.exp
|
||||
@@ -0,0 +1,40 @@
|
||||
+# Copyright 2025 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+# This test verifies that we can read and write the value of a pseudo register
|
||||
+# in unwound frames. For the test, we choose one raw register, rbx, and one
|
||||
+# pseudo register that is backed by rbx, ebx. We have two frames (the inner one,
|
||||
+# #0 and the outer one, #1) that each set a value for rbx. We verify that we
|
||||
+# can read both rbx and ebx correctly for each frame, and that when we write to
|
||||
+# ebx, rbx for that frame is correctly updated.
|
||||
+
|
||||
+require is_x86_64_m64_target
|
||||
+
|
||||
+standard_testfile
|
||||
+
|
||||
+if { [prepare_for_testing "failed to prepare" ${testfile} \
|
||||
+ "${srcfile}" {debug}] } {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+if {![runto_main]} {
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
+gdb_breakpoint [gdb_get_line_number "break-here"]
|
||||
+gdb_continue_to_breakpoint "break-here"
|
||||
+gdb_test "with confirm off --return -1" "result = test_function \\(\\);"
|
||||
+gdb_test "step" "dummy \\(\\);"
|
||||
+gdb_test "print result" "= -1"
|
||||
diff --git a/gdb/value.h b/gdb/value.h
|
||||
--- a/gdb/value.h
|
||||
+++ b/gdb/value.h
|
||||
@@ -1156,9 +1156,12 @@ extern struct value *address_of_variable (struct symbol *var,
|
||||
|
||||
extern value *value_of_register (int regnum, const frame_info_ptr &next_frame);
|
||||
|
||||
-/* Same as the above, but the value is not fetched. */
|
||||
+/* Same as the above, but the value is not fetched. If TYPE is
|
||||
+ non-nullptr, use it as the value type. Otherwise, 'register_type'
|
||||
+ will be used to obtain the type. */
|
||||
|
||||
-extern value *value_of_register_lazy (const frame_info_ptr &next_frame, int regnum);
|
||||
+extern value *value_of_register_lazy (const frame_info_ptr &next_frame,
|
||||
+ int regnum, struct type *type = nullptr);
|
||||
|
||||
/* Return the symbol's reading requirement. */
|
||||
|
||||
80
gdb-backport-tom-32688-thread-specific-bp-fix.patch
Normal file
80
gdb-backport-tom-32688-thread-specific-bp-fix.patch
Normal file
@ -0,0 +1,80 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Kevin Buettner <kevinb@redhat.com>
|
||||
Date: Wed, 21 Jan 2026 00:46:23 -0700
|
||||
Subject: gdb-backport-tom-32688-thread-specific-bp-fix.patch
|
||||
|
||||
;; Backport test fix for flaky thread-specific-bp.exp (Tom de Vries).
|
||||
|
||||
[gdb/testsuite] Yet another attempt to fix gdb.threads/thread-specific-bp.exp
|
||||
|
||||
When running test-case gdb.threads/thread-specific-bp.exp using taskset to
|
||||
select an Efficient-core in a loop, it fails 19 out of 100 runs.
|
||||
|
||||
For example, like this:
|
||||
...
|
||||
(gdb) continue -a^M
|
||||
Continuing.^M
|
||||
^M
|
||||
Thread 1 "thread-specific" hit Breakpoint 4, end () at thread-specific-bp.c:29^M
|
||||
29 }^M
|
||||
(gdb) FAIL: $exp: non_stop=on: continue to end
|
||||
[Thread 0x7ffff7cbe6c0 (LWP 2348848) exited]^M
|
||||
Thread-specific breakpoint 3 deleted - thread 2 no longer in the thread list.^M
|
||||
...
|
||||
|
||||
The way we're trying to match this gdb output is:
|
||||
...
|
||||
gdb_test_multiple "$cmd" "continue to end" {
|
||||
-re "$\r\n${gdb_prompt} .*${msg_re}\r\n" {
|
||||
pass $gdb_test_name
|
||||
}
|
||||
-re "\r\n${msg_re}\r\n.*$gdb_prompt " {
|
||||
pass $gdb_test_name
|
||||
}
|
||||
}
|
||||
...
|
||||
|
||||
The problem is that the two -re clauses above do not match the output ending
|
||||
in a prompt, so the default fail in gdb_test_multiple triggers.
|
||||
|
||||
Fix this by splitting this up in two gdb_test_multiple calls:
|
||||
- the first matches a prompt (with or without preceding $msg_re), making sure
|
||||
that the default fail doesn't trigger, and
|
||||
- the second matches $msg_re, if that was not already matched by the first call.
|
||||
|
||||
Using this approach, the test-case passes 100 out of 100 runs.
|
||||
|
||||
Tested on x86_64-linux, also with make-check-all.sh.
|
||||
|
||||
PR testsuite/32688
|
||||
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32688
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.threads/thread-specific-bp.exp b/gdb/testsuite/gdb.threads/thread-specific-bp.exp
|
||||
--- a/gdb/testsuite/gdb.threads/thread-specific-bp.exp
|
||||
+++ b/gdb/testsuite/gdb.threads/thread-specific-bp.exp
|
||||
@@ -95,12 +95,21 @@ proc check_thread_specific_breakpoint {non_stop} {
|
||||
"-" \
|
||||
"thread 2 no longer in the thread list\\."]]
|
||||
|
||||
- gdb_test_multiple "$cmd" "continue to end" {
|
||||
- -re "$\r\n${gdb_prompt} .*${msg_re}\r\n" {
|
||||
+ set test "continue to end"
|
||||
+ set try_again 0
|
||||
+ gdb_test_multiple $cmd $test -no-prompt-anchor {
|
||||
+ -re -wrap "\r\n${msg_re}(?=\r\n).*" {
|
||||
pass $gdb_test_name
|
||||
}
|
||||
- -re "\r\n${msg_re}\r\n.*$gdb_prompt " {
|
||||
- pass $gdb_test_name
|
||||
+ -re -wrap "" {
|
||||
+ set try_again 1
|
||||
+ }
|
||||
+ }
|
||||
+ if { $try_again } {
|
||||
+ gdb_test_multiple "" $test {
|
||||
+ -re "\r\n${msg_re}(?=\r\n)" {
|
||||
+ pass $gdb_test_name
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,23 +1,26 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Kevin Buettner <kevinb@redhat.com>
|
||||
Date: Wed, 7 Jan 2026 22:12:42 -0700
|
||||
Subject: gdb-rhbz2424325-c23-const-build-warnings.patch
|
||||
From: Keith Seitz <keiths@redhat.com>
|
||||
Date: Thu, 14 May 2026 10:15:24 -0700
|
||||
Subject: gdb-c23-fixes.patch
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
;; Backport Guinevere Larsen's build warning fixes (RH BZ 2424325).
|
||||
Fix even more -Wdiscarded-qualifers issues
|
||||
|
||||
bfd: fix build with C23
|
||||
Fedora Rawhide is failing to build due to new glibc header changes
|
||||
enforcing const-correctness in functions like strchr and memchr.
|
||||
For example:
|
||||
|
||||
Starting in C23, strchr and strrchr will return const char *, if fed a
|
||||
const char *. This means that several files in the BFD directory will
|
||||
fail to build as they are assigning the return of those functions to a
|
||||
char *.
|
||||
../../opcodes/aarch64-dis.c: In function ‘remove_dot_suffix’:
|
||||
../../opcodes/aarch64-dis.c:4027:7: error: assignment discards ‘const’ qualifier from po
|
||||
inter target type [-Werror=discarded-qualifiers]
|
||||
4027 | ptr = strchr (inst->opcode->name, '.');
|
||||
| ^
|
||||
cc1: all warnings being treated as errors
|
||||
|
||||
Fix this by const-ifying several variables. The only place where that
|
||||
wasn't just that was in targets.c, where a variable was being used in
|
||||
subsequent strrchr invocations to change the underlying string, so a new
|
||||
variable had to be introduced.
|
||||
|
||||
No user-visible change should happen after this commit.
|
||||
This patch addresses all the discovered issues with --enable-targets=all
|
||||
and regenerates a few cgen files along the way.
|
||||
|
||||
diff --git a/bfd/bfd.c b/bfd/bfd.c
|
||||
--- a/bfd/bfd.c
|
||||
@ -207,3 +210,105 @@ diff --git a/bfd/targets.c b/bfd/targets.c
|
||||
if (_bfd_find_arch_match (new_tname, arches,
|
||||
def_target_arch))
|
||||
break;
|
||||
diff --git a/cpu/ip2k.opc b/cpu/ip2k.opc
|
||||
--- a/cpu/ip2k.opc
|
||||
+++ b/cpu/ip2k.opc
|
||||
@@ -94,7 +94,7 @@ parse_fr (CGEN_CPU_DESC cd,
|
||||
{
|
||||
const char *errmsg;
|
||||
const char *old_strp;
|
||||
- char *afteroffset;
|
||||
+ const char *afteroffset;
|
||||
enum cgen_parse_operand_result result_type;
|
||||
bfd_vma value;
|
||||
extern CGEN_KEYWORD ip2k_cgen_opval_register_names;
|
||||
diff --git a/opcodes/aarch64-dis.c b/opcodes/aarch64-dis.c
|
||||
--- a/opcodes/aarch64-dis.c
|
||||
+++ b/opcodes/aarch64-dis.c
|
||||
@@ -4061,7 +4061,7 @@ print_operands (bfd_vma pc, const aarch64_opcode *opcode,
|
||||
static void
|
||||
remove_dot_suffix (char *name, const aarch64_inst *inst)
|
||||
{
|
||||
- char *ptr;
|
||||
+ const char *ptr;
|
||||
size_t len;
|
||||
|
||||
ptr = strchr (inst->opcode->name, '.');
|
||||
diff --git a/opcodes/ia64-opc.c b/opcodes/ia64-opc.c
|
||||
--- a/opcodes/ia64-opc.c
|
||||
+++ b/opcodes/ia64-opc.c
|
||||
@@ -66,7 +66,7 @@ const struct ia64_templ_desc ia64_templ_desc[16] =
|
||||
static void
|
||||
get_opc_prefix (const char **ptr, char *dest)
|
||||
{
|
||||
- char *c = strchr (*ptr, '.');
|
||||
+ const char *c = strchr (*ptr, '.');
|
||||
if (c != NULL)
|
||||
{
|
||||
memcpy (dest, *ptr, c - *ptr);
|
||||
diff --git a/opcodes/ip2k-asm.c b/opcodes/ip2k-asm.c
|
||||
--- a/opcodes/ip2k-asm.c
|
||||
+++ b/opcodes/ip2k-asm.c
|
||||
@@ -59,7 +59,7 @@ parse_fr (CGEN_CPU_DESC cd,
|
||||
{
|
||||
const char *errmsg;
|
||||
const char *old_strp;
|
||||
- char *afteroffset;
|
||||
+ const char *afteroffset;
|
||||
enum cgen_parse_operand_result result_type;
|
||||
bfd_vma value;
|
||||
extern CGEN_KEYWORD ip2k_cgen_opval_register_names;
|
||||
diff --git a/opcodes/riscv-dis.c b/opcodes/riscv-dis.c
|
||||
--- a/opcodes/riscv-dis.c
|
||||
+++ b/opcodes/riscv-dis.c
|
||||
@@ -110,7 +110,7 @@ parse_riscv_dis_option_without_args (const char *option,
|
||||
/* Parse RISC-V disassembler option (possibly with arguments). */
|
||||
|
||||
static void
|
||||
-parse_riscv_dis_option (const char *option, struct disassemble_info *info)
|
||||
+parse_riscv_dis_option (char *option, struct disassemble_info *info)
|
||||
{
|
||||
char *equal, *value;
|
||||
|
||||
@@ -1140,7 +1140,7 @@ riscv_update_map_state (int n,
|
||||
|
||||
/* ISA mapping string may be numbered, suffixed with '.n'. Do not
|
||||
consider this as part of the ISA string. */
|
||||
- char *suffix = strchr (name, '.');
|
||||
+ const char *suffix = strchr (name, '.');
|
||||
if (suffix)
|
||||
{
|
||||
int suffix_index = (int)(suffix - name);
|
||||
diff --git a/opcodes/tilegx-opc.c b/opcodes/tilegx-opc.c
|
||||
--- a/opcodes/tilegx-opc.c
|
||||
+++ b/opcodes/tilegx-opc.c
|
||||
@@ -8003,7 +8003,7 @@ tilegx_spr_compare (const void *a_ptr, const void *b_ptr)
|
||||
const char *
|
||||
get_tilegx_spr_name (int num)
|
||||
{
|
||||
- void *result;
|
||||
+ const void *result;
|
||||
struct tilegx_spr key;
|
||||
|
||||
key.number = num;
|
||||
diff --git a/opcodes/tilepro-opc.c b/opcodes/tilepro-opc.c
|
||||
--- a/opcodes/tilepro-opc.c
|
||||
+++ b/opcodes/tilepro-opc.c
|
||||
@@ -10119,7 +10119,7 @@ tilepro_spr_compare (const void *a_ptr, const void *b_ptr)
|
||||
const char *
|
||||
get_tilepro_spr_name (int num)
|
||||
{
|
||||
- void *result;
|
||||
+ const void *result;
|
||||
struct tilepro_spr key;
|
||||
|
||||
key.number = num;
|
||||
@@ -10131,7 +10131,7 @@ get_tilepro_spr_name (int num)
|
||||
return NULL;
|
||||
|
||||
{
|
||||
- struct tilepro_spr *result_ptr = (struct tilepro_spr *) result;
|
||||
+ const struct tilepro_spr *result_ptr = (const struct tilepro_spr *) result;
|
||||
|
||||
return result_ptr->name;
|
||||
}
|
||||
@ -1,11 +1,13 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Kevin Buettner <kevinb@redhat.com>
|
||||
Date: Wed, 25 Feb 2026 20:02:22 -0700
|
||||
Date: Wed, 25 Feb 2026 23:38:21 -0700
|
||||
Subject: gdb-fileio-test-fixes.patch
|
||||
|
||||
;; Backport of upstream commit d2cc16cd7fc from Jan Vrany fixing
|
||||
;; FAILs in gdb.base/fileio.exp caused by macro expansion of
|
||||
;; path components in OUTDIR.gdb/testsuite: fix FAILs in fileio.exp
|
||||
;; path components in OUTDIR.
|
||||
|
||||
gdb/testsuite: fix FAILs in fileio.exp
|
||||
|
||||
I'm experiencing intermittent FAILs in fileio.exp when running on (my)
|
||||
CI:
|
||||
|
||||
66
gdb-fix-odr-violations.patch
Normal file
66
gdb-fix-odr-violations.patch
Normal file
@ -0,0 +1,66 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Keith Seitz <keiths@redhat.com>
|
||||
Date: Thu, 14 May 2026 06:54:25 -0700
|
||||
Subject: gdb-fix-odr-violations.patch
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
regdat.sh: generate target_desc_up for register descriptions
|
||||
|
||||
Update regdat.sh so that generated init_registers_* code matches this
|
||||
newer const-unique_ptr-based target description API. This fixes recent ODR
|
||||
violations that have appeared (at least) on ppc64le:
|
||||
|
||||
CXXLD gdbserver
|
||||
../../src/gdbserver/../gdb/arch/ppc-linux-tdesc.h:46:29: error: ‘tdesc_powerpc_isa207_htm_vsx64l’ violates the C++ One Definition Rule [-Werror=odr]
|
||||
46 | extern const_target_desc_up tdesc_powerpc_isa207_htm_vsx64l;
|
||||
| ^
|
||||
powerpc-isa207-htm-vsx64l-generated.cc:26:27: note: ‘tdesc_powerpc_isa207_htm_vsx64l’ was previously declared here
|
||||
26 | const struct target_desc *tdesc_powerpc_isa207_htm_vsx64l;
|
||||
| ^
|
||||
powerpc-isa207-htm-vsx64l-generated.cc:26:27: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
|
||||
[snip]
|
||||
|
||||
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28444
|
||||
|
||||
diff --git a/gdb/regformats/regdat.sh b/gdb/regformats/regdat.sh
|
||||
--- a/gdb/regformats/regdat.sh
|
||||
+++ b/gdb/regformats/regdat.sh
|
||||
@@ -125,7 +125,7 @@ do
|
||||
if test "${type}" = "name"; then
|
||||
name="${entry}"
|
||||
|
||||
- echo "const struct target_desc *tdesc_${name};"
|
||||
+ echo "const_target_desc_up tdesc_${name};"
|
||||
echo ""
|
||||
|
||||
# This is necessary for -Wmissing-declarations.
|
||||
@@ -134,9 +134,8 @@ do
|
||||
echo "void"
|
||||
echo "init_registers_${name} (void)"
|
||||
echo "{"
|
||||
- echo " static struct target_desc tdesc_${name}_s;"
|
||||
- echo " struct target_desc *result = &tdesc_${name}_s;"
|
||||
- echo " struct tdesc_feature *feature = tdesc_create_feature (result, \"${name}\");"
|
||||
+ echo " target_desc_up result = allocate_target_description ();"
|
||||
+ echo " struct tdesc_feature *feature = tdesc_create_feature (result.get (), \"${name}\");"
|
||||
continue
|
||||
elif test "${type}" = "xmltarget"; then
|
||||
xmltarget="${entry}"
|
||||
@@ -195,12 +194,12 @@ echo
|
||||
osabi_enum=$(grep "${osabi}" "$2" | sed 's/.*(\([^,]\+\),.*/GDB_OSABI_\1/')
|
||||
|
||||
cat <<EOF
|
||||
- result->xmltarget = xmltarget_${name};
|
||||
+ result.get ()->xmltarget = xmltarget_${name};
|
||||
#endif
|
||||
|
||||
- init_target_desc (result, expedite_regs_${name}, ${osabi_enum});
|
||||
+ init_target_desc (result.get (), expedite_regs_${name}, ${osabi_enum});
|
||||
|
||||
- tdesc_${name} = result;
|
||||
+ tdesc_${name} = std::move (result);
|
||||
}
|
||||
EOF
|
||||
|
||||
@ -1,46 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Tom de Vries <tdevries@suse.de>
|
||||
Date: Fri, 20 Mar 2026 10:13:27 +0100
|
||||
Subject: gdb-fix-testsuite-newer-tcl.patch
|
||||
|
||||
;; Fix use of deprecated trace variable subcommand
|
||||
;; (Tom de Vries)
|
||||
|
||||
With Tcl 9.0, we get:
|
||||
...
|
||||
bad option "variable": must be add, info, or remove
|
||||
while executing
|
||||
"trace variable "boards_dir" w append_gdb_boards_dir"
|
||||
(file "lib/append_gdb_boards_dir.exp" line 48)
|
||||
...
|
||||
|
||||
The trace subcommand "trace variable <name> <ops> <command>" [1]:
|
||||
- is equivalent to "trace add variable <name> <ops> <command>"
|
||||
- is for backwards compatibility,
|
||||
- uses "an older syntax in which array, read, write, unset are replaced by a,
|
||||
r, w and u respectively",
|
||||
- has an ops argument which is "not a list, but simply a string concatenation
|
||||
of the operations", and
|
||||
- is "deprecated and will likely be removed in a future version of Tcl".
|
||||
|
||||
Fix this by using "trace add variable":
|
||||
...
|
||||
-trace variable "boards_dir" w append_gdb_boards_dir
|
||||
+trace add variable "boards_dir" {write} append_gdb_boards_dir
|
||||
...
|
||||
|
||||
Approved-By: Tom Tromey <tom@tromey.com>
|
||||
|
||||
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33948
|
||||
|
||||
[1] https://www.tcl-lang.org/man/tcl8.6/TclCmd/trace.htm#M27
|
||||
|
||||
diff --git a/gdb/testsuite/lib/append_gdb_boards_dir.exp b/gdb/testsuite/lib/append_gdb_boards_dir.exp
|
||||
--- a/gdb/testsuite/lib/append_gdb_boards_dir.exp
|
||||
+++ b/gdb/testsuite/lib/append_gdb_boards_dir.exp
|
||||
@@ -45,4 +45,4 @@ proc append_gdb_boards_dir { name1 name2 op } {
|
||||
}
|
||||
lappend boards_dir "${gdb_boards_dir}"
|
||||
}
|
||||
-trace variable "boards_dir" w append_gdb_boards_dir
|
||||
+trace add variable "boards_dir" {write} append_gdb_boards_dir
|
||||
@ -92,7 +92,7 @@ diff --git a/gdb/dwarf2/line-header.h b/gdb/dwarf2/line-header.h
|
||||
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
|
||||
--- a/gdb/dwarf2/read.c
|
||||
+++ b/gdb/dwarf2/read.c
|
||||
@@ -6222,8 +6222,8 @@ dwarf2_cu::setup_type_unit_groups (struct die_info *die)
|
||||
@@ -6227,8 +6227,8 @@ dwarf2_cu::setup_type_unit_groups (struct die_info *die)
|
||||
sf->symtab = allocate_symtab (cust, name, name_for_id);
|
||||
}
|
||||
|
||||
@ -103,7 +103,7 @@ diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -6241,7 +6241,7 @@ dwarf2_cu::setup_type_unit_groups (struct die_info *die)
|
||||
@@ -6246,7 +6246,7 @@ dwarf2_cu::setup_type_unit_groups (struct die_info *die)
|
||||
for (i = 0; i < file_names.size (); ++i)
|
||||
{
|
||||
file_entry &fe = file_names[i];
|
||||
@ -112,7 +112,7 @@ diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11584,7 +11584,7 @@ process_structure_scope (struct die_info *die, struct dwarf2_cu *cu)
|
||||
@@ -11589,7 +11589,7 @@ process_structure_scope (struct die_info *die, struct dwarf2_cu *cu)
|
||||
{
|
||||
/* Any related symtab will do. */
|
||||
symtab
|
||||
@ -121,7 +121,7 @@ diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -16587,6 +16587,9 @@ dwarf_decode_lines (struct line_header *lh, struct dwarf2_cu *cu,
|
||||
@@ -16592,6 +16592,9 @@ dwarf_decode_lines (struct line_header *lh, struct dwarf2_cu *cu,
|
||||
if (decode_mapping)
|
||||
dwarf_decode_lines_1 (lh, cu, lowpc);
|
||||
|
||||
@ -131,7 +131,7 @@ diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
|
||||
/* Make sure a symtab is created for every file, even files
|
||||
which contain only variables (i.e. no code with associated
|
||||
line numbers). */
|
||||
@@ -16602,7 +16605,7 @@ dwarf_decode_lines (struct line_header *lh, struct dwarf2_cu *cu,
|
||||
@@ -16607,7 +16610,7 @@ dwarf_decode_lines (struct line_header *lh, struct dwarf2_cu *cu,
|
||||
sf->symtab = allocate_symtab (cust, sf->name.c_str (),
|
||||
sf->name_for_id.c_str ());
|
||||
|
||||
@ -140,7 +140,7 @@ diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16879,7 +16882,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
|
||||
@@ -16884,7 +16887,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
|
||||
if (fe == NULL)
|
||||
complaint (_("file index out of range"));
|
||||
else
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Kevin Buettner <kevinb@redhat.com>
|
||||
Date: Wed, 25 Feb 2026 19:58:50 -0700
|
||||
Date: Wed, 25 Feb 2026 23:34:29 -0700
|
||||
Subject: gdb-rhbz2413405-gcore-unreadable-pages.patch
|
||||
|
||||
;; Backport of upstream commit c1da013915e from Kevin Buettner
|
||||
|
||||
@ -1,27 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Kevin Buettner <kevinb@redhat.com>
|
||||
Date: Wed, 7 Jan 2026 23:51:38 -0700
|
||||
Subject: gdb-rhbz2424325-c++20-implicit-lambda-capture.patch
|
||||
|
||||
;; Backport Tom de Vries fix regarding implicit lambda captures
|
||||
;; (RH BZ 2424325).
|
||||
|
||||
[gdb/build, c++20] Fix deprecated implicit capture in cooked_index::set_contents
|
||||
|
||||
Fix deprecated implicit capture of this in cooked_index::set_contents, by
|
||||
removing the capture default, and explicitly listing all captures.
|
||||
|
||||
Tested on x86_64-linux.
|
||||
|
||||
diff --git a/gdb/dwarf2/cooked-index.c b/gdb/dwarf2/cooked-index.c
|
||||
--- a/gdb/dwarf2/cooked-index.c
|
||||
+++ b/gdb/dwarf2/cooked-index.c
|
||||
@@ -102,7 +102,7 @@ cooked_index::set_contents ()
|
||||
{
|
||||
auto this_shard = shard.get ();
|
||||
const parent_map_map *parent_maps = m_state->get_parent_map_map ();
|
||||
- finalizers.add_task ([=] ()
|
||||
+ finalizers.add_task ([this, this_shard, parent_maps] ()
|
||||
{
|
||||
scoped_time_it time_it ("DWARF finalize worker",
|
||||
m_state->m_per_command_time);
|
||||
@ -1,175 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Keith Seitz <keiths@redhat.com>
|
||||
Date: Wed, 7 Jan 2026 09:36:28 -0800
|
||||
Subject: gdb-rhbz2424325-c23-more-const-fixes.patch
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
;; Backport Keith Seitz's C23 const-correctness fixes (pending upstream review).
|
||||
;; Mailing list: https://sourceware.org/pipermail/binutils/2026-January/...
|
||||
;; Posted 2026-01-07, not yet approved.
|
||||
|
||||
Fix some more C23 const-correctness issues
|
||||
|
||||
Fedora Rawhide is failing to build due to new glibc header changes
|
||||
enforcing const-correctness in functions like strchr and memchr.
|
||||
For example:
|
||||
|
||||
../../opcodes/aarch64-dis.c: In function ‘remove_dot_suffix’:
|
||||
../../opcodes/aarch64-dis.c:4027:7: error: assignment discards ‘const’ qualifier from po
|
||||
inter target type [-Werror=discarded-qualifiers]
|
||||
4027 | ptr = strchr (inst->opcode->name, '.');
|
||||
| ^
|
||||
cc1: all warnings being treated as errors
|
||||
|
||||
This patch addresses all the discovered issues with --enable-targets=all
|
||||
and regenerates a few cgen files along the way.
|
||||
|
||||
diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c
|
||||
--- a/bfd/elf32-arc.c
|
||||
+++ b/bfd/elf32-arc.c
|
||||
@@ -550,7 +550,7 @@ arc_extract_features (const char *p)
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE (bfd_feature_list); i++)
|
||||
{
|
||||
- char *t = strstr (p, bfd_feature_list[i].attr);
|
||||
+ const char *t = strstr (p, bfd_feature_list[i].attr);
|
||||
unsigned l = strlen (bfd_feature_list[i].attr);
|
||||
if ((t != NULL)
|
||||
&& (t[l] == ','
|
||||
diff --git a/bfd/vms-misc.c b/bfd/vms-misc.c
|
||||
--- a/bfd/vms-misc.c
|
||||
+++ b/bfd/vms-misc.c
|
||||
@@ -492,14 +492,14 @@ get_vms_time_string (unsigned char *tbuf)
|
||||
}
|
||||
|
||||
/* Create module name from filename (ie, extract the basename and convert it
|
||||
- in upper cases). Works on both VMS and UNIX pathes.
|
||||
+ in upper cases). Works on both VMS and UNIX paths.
|
||||
The result has to be free(). */
|
||||
|
||||
char *
|
||||
vms_get_module_name (const char *filename, bool upcase)
|
||||
{
|
||||
char *fname, *fptr;
|
||||
- const char *fout;
|
||||
+ const char *fout, *p;
|
||||
|
||||
/* Strip VMS path. */
|
||||
fout = strrchr (filename, ']');
|
||||
@@ -511,9 +511,9 @@ vms_get_module_name (const char *filename, bool upcase)
|
||||
fout = filename;
|
||||
|
||||
/* Strip UNIX path. */
|
||||
- fptr = strrchr (fout, '/');
|
||||
- if (fptr != NULL)
|
||||
- fout = fptr + 1;
|
||||
+ p = strrchr (fout, '/');
|
||||
+ if (p != NULL)
|
||||
+ fout = p + 1;
|
||||
|
||||
fname = strdup (fout);
|
||||
|
||||
diff --git a/cpu/ip2k.opc b/cpu/ip2k.opc
|
||||
--- a/cpu/ip2k.opc
|
||||
+++ b/cpu/ip2k.opc
|
||||
@@ -94,7 +94,7 @@ parse_fr (CGEN_CPU_DESC cd,
|
||||
{
|
||||
const char *errmsg;
|
||||
const char *old_strp;
|
||||
- char *afteroffset;
|
||||
+ const char *afteroffset;
|
||||
enum cgen_parse_operand_result result_type;
|
||||
bfd_vma value;
|
||||
extern CGEN_KEYWORD ip2k_cgen_opval_register_names;
|
||||
diff --git a/opcodes/aarch64-dis.c b/opcodes/aarch64-dis.c
|
||||
--- a/opcodes/aarch64-dis.c
|
||||
+++ b/opcodes/aarch64-dis.c
|
||||
@@ -4061,7 +4061,7 @@ print_operands (bfd_vma pc, const aarch64_opcode *opcode,
|
||||
static void
|
||||
remove_dot_suffix (char *name, const aarch64_inst *inst)
|
||||
{
|
||||
- char *ptr;
|
||||
+ const char *ptr;
|
||||
size_t len;
|
||||
|
||||
ptr = strchr (inst->opcode->name, '.');
|
||||
diff --git a/opcodes/ia64-opc.c b/opcodes/ia64-opc.c
|
||||
--- a/opcodes/ia64-opc.c
|
||||
+++ b/opcodes/ia64-opc.c
|
||||
@@ -66,7 +66,7 @@ const struct ia64_templ_desc ia64_templ_desc[16] =
|
||||
static void
|
||||
get_opc_prefix (const char **ptr, char *dest)
|
||||
{
|
||||
- char *c = strchr (*ptr, '.');
|
||||
+ const char *c = strchr (*ptr, '.');
|
||||
if (c != NULL)
|
||||
{
|
||||
memcpy (dest, *ptr, c - *ptr);
|
||||
diff --git a/opcodes/ip2k-asm.c b/opcodes/ip2k-asm.c
|
||||
--- a/opcodes/ip2k-asm.c
|
||||
+++ b/opcodes/ip2k-asm.c
|
||||
@@ -59,7 +59,7 @@ parse_fr (CGEN_CPU_DESC cd,
|
||||
{
|
||||
const char *errmsg;
|
||||
const char *old_strp;
|
||||
- char *afteroffset;
|
||||
+ const char *afteroffset;
|
||||
enum cgen_parse_operand_result result_type;
|
||||
bfd_vma value;
|
||||
extern CGEN_KEYWORD ip2k_cgen_opval_register_names;
|
||||
diff --git a/opcodes/riscv-dis.c b/opcodes/riscv-dis.c
|
||||
--- a/opcodes/riscv-dis.c
|
||||
+++ b/opcodes/riscv-dis.c
|
||||
@@ -110,7 +110,7 @@ parse_riscv_dis_option_without_args (const char *option,
|
||||
/* Parse RISC-V disassembler option (possibly with arguments). */
|
||||
|
||||
static void
|
||||
-parse_riscv_dis_option (const char *option, struct disassemble_info *info)
|
||||
+parse_riscv_dis_option (char *option, struct disassemble_info *info)
|
||||
{
|
||||
char *equal, *value;
|
||||
|
||||
@@ -1140,7 +1140,7 @@ riscv_update_map_state (int n,
|
||||
|
||||
/* ISA mapping string may be numbered, suffixed with '.n'. Do not
|
||||
consider this as part of the ISA string. */
|
||||
- char *suffix = strchr (name, '.');
|
||||
+ const char *suffix = strchr (name, '.');
|
||||
if (suffix)
|
||||
{
|
||||
int suffix_index = (int)(suffix - name);
|
||||
diff --git a/opcodes/tilegx-opc.c b/opcodes/tilegx-opc.c
|
||||
--- a/opcodes/tilegx-opc.c
|
||||
+++ b/opcodes/tilegx-opc.c
|
||||
@@ -8003,7 +8003,7 @@ tilegx_spr_compare (const void *a_ptr, const void *b_ptr)
|
||||
const char *
|
||||
get_tilegx_spr_name (int num)
|
||||
{
|
||||
- void *result;
|
||||
+ const void *result;
|
||||
struct tilegx_spr key;
|
||||
|
||||
key.number = num;
|
||||
diff --git a/opcodes/tilepro-opc.c b/opcodes/tilepro-opc.c
|
||||
--- a/opcodes/tilepro-opc.c
|
||||
+++ b/opcodes/tilepro-opc.c
|
||||
@@ -10119,7 +10119,7 @@ tilepro_spr_compare (const void *a_ptr, const void *b_ptr)
|
||||
const char *
|
||||
get_tilepro_spr_name (int num)
|
||||
{
|
||||
- void *result;
|
||||
+ const void *result;
|
||||
struct tilepro_spr key;
|
||||
|
||||
key.number = num;
|
||||
@@ -10131,7 +10131,7 @@ get_tilepro_spr_name (int num)
|
||||
return NULL;
|
||||
|
||||
{
|
||||
- struct tilepro_spr *result_ptr = (struct tilepro_spr *) result;
|
||||
+ const struct tilepro_spr *result_ptr = (const struct tilepro_spr *) result;
|
||||
|
||||
return result_ptr->name;
|
||||
}
|
||||
@ -1,138 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Burgess <aburgess@redhat.com>
|
||||
Date: Mon, 9 Feb 2026 16:31:23 +0000
|
||||
Subject: gdb-rhbz2435950-skip-revert.patch
|
||||
|
||||
;; Backport of upstream commit f08ffbbf2691bad2d5df660ee644647687775f0c
|
||||
;; Can be dropped on a rebase to gdb 17.2 or 18.1
|
||||
|
||||
Revert "skip -gfile: call fnmatch without FNM_FILE_NAME"
|
||||
|
||||
This reverts commit 02646a4c561ec88491114b87950cbb827c7d614c. See:
|
||||
|
||||
https://inbox.sourceware.org/gdb-patches/20260203185528.946918-1-guinevere@redhat.com
|
||||
|
||||
This commit introduced a non backward compatible change to how GDB
|
||||
handled skip files. Something like:
|
||||
|
||||
skip -gfile dir/*.c
|
||||
|
||||
no longer matches every file within 'dir/', but now matches every file
|
||||
in 'dir/' and within every sub-directory of 'dir/', which might not be
|
||||
what the user wanted.
|
||||
|
||||
The original intention behind the commit is solid, we just need to
|
||||
find a better implementation.
|
||||
|
||||
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33872
|
||||
|
||||
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
|
||||
--- a/gdb/doc/gdb.texinfo
|
||||
+++ b/gdb/doc/gdb.texinfo
|
||||
@@ -6825,9 +6825,7 @@ Functions in @var{file} will be skipped over when stepping.
|
||||
@itemx -gfi @var{file-glob-pattern}
|
||||
@cindex skipping over files via glob-style patterns
|
||||
Functions in files matching @var{file-glob-pattern} will be skipped
|
||||
-over when stepping. The directory separator character @file{/} is treated as a
|
||||
-regular character, so it can be matched by wildcard characters @file{*} and
|
||||
-@file{?}.
|
||||
+over when stepping.
|
||||
|
||||
@smallexample
|
||||
(@value{GDBP}) skip -gfi utils/*.c
|
||||
diff --git a/gdb/skip.c b/gdb/skip.c
|
||||
--- a/gdb/skip.c
|
||||
+++ b/gdb/skip.c
|
||||
@@ -531,7 +531,7 @@ skiplist_entry::do_skip_gfile_p (const symtab_and_line &function_sal) const
|
||||
/* Check first sole SYMTAB->FILENAME. It may not be a substring of
|
||||
symtab_to_fullname as it may contain "./" etc. */
|
||||
if (gdb_filename_fnmatch (m_file.c_str (), function_sal.symtab->filename,
|
||||
- FNM_NOESCAPE) == 0)
|
||||
+ FNM_FILE_NAME | FNM_NOESCAPE) == 0)
|
||||
result = true;
|
||||
|
||||
/* Before we invoke symtab_to_fullname, which is expensive, do a quick
|
||||
@@ -542,14 +542,14 @@ skiplist_entry::do_skip_gfile_p (const symtab_and_line &function_sal) const
|
||||
else if (!basenames_may_differ
|
||||
&& gdb_filename_fnmatch (lbasename (m_file.c_str ()),
|
||||
lbasename (function_sal.symtab->filename),
|
||||
- FNM_NOESCAPE) != 0)
|
||||
+ FNM_FILE_NAME | FNM_NOESCAPE) != 0)
|
||||
result = false;
|
||||
else
|
||||
{
|
||||
/* Note: symtab_to_fullname caches its result, thus we don't have to. */
|
||||
const char *fullname = symtab_to_fullname (function_sal.symtab);
|
||||
|
||||
- result = gdb_filename_fnmatch (m_file.c_str (), fullname, FNM_NOESCAPE);
|
||||
+ result = compare_glob_filenames_for_search (fullname, m_file.c_str ());
|
||||
}
|
||||
|
||||
if (debug_skip)
|
||||
diff --git a/gdb/symtab.c b/gdb/symtab.c
|
||||
--- a/gdb/symtab.c
|
||||
+++ b/gdb/symtab.c
|
||||
@@ -698,6 +698,40 @@ iterate_over_some_symtabs (const char *name,
|
||||
return false;
|
||||
}
|
||||
|
||||
+/* Same as compare_filenames_for_search, but for glob-style patterns.
|
||||
+ Heads up on the order of the arguments. They match the order of
|
||||
+ compare_filenames_for_search, but it's the opposite of the order of
|
||||
+ arguments to gdb_filename_fnmatch. */
|
||||
+
|
||||
+bool
|
||||
+compare_glob_filenames_for_search (const char *filename,
|
||||
+ const char *search_name)
|
||||
+{
|
||||
+ /* We rely on the property of glob-style patterns with FNM_FILE_NAME that
|
||||
+ all /s have to be explicitly specified. */
|
||||
+ int file_path_elements = count_path_elements (filename);
|
||||
+ int search_path_elements = count_path_elements (search_name);
|
||||
+
|
||||
+ if (search_path_elements > file_path_elements)
|
||||
+ return false;
|
||||
+
|
||||
+ if (IS_ABSOLUTE_PATH (search_name))
|
||||
+ {
|
||||
+ return (search_path_elements == file_path_elements
|
||||
+ && gdb_filename_fnmatch (search_name, filename,
|
||||
+ FNM_FILE_NAME | FNM_NOESCAPE) == 0);
|
||||
+ }
|
||||
+
|
||||
+ {
|
||||
+ const char *file_to_compare
|
||||
+ = strip_leading_path_elements (filename,
|
||||
+ file_path_elements - search_path_elements);
|
||||
+
|
||||
+ return gdb_filename_fnmatch (search_name, file_to_compare,
|
||||
+ FNM_FILE_NAME | FNM_NOESCAPE) == 0;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
/* See symtab.h. */
|
||||
|
||||
void
|
||||
diff --git a/gdb/utils.c b/gdb/utils.c
|
||||
--- a/gdb/utils.c
|
||||
+++ b/gdb/utils.c
|
||||
@@ -3466,8 +3466,8 @@ wait_to_die_with_timeout (pid_t pid, int *status, int timeout)
|
||||
|
||||
#endif /* HAVE_WAITPID */
|
||||
|
||||
-/* Provide fnmatch compatible function for matching of host files.
|
||||
- FNM_NOESCAPE must be set in FLAGS.
|
||||
+/* Provide fnmatch compatible function for FNM_FILE_NAME matching of host files.
|
||||
+ Both FNM_FILE_NAME and FNM_NOESCAPE must be set in FLAGS.
|
||||
|
||||
It handles correctly HAVE_DOS_BASED_FILE_SYSTEM and
|
||||
HAVE_CASE_INSENSITIVE_FILE_SYSTEM. */
|
||||
@@ -3475,6 +3475,8 @@ wait_to_die_with_timeout (pid_t pid, int *status, int timeout)
|
||||
int
|
||||
gdb_filename_fnmatch (const char *pattern, const char *string, int flags)
|
||||
{
|
||||
+ gdb_assert ((flags & FNM_FILE_NAME) != 0);
|
||||
+
|
||||
/* It is unclear how '\' escaping vs. directory separator should coexist. */
|
||||
gdb_assert ((flags & FNM_NOESCAPE) != 0);
|
||||
|
||||
@ -33,7 +33,7 @@ diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
|
||||
* Man Pages:: Manual pages
|
||||
* Copying:: GNU General Public License says
|
||||
how you can copy and share @value{GDBN}
|
||||
@@ -50988,6 +50989,111 @@ Show the current verbosity setting.
|
||||
@@ -50986,6 +50987,111 @@ Show the current verbosity setting.
|
||||
|
||||
@end table
|
||||
|
||||
|
||||
@ -1,157 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Kevin Buettner <kevinb@redhat.com>
|
||||
Date: Sun, 24 May 2026 21:02:34 -0700
|
||||
Subject: gdb-tcl9-utf8-encoding-fix.patch
|
||||
|
||||
;; Fix EILSEQ problems for UTF8 related tests when using expect
|
||||
;; enabled with Tcl 9 and full set of Tcl 9 compatibility fixes
|
||||
;; from upstream PR80674 branch. Required for testing GDB on
|
||||
;; Fedora 44 and rawhide (Fedora 45).
|
||||
;;
|
||||
;; At the time of this Fedora commit, this patch was not upstream yet.
|
||||
;; For its status, see:
|
||||
;;
|
||||
;; https://inbox.sourceware.org/gdb-patches/20260526192701.3835262-2-kevinb@redhat.com/T/#u
|
||||
|
||||
Fix EILSEQ problems for UTF8 related tests
|
||||
|
||||
On Fedora 44 and Rawhide (Fedora 45), these tests...
|
||||
|
||||
gdb.ada/non-ascii-utf-8.exp
|
||||
gdb.base/utf8-identifiers.exp
|
||||
gdb.rust/unicode.exp
|
||||
|
||||
...all die due to these errors:
|
||||
|
||||
Running ...gdb/testsuite/gdb.base/utf8-identifiers.exp ...
|
||||
ERROR: tcl error sourcing .../gdb/testsuite/gdb.base/utf8-identifiers.exp.
|
||||
ERROR: tcl error code POSIX EILSEQ {invalid or incomplete multibyte or wide character}
|
||||
error writing "file6": invalid or incomplete multibyte or wide character
|
||||
...
|
||||
|
||||
(I've shortened some of the pathnames for brevity.)
|
||||
|
||||
These Fedora systems are using Tcl 9 and also an updated version of
|
||||
dejagnu with this change applied:
|
||||
|
||||
* Thu Apr 16 2026 Jakub Jelinek <jakub@redhat.com> - 1:1.6.3-17
|
||||
- Apply full set of Tcl 9 compatibility fixes from upstream PR80674 branch
|
||||
(#2448542)
|
||||
|
||||
That runtest change is responsible for the POSIX EILSEQ errors on
|
||||
machines with that change. The change to runtest causing the change
|
||||
in behavior for GDB is the addition of these lines near the top of
|
||||
the runtest script:
|
||||
|
||||
# Ensure that DejaGnu will be run in the POSIX locale
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
Tcl 8 used a permissive encoding strategy: bytes that could not be
|
||||
represented in the current encoding were silently mangled or
|
||||
substituted. Tcl 9 changed this default to a strict profile, which
|
||||
means that any attempt to write a character that cannot be expressed
|
||||
in the channel's encoding raises a POSIX EILSEQ error ("invalid or
|
||||
incomplete multibyte or wide character").
|
||||
|
||||
So, together, this Tcl 9 behavior combined with the dejagnu change
|
||||
to runtest causes the EILSEQ error for the tests mentioned earlier.
|
||||
|
||||
Fix it by using "fconfigure $handle -encoding utf-8 -profile replace"
|
||||
in proc spawn_capture_tty_name, and proc gdb_stdin_log_init. Also,
|
||||
the open_logs wrapper has been changed to invoke fconfigure using only
|
||||
"-encoding utf-8". Testing showed that "-profile replace" wasn't
|
||||
necessary there.
|
||||
|
||||
Tested on Fedora 28 (Tcl 8.6.8), Fedora 43 (Tcl 9.0.2 / 8.6.16; expect
|
||||
uses 8.6.16), Fedora 44 (Tcl 9.0.2 / 8.6.17; expect uses 9.0.2), and
|
||||
Rawhide / Fedora 45 (Tcl 9.0.3 / 8.6.18; expect uses 9.0.3).
|
||||
|
||||
With regard to the Bug noted below, I haven't been able to reproduce
|
||||
the failures in gdb.ada/lazy-string.exp, but I've been informed that
|
||||
this commit fixes it.
|
||||
|
||||
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34146
|
||||
Reviewed-By: Tom de Vries <tdevries@suse.de>
|
||||
|
||||
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
|
||||
@@ -152,6 +152,35 @@ proc load_lib { file } {
|
||||
return $result
|
||||
}
|
||||
|
||||
+# Tcl 9.0 changed the default channel encoding profile to "strict".
|
||||
+# When runtest sets LC_ALL=C the system encoding is iso8859-1, so file
|
||||
+# channels opened by DejaGNU (gdb.sum, gdb.log) and spawn channels
|
||||
+# (for GDB and subprocesses) default to iso8859-1 with strict profile.
|
||||
+# Writing non-Latin-1 characters in test names then raises EILSEQ, and
|
||||
+# sending them to GDB truncates the command at the unrepresentable
|
||||
+# character.
|
||||
+#
|
||||
+# Fix this by:
|
||||
+# 1. Overriding open_logs to reconfigure gdb.sum to UTF-8 after
|
||||
+# DejaGNU opens it with the system (iso8859-1) encoding. Only
|
||||
+# "-encoding utf-8" is needed here, not "-profile replace". The
|
||||
+# test names written to gdb.sum are Unicode strings, and since
|
||||
+# UTF-8 can represent every Unicode character, the encode
|
||||
+# operation cannot fail. This use of "fconfigure" lacks a Tcl
|
||||
+# version guard since "-encoding utf-8" works in both Tcl 8 and
|
||||
+# Tcl 9. (Use of "-profile replace" requires a guard, as that
|
||||
+# option did not exist before Tcl 9.)
|
||||
+# 2. Reconfiguring each new spawn channel to UTF-8 and to also use
|
||||
+# "-profile replace" in spawn_capture_tty_name, which wraps every
|
||||
+# spawn call.
|
||||
+# 3. Likewise for gdb_stdin_log_init.
|
||||
+
|
||||
+rename open_logs saved_open_logs
|
||||
+proc open_logs {} {
|
||||
+ saved_open_logs
|
||||
+ fconfigure $::sum_file -encoding utf-8
|
||||
+}
|
||||
+
|
||||
load_lib libgloss.exp
|
||||
load_lib cache.exp
|
||||
load_lib gdb-utils.exp
|
||||
@@ -2685,6 +2714,7 @@ proc gdb_file_cmd { arg {kill_flag 1} } {
|
||||
proc spawn_capture_tty_name { args } {
|
||||
set result [uplevel builtin_spawn $args]
|
||||
upvar spawn_out spawn_out
|
||||
+ upvar spawn_id spawn_id
|
||||
if { [info exists spawn_out(slave,name)] } {
|
||||
set ::last_spawn_tty_name $spawn_out(slave,name)
|
||||
} else {
|
||||
@@ -2700,6 +2730,21 @@ proc spawn_capture_tty_name { args } {
|
||||
# use -nocomplain here we would otherwise get an error.
|
||||
unset -nocomplain ::last_spawn_tty_name
|
||||
}
|
||||
+ # Tcl 9.0 defaults spawn channels to iso8859-1/strict, which
|
||||
+ # raises EILSEQ when non-Latin-1 characters (e.g. identifiers
|
||||
+ # with UTF-8 letters) are written to or read from the channel.
|
||||
+ # Use utf-8 instead.
|
||||
+ #
|
||||
+ # "catch" is used here because, unlike the other sites in this
|
||||
+ # file where fconfigure is used, this use of fconfigure could
|
||||
+ # attempt to modify channels which do not support these options.
|
||||
+ # Those other sites use "fconfigure" on recently opened files
|
||||
+ # where it will almost certainly work. (And, for those other sites,
|
||||
+ # if it doesn't work, we want to be notified of that fact via the
|
||||
+ # normal Tcl error reporting mechanisms.)
|
||||
+ if {[tcl_version_at_least 9 0 0]} {
|
||||
+ catch {fconfigure $spawn_id -encoding utf-8 -profile replace}
|
||||
+ }
|
||||
return $result
|
||||
}
|
||||
|
||||
@@ -10387,6 +10432,11 @@ proc gdb_stdin_log_init { } {
|
||||
set logfile [standard_output_file_with_gdb_instance gdb.in]
|
||||
set in_file [open $logfile w]
|
||||
|
||||
+ if {[tcl_version_at_least 9 0 0]} {
|
||||
+ # Tcl 9 strict profile: gdb.in must accept UTF-8 command strings.
|
||||
+ fconfigure $in_file -encoding utf-8 -profile replace
|
||||
+ }
|
||||
+
|
||||
verbose -log ""
|
||||
verbose -log "Starting logfile: $logfile"
|
||||
verbose -log ""
|
||||
49
gdb.spec
49
gdb.spec
@ -51,7 +51,7 @@ Name: %{?scl_prefix}gdb
|
||||
# See timestamp of source gnulib installed into gnulib/ .
|
||||
%global snapgnulib 20220501
|
||||
%global tarname gdb-%{version}
|
||||
Version: 17.1
|
||||
Version: 17.2
|
||||
|
||||
# The release always contains a leading reserved number, start it at 1.
|
||||
# `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
|
||||
@ -152,7 +152,6 @@ Source4: gdbinit
|
||||
# Include the auto-generated file containing the "Patch:" directives.
|
||||
# See README.local-patches for more details.
|
||||
Source9998: _gdb.spec.Patch.include
|
||||
Source9999: _gdb.spec.patch.include
|
||||
%include %{SOURCE9998}
|
||||
|
||||
BuildRequires: readline-devel%{buildisa} >= 7.0
|
||||
@ -230,6 +229,14 @@ BuildRequires: %{?scl_testing_prefix}gcc %{?scl_testing_prefix}gcc-c++ %{?scl_te
|
||||
BuildRequires: gcc-objc
|
||||
%endif
|
||||
|
||||
# We don't support gcc-gdb-plugin on RHEL anymore.
|
||||
# Note: kevinb disabled this entirely, but we should probably just get rid of it.
|
||||
%if 0
|
||||
%if 0%{!?rhel:1}
|
||||
BuildRequires: gcc-gdb-plugin%{?_isa}
|
||||
%endif
|
||||
%endif
|
||||
|
||||
BuildRequires: systemtap-sdt-devel
|
||||
BuildRequires: opencl-headers ocl-icd-devel%{bits_local} ocl-icd-devel%{bits_other}
|
||||
|
||||
@ -314,7 +321,7 @@ machine than the one which is running the program being debugged.
|
||||
|
||||
%package doc
|
||||
Summary: Documentation for GDB (the GNU source-level debugger)
|
||||
License: GFDL-1.3-or-later
|
||||
License: GFDL
|
||||
BuildArch: noarch
|
||||
%if 0%{?scl:1}
|
||||
# As of F-28, packages won't need to call /sbin/install-info by hand
|
||||
@ -332,7 +339,7 @@ and printing their data.
|
||||
This package provides INFO, HTML and PDF user manual for GDB.
|
||||
|
||||
%prep
|
||||
%setup -q -n %{gdb_src}
|
||||
%autosetup -p1 -n %{gdb_src}
|
||||
|
||||
# Files have `# <number> <file>' statements breaking VPATH / find-debuginfo.sh .
|
||||
(cd gdb;rm -fv $(perl -pe 's/\\\n/ /' <Makefile.in|sed -n 's/^YYFILES = //p'))
|
||||
@ -341,12 +348,6 @@ This package provides INFO, HTML and PDF user manual for GDB.
|
||||
# we build in GDB_BUILD, just to be sure.
|
||||
find -name "*.info*"|xargs rm -f
|
||||
|
||||
# Apply patches defined on _gdb.spec.Patch.include
|
||||
|
||||
# Include the auto-generated patch directives.
|
||||
# See README.local-patches for more details.
|
||||
%include %{SOURCE9999}
|
||||
|
||||
find -name "*.orig" | xargs rm -f
|
||||
! find -name "*.rej" # Should not happen.
|
||||
|
||||
@ -942,6 +943,34 @@ fi
|
||||
# endif scl
|
||||
|
||||
%changelog
|
||||
* Thu Jul 30 2026 Keith Seitz <keiths@redhat.com> - 17.2-1.el8
|
||||
- Rebase to 17.2.
|
||||
(Keith Seitz, RHEL-221050)
|
||||
|
||||
* Wed Jul 22 2026 Guinevere Larsen <guinevere@redhat.com> - 17.2-3
|
||||
- Backport upstream commit f3ce0ce31fb3f056 to fix a regression on
|
||||
s390x.
|
||||
|
||||
* Wed Jul 8 2026 Andrew Burgess <aburgess@redhat.com>
|
||||
- Backport upstream commit 93f536d813c41527 to fix RHBZ 2498034. This
|
||||
commit will drop out when we rebase to GDB 18.
|
||||
|
||||
* Wed Jul 8 2026 Andrew Burgess <aburgess@redhat.com>
|
||||
- Backport upstream commit be3a9405ceb4d6d6 to fix and issue with the
|
||||
D demangler (RHBZ 2368350). This commit will drop out when we
|
||||
rebase to GDB 18.
|
||||
|
||||
* Wed Jul 8 2026 Andrew Burgess <aburgess@redhat.com>
|
||||
- Adjust commit message in gdb-backport-dap-core-file-support.patch to
|
||||
remove '---' string which confuses git.
|
||||
|
||||
* Fri Jul 03 2026 Michal Kolar <mkolar@redhat.com> - 17.2-1
|
||||
- Rebase to FSF GDB 17.2.
|
||||
Deleted: gdb-rhbz2435950-skip-revert.patch
|
||||
Backport e492fb22b70, gdb: backport DAP core file support
|
||||
Replace manual, multi-file patch inclusion with modern autosetup
|
||||
Add rpminspect.yaml to define package-specific testing policy
|
||||
|
||||
* Tue Jun 09 2026 Guinevere Larsen <guinevere@redhat.com> - 17.1-1
|
||||
- Initial import of sources
|
||||
Resolves: RHELMISC-29064
|
||||
|
||||
@ -69,10 +69,9 @@ common_ancestor=`git merge-base HEAD $commit_or_tag`
|
||||
test -z "$common_ancestor" && die "Could not find common ancestor between HEAD and $commit_or_tag."
|
||||
|
||||
temp_PATCH_file=/tmp/_gdb.spec.Patch.include
|
||||
temp_patch_file=/tmp/_gdb.spec.patch.include
|
||||
temp_patch_order_file=/tmp/_patch_order
|
||||
|
||||
rm -f $temp_PATCH_file $temp_patch_file $temp_patch_order_file
|
||||
rm -f $temp_PATCH_file $temp_patch_order_file
|
||||
|
||||
for c in `git rev-list --reverse ${common_ancestor}..HEAD` ; do
|
||||
fname=`git log -1 --pretty='format:%s' $c`
|
||||
@ -100,13 +99,11 @@ for c in `git rev-list --reverse ${common_ancestor}..HEAD` ; do
|
||||
`git log -1 --pretty='format:%b' $c | sed -n 's/^;;/#/p'`
|
||||
EOF
|
||||
printf "Patch%03d: %s\n\n" $idx $fname >> $temp_PATCH_file
|
||||
printf "%%patch -p1 -P%03d\n" $idx >> $temp_patch_file
|
||||
echo $fname >> $temp_patch_order_file
|
||||
idx=`expr $idx + 1`
|
||||
done
|
||||
|
||||
cd $orig_dir
|
||||
mv $temp_PATCH_file _gdb.spec.Patch.include
|
||||
mv $temp_patch_file _gdb.spec.patch.include
|
||||
mv $temp_patch_order_file _patch_order
|
||||
echo "$common_ancestor" > _git_upstream_commit
|
||||
|
||||
14
rpminspect.yaml
Normal file
14
rpminspect.yaml
Normal file
@ -0,0 +1,14 @@
|
||||
---
|
||||
|
||||
annocheck:
|
||||
jobs:
|
||||
|
||||
# --skip-lto
|
||||
# Disable Link-Time Optimization checks
|
||||
# Upstream GDB is not fully compatible with LTO
|
||||
#
|
||||
# --skip-stack-realign
|
||||
# Skip stack-realign test for i686
|
||||
# GDB code is compiled with -mstackrealign, but the binary links
|
||||
# against static code which was compiled without this flag
|
||||
- hardened: --skip-lto --skip-stack-realign
|
||||
2
sources
2
sources
@ -1 +1 @@
|
||||
SHA512 (gdb-17.1.tar.xz) = f1a6751e439a2128fecf3eae8b57c1608a0dc7cfe79b4356a937874e5a42bb2df0aba36eb6a9452c41966908b9a59076c7cad9720f684688ab956b65080f1d7c
|
||||
SHA512 (gdb-17.2.tar.xz) = 7794c5a185be7ed5e7ad1000c4ff7d8497c80425a1bc108aab8fd3dd8ecdde034e294dfd65b25c6b0dcd8ed2a240caf07293f3e73791b6cfc890d580d0af4581
|
||||
|
||||
Loading…
Reference in New Issue
Block a user