[packages/gdb] - updated to 12.1 - updated Fedora buildid and gstack patches - removed outdated x32 and vla-intel-*
qboosh
qboosh at pld-linux.org
Fri Jun 24 20:09:30 CEST 2022
commit 0e7ddf04c2f9c2b815faa1f7c5b4f64407523e81
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Fri Jun 24 20:11:00 2022 +0200
- updated to 12.1
- updated Fedora buildid and gstack patches
- removed outdated x32 and vla-intel-* patches
gdb-6.3-gstack-20050411.patch | 8 +-
gdb-6.6-buildid-locate-rpm-librpm-workaround.patch | 23 -
gdb-6.6-buildid-locate-rpm-scl.patch | 90 +--
gdb-6.6-buildid-locate-rpm.patch | 477 +---------------
gdb-6.6-buildid-locate-solib-missing-ids.patch | 4 +-
gdb-6.6-buildid-locate.patch | 633 ++++++++++++++++++---
gdb-readline.patch | 72 ++-
gdb-vla-intel-stringbt-fix.patch | 167 ------
gdb-vla-intel-tests.patch | 149 -----
gdb.spec | 41 +-
x32.patch | 18 -
11 files changed, 642 insertions(+), 1040 deletions(-)
---
diff --git a/gdb.spec b/gdb.spec
index 16468f9..ae71187 100644
--- a/gdb.spec
+++ b/gdb.spec
@@ -1,6 +1,7 @@
# NOTE: -lib package is used by fpc.spec
# TODO
+# - debuginfod (BR: elfutils-debuginfod-devel >= 0.179)
# - rpm5 librpm support (gdb/configure.ac checks for 4.x or so)
# - change install msg to poldek in buildid-locate-rpm-pld.patch when poldek allows it. LP#493922
# - reenable guile after https://sourceware.org/bugzilla/show_bug.cgi?id=21104 is fixed
@@ -21,16 +22,15 @@ Summary(uk.UTF-8): Символьний відладчик для С та інш
Summary(zh_CN.UTF-8): [开发]C和其他语言的调试器
Summary(zh_TW.UTF-8): [.-A開發]C和.$)B其.-A他語.$)B言的調試器
Name: gdb
-Version: 11.2
-Release: 2
+Version: 12.1
+Release: 1
License: GPL v3+
Group: Development/Debuggers
Source0: https://ftp.gnu.org/gnu/gdb/%{name}-%{version}.tar.xz
-# Source0-md5: 433bd0904caa31c247b1b1867f2f911d
+# Source0-md5: 759a1b8d2b4d403367dd0e14fa04643d
Source1: http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-non-english-man-pages.tar.bz2
# Source1-md5: 2e8a48939ae282c12bbacdd54e398247
Source3: %{name}-gstack.man
-Patch1: x32.patch
Patch100: gdb-6.6-buildid-locate.patch
Patch101: gdb-6.6-buildid-locate-solib-missing-ids.patch
Patch102: gdb-6.6-buildid-locate-rpm.patch
@@ -38,9 +38,6 @@ Patch104: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
Patch105: gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
Patch106: gdb-6.6-buildid-locate-rpm-scl.patch
Patch110: gdb-6.3-gstack-20050411.patch
-
-Patch114: gdb-vla-intel-stringbt-fix.patch
-Patch115: gdb-vla-intel-tests.patch
Patch1000: %{name}-readline.patch
Patch1001: %{name}-info.patch
Patch1002: %{name}-passflags.patch
@@ -49,8 +46,8 @@ Patch1006: buildid-locate-rpm-pld.patch
URL: http://www.gnu.org/software/gdb/
BuildRequires: autoconf >= 2.69
BuildRequires: automake
-BuildRequires: bison
BuildRequires: babeltrace-devel >= 1.1.0
+BuildRequires: bison
BuildRequires: expat-devel
BuildRequires: flex >= 2.6.4
BuildRequires: gettext-tools >= 0.12.1
@@ -65,12 +62,13 @@ BuildRequires: libipt-devel
BuildRequires: libmpc-devel
BuildRequires: libselinux-devel
BuildRequires: libstdc++-devel >= 6:4.8
-BuildRequires: libtool
+BuildRequires: libtool >= 2:2
BuildRequires: make >= 3.81
BuildRequires: mpfr-devel
BuildRequires: ncurses-devel >= 5.2
BuildRequires: pkgconfig
BuildRequires: readline-devel
+BuildRequires: rpm-devel >= 4.6
BuildRequires: rpmbuild(macros) >= 1.219
BuildRequires: source-highlight-devel >= 3.0
BuildRequires: tar >= 1:1.22
@@ -80,11 +78,11 @@ BuildRequires: xz
BuildRequires: xz-devel
BuildRequires: zlib-devel
%if %{with python}
-BuildRequires: python3-devel
+BuildRequires: python3-devel >= 1:3.2
BuildRequires: rpm-pythonprov
Obsoletes: python-gdb < 7.3
# for traceback module
-Requires: python3-modules
+Requires: python3-modules >= 1:3.2
%endif
%{?with_guile:Requires: guile >= 2.0.12}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -193,7 +191,6 @@ GDB w postaci biblioteki statycznej.
%{__rm} gdb/ada-exp.c gdb/ada-lex.c gdb/c-exp.c gdb/cp-name-parser.c gdb/f-exp.c
%{__rm} gdb/m2-exp.c gdb/p-exp.c
-%patch1 -p1
%patch100 -p1
%patch101 -p1
%patch102 -p1
@@ -202,9 +199,6 @@ GDB w postaci biblioteki statycznej.
%patch106 -p1
%patch110 -p1
-%patch114 -p1
-%patch115 -p1
-
%patch1000 -p1
%patch1001 -p1
%patch1002 -p1
@@ -216,18 +210,19 @@ cat > gdb/version.in << EOF
%{version}-%{release} (PLD Linux)
EOF
-sed -E -i -e '1s,#!\s*/usr/bin/env\s+python2(\s|$),#!%{__python}\1,' -e '1s,#!\s*/usr/bin/env\s+python(\s|$),#!%{__python3}\1,' -e '1s,#!\s*/usr/bin/python(\s|$),#!%{__python3}\1,' \
+%{__sed} -i -e '1s,/usr/bin/python$,%{__python},' \
contrib/dg-extract-results.py \
+
+%{__sed} -i -e '1s,/usr/bin/env python$,%{__python},' \
gdb/contrib/test_pubnames_and_indexes.py \
- gdb/testsuite/analyze-racy-logs.py \
gdb/testsuite/print-ts.py
-sed -E -i -e '1s,#!\s*/usr/bin/env\s+python3(\s|$),#!%{__python3}\1,' \
+%{__sed} -i -e '1s,/usr/bin/env python3,%{__python3},' \
+ gdb/testsuite/analyze-racy-logs.py \
gdb/copyright.py
-sed -E -i -e '1s,#!\s*/usr/bin/env\s+(.*),#!%{__bindir}\1,' \
+%{__sed} -i -e '1s,/usr/bin/env bash,/bin/bash,' \
gdb/contrib/cc-with-tweaks.sh \
- gdb/gcore \
gdb/gcore.in \
src-release.sh
@@ -328,7 +323,7 @@ cp -p build/libdecnumber/libdecnumber.a $RPM_BUILD_ROOT%{_libdir}
# Remove the files that are part of a gdb build but that are owned and provided by other packages.
# These are part of binutils:
%{__rm} $RPM_BUILD_ROOT%{_localedir}/*/LC_MESSAGES/{bfd,opcodes}.mo
-%{__rm} $RPM_BUILD_ROOT%{_infodir}/bfd.info*
+%{__rm} $RPM_BUILD_ROOT%{_infodir}/{bfd,ctf-spec}.info*
%{__rm} $RPM_BUILD_ROOT%{_includedir}/{ansidecl,bfd,bfdlink,ctf,ctf-api,diagnostics,dis-asm,symcat,plugin-api}.h
%{__rm} $RPM_BUILD_ROOT%{_libdir}/lib{bfd,ctf,ctf-nobfd,opcodes}.la
%{__rm} $RPM_BUILD_ROOT%{_libdir}/lib{bfd,ctf,ctf-nobfd,opcodes}.a
@@ -344,7 +339,7 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc gdb/{ChangeLog,NEWS,PROBLEMS,README}
+%doc gdb/{NEWS,PROBLEMS,README}
%attr(755,root,root) %{_bindir}/gdb
%attr(755,root,root) %{_bindir}/gdbtui
%attr(755,root,root) %{_bindir}/gdb-add-index
@@ -393,5 +388,3 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/libdecnumber.a
%{_libdir}/libgdb.a
%{_includedir}/gdb
-# -devel?
-%{_includedir}/sim
diff --git a/gdb-6.3-gstack-20050411.patch b/gdb-6.3-gstack-20050411.patch
index 35c2de1..6f6ecfb 100644
--- a/gdb-6.3-gstack-20050411.patch
+++ b/gdb-6.3-gstack-20050411.patch
@@ -16,7 +16,7 @@ Subject: gdb-6.3-gstack-20050411.patch
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
-@@ -1726,7 +1726,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force
+@@ -1767,7 +1767,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force
install: all
@$(MAKE) $(FLAGS_TO_PASS) install-only
@@ -25,7 +25,7 @@ diff --git a/gdb/Makefile.in b/gdb/Makefile.in
transformed_name=`t='$(program_transform_name)'; \
echo gdb | sed -e "$$t"` ; \
if test "x$$transformed_name" = x; then \
-@@ -1775,7 +1775,25 @@ install-guile:
+@@ -1816,7 +1816,25 @@ install-guile:
install-python:
$(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(GDB_DATADIR)/python/gdb
@@ -52,8 +52,8 @@ diff --git a/gdb/Makefile.in b/gdb/Makefile.in
transformed_name=`t='$(program_transform_name)'; \
echo gdb | sed -e $$t` ; \
if test "x$$transformed_name" = x; then \
-@@ -1798,6 +1816,18 @@ uninstall: force $(CONFIG_UNINSTALL)
- fi
+@@ -1847,6 +1865,18 @@ uninstall: force $(CONFIG_UNINSTALL)
+ rm -f $(DESTDIR)$(bindir)/$$transformed_name
@$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
+.PHONY: uninstall-gstack
diff --git a/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch b/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
index c86ec6b..2b862a0 100644
--- a/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
+++ b/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
@@ -6,29 +6,6 @@ Subject: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
;; Workaround librpm BZ 643031 due to its unexpected exit() calls (BZ 642879).
;;=push+jan
-diff --git a/gdb/build-id.c b/gdb/build-id.c
---- a/gdb/build-id.c
-+++ b/gdb/build-id.c
-@@ -708,6 +708,19 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
- #include <dlfcn.h>
- #endif
-
-+/* Workarodun https://bugzilla.redhat.com/show_bug.cgi?id=643031
-+ librpm must not exit() an application on SIGINT
-+
-+ Enable or disable a signal handler. SIGNUM: signal to enable (or disable
-+ if negative). HANDLER: sa_sigaction handler (or NULL to use
-+ rpmsqHandler()). Returns: no. of refs, -1 on error. */
-+extern int rpmsqEnable (int signum, /* rpmsqAction_t handler */ void *handler);
-+int
-+rpmsqEnable (int signum, /* rpmsqAction_t handler */ void *handler)
-+{
-+ return 0;
-+}
-+
- /* This MISSING_RPM_HASH tracker is used to collect all the missing rpm files
- and avoid their duplicities during a single inferior run. */
-
diff --git a/gdb/proc-service.list b/gdb/proc-service.list
--- a/gdb/proc-service.list
+++ b/gdb/proc-service.list
diff --git a/gdb-6.6-buildid-locate-rpm-scl.patch b/gdb-6.6-buildid-locate-rpm-scl.patch
index 947b855..7d4389a 100644
--- a/gdb-6.6-buildid-locate-rpm-scl.patch
+++ b/gdb-6.6-buildid-locate-rpm-scl.patch
@@ -9,96 +9,10 @@ Subject: gdb-6.6-buildid-locate-rpm-scl.patch
warning: Skipping deprecated .gdb_index section
https://bugzilla.redhat.com/show_bug.cgi?id=953585
-diff --git a/gdb/build-id.c b/gdb/build-id.c
---- a/gdb/build-id.c
-+++ b/gdb/build-id.c
-@@ -742,7 +742,11 @@ static int missing_rpm_list_entries;
- /* Returns the count of newly added rpms. */
-
- static int
-+#ifndef GDB_INDEX_VERIFY_VENDOR
- missing_rpm_enlist (const char *filename)
-+#else
-+missing_rpm_enlist_1 (const char *filename, int verify_vendor)
-+#endif
- {
- static int rpm_init_done = 0;
- rpmts ts;
-@@ -849,7 +853,11 @@ missing_rpm_enlist (const char *filename)
- mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0);
- if (mi != NULL)
- {
-+#ifndef GDB_INDEX_VERIFY_VENDOR
- for (;;)
-+#else
-+ if (!verify_vendor) for (;;)
-+#endif
- {
- Header h;
- char *debuginfo, **slot, *s, *s2;
-@@ -967,6 +975,37 @@ missing_rpm_enlist (const char *filename)
- xfree (debuginfo);
- count++;
- }
-+#ifdef GDB_INDEX_VERIFY_VENDOR
-+ else /* verify_vendor */
-+ {
-+ int vendor_pass = 0, vendor_fail = 0;
-+
-+ for (;;)
-+ {
-+ Header h;
-+ errmsg_t err;
-+ char *vendor;
-+
-+ h = rpmdbNextIterator_p (mi);
-+ if (h == NULL)
-+ break;
-+
-+ vendor = headerFormat_p (h, "%{vendor}", &err);
-+ if (!vendor)
-+ {
-+ warning (_("Error querying the rpm file `%s': %s"), filename,
-+ err);
-+ continue;
-+ }
-+ if (strcmp (vendor, "Red Hat, Inc.") == 0)
-+ vendor_pass = 1;
-+ else
-+ vendor_fail = 1;
-+ xfree (vendor);
-+ }
-+ count = vendor_pass != 0 && vendor_fail == 0;
-+ }
-+#endif
-
- rpmdbFreeIterator_p (mi);
- }
-@@ -976,6 +1015,20 @@ missing_rpm_enlist (const char *filename)
- return count;
- }
-
-+#ifdef GDB_INDEX_VERIFY_VENDOR
-+missing_rpm_enlist (const char *filename)
-+{
-+ return missing_rpm_enlist_1 (filename, 0);
-+}
-+
-+extern int rpm_verify_vendor (const char *filename);
-+int
-+rpm_verify_vendor (const char *filename)
-+{
-+ return missing_rpm_enlist_1 (filename, 1);
-+}
-+#endif
-+
- static bool
- missing_rpm_list_compar (const char *ap, const char *bp)
- {
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
-@@ -3022,6 +3022,16 @@ read_gdb_index_from_buffer (const char *filename,
+@@ -2797,6 +2797,16 @@ read_gdb_index_from_buffer (const char *filename,
"set use-deprecated-index-sections on". */
if (version < 6 && !deprecated_ok)
{
@@ -115,7 +29,7 @@ diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
static int warning_printed = 0;
if (!warning_printed)
{
-@@ -3033,6 +3043,10 @@ to use the section anyway."),
+@@ -2808,6 +2818,10 @@ to use the section anyway."),
warning_printed = 1;
}
return 0;
diff --git a/gdb-6.6-buildid-locate-rpm.patch b/gdb-6.6-buildid-locate-rpm.patch
index 4693f43..efaf989 100644
--- a/gdb-6.6-buildid-locate-rpm.patch
+++ b/gdb-6.6-buildid-locate-rpm.patch
@@ -232,457 +232,6 @@ diff --git a/gdb/aclocal.m4 b/gdb/aclocal.m4
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
-diff --git a/gdb/build-id.c b/gdb/build-id.c
---- a/gdb/build-id.c
-+++ b/gdb/build-id.c
-@@ -33,6 +33,7 @@
- #include "gdb_bfd.h"
- #include "gdbcmd.h"
- #include "gdbcore.h"
-+#include "inferior.h"
- #include "objfiles.h"
- #include "observable.h"
- #include "symfile.h"
-@@ -697,8 +698,374 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
- return result;
- }
-
-+#ifdef HAVE_LIBRPM
-+
-+#include <rpm/rpmlib.h>
-+#include <rpm/rpmts.h>
-+#include <rpm/rpmdb.h>
-+#include <rpm/header.h>
-+#ifdef DLOPEN_LIBRPM
-+#include <dlfcn.h>
-+#endif
-+
-+/* This MISSING_RPM_HASH tracker is used to collect all the missing rpm files
-+ and avoid their duplicities during a single inferior run. */
-+
-+static struct htab *missing_rpm_hash;
-+
-+/* This MISSING_RPM_LIST tracker is used to collect and print as a single line
-+ all the rpms right before the nearest GDB prompt. It gets cleared after
-+ each such print (it is questionable if we should clear it after the print).
-+ */
-+
-+struct missing_rpm
-+ {
-+ struct missing_rpm *next;
-+ char rpm[1];
-+ };
-+static struct missing_rpm *missing_rpm_list;
-+static int missing_rpm_list_entries;
-+
-+/* Returns the count of newly added rpms. */
-+
-+static int
-+missing_rpm_enlist (const char *filename)
-+{
-+ static int rpm_init_done = 0;
-+ rpmts ts;
-+ rpmdbMatchIterator mi;
-+ int count = 0;
-+
-+#ifdef DLOPEN_LIBRPM
-+ /* Duplicate here the declarations to verify they match. The same sanity
-+ check is present also in `configure.ac'. */
-+ extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
-+ static char *(*headerFormat_p) (Header h, const char * fmt, errmsg_t *errmsg);
-+ extern int rpmReadConfigFiles(const char * file, const char * target);
-+ static int (*rpmReadConfigFiles_p) (const char * file, const char * target);
-+ extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
-+ static rpmdbMatchIterator (*rpmdbFreeIterator_p) (rpmdbMatchIterator mi);
-+ extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
-+ static Header (*rpmdbNextIterator_p) (rpmdbMatchIterator mi);
-+ extern rpmts rpmtsCreate(void);
-+ static rpmts (*rpmtsCreate_p) (void);
-+ extern rpmts rpmtsFree(rpmts ts);
-+ static rpmts (*rpmtsFree_p) (rpmts ts);
-+ extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
-+ const void * keyp, size_t keylen);
-+ static rpmdbMatchIterator (*rpmtsInitIterator_p) (const rpmts ts,
-+ rpmTag rpmtag,
-+ const void *keyp,
-+ size_t keylen);
-+#else /* !DLOPEN_LIBRPM */
-+# define headerFormat_p headerFormat
-+# define rpmReadConfigFiles_p rpmReadConfigFiles
-+# define rpmdbFreeIterator_p rpmdbFreeIterator
-+# define rpmdbNextIterator_p rpmdbNextIterator
-+# define rpmtsCreate_p rpmtsCreate
-+# define rpmtsFree_p rpmtsFree
-+# define rpmtsInitIterator_p rpmtsInitIterator
-+#endif /* !DLOPEN_LIBRPM */
-+
-+ gdb_assert (filename != NULL);
-+
-+ if (strcmp (filename, BUILD_ID_MAIN_EXECUTABLE_FILENAME) == 0)
-+ return 0;
-+
-+ if (is_target_filename (filename))
-+ return 0;
-+
-+ if (filename[0] != '/')
-+ {
-+ warning (_("Ignoring non-absolute filename: <%s>"), filename);
-+ return 0;
-+ }
-+
-+ if (!rpm_init_done)
-+ {
-+ static int init_tried;
-+
-+ /* Already failed the initialization before? */
-+ if (init_tried)
-+ return 0;
-+ init_tried = 1;
-+
-+#ifdef DLOPEN_LIBRPM
-+ {
-+ void *h;
-+
-+ h = dlopen (DLOPEN_LIBRPM, RTLD_LAZY);
-+ if (!h)
-+ {
-+ warning (_("Unable to open \"%s\" (%s), "
-+ "missing debuginfos notifications will not be displayed"),
-+ DLOPEN_LIBRPM, dlerror ());
-+ return 0;
-+ }
-+
-+ if (!((headerFormat_p = (char *(*) (Header h, const char * fmt, errmsg_t *errmsg)) dlsym (h, "headerFormat"))
-+ && (rpmReadConfigFiles_p = (int (*) (const char * file, const char * target)) dlsym (h, "rpmReadConfigFiles"))
-+ && (rpmdbFreeIterator_p = (rpmdbMatchIterator (*) (rpmdbMatchIterator mi)) dlsym (h, "rpmdbFreeIterator"))
-+ && (rpmdbNextIterator_p = (Header (*) (rpmdbMatchIterator mi)) dlsym (h, "rpmdbNextIterator"))
-+ && (rpmtsCreate_p = (rpmts (*) (void)) dlsym (h, "rpmtsCreate"))
-+ && (rpmtsFree_p = (rpmts (*) (rpmts ts)) dlsym (h, "rpmtsFree"))
-+ && (rpmtsInitIterator_p = (rpmdbMatchIterator (*) (const rpmts ts, rpmTag rpmtag, const void *keyp, size_t keylen)) dlsym (h, "rpmtsInitIterator"))))
-+ {
-+ warning (_("Opened library \"%s\" is incompatible (%s), "
-+ "missing debuginfos notifications will not be displayed"),
-+ DLOPEN_LIBRPM, dlerror ());
-+ if (dlclose (h))
-+ warning (_("Error closing library \"%s\": %s\n"), DLOPEN_LIBRPM,
-+ dlerror ());
-+ return 0;
-+ }
-+ }
-+#endif /* DLOPEN_LIBRPM */
-+
-+ if (rpmReadConfigFiles_p (NULL, NULL) != 0)
-+ {
-+ warning (_("Error reading the rpm configuration files"));
-+ return 0;
-+ }
-+
-+ rpm_init_done = 1;
-+ }
-+
-+ ts = rpmtsCreate_p ();
-+
-+ mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0);
-+ if (mi != NULL)
-+ {
-+ for (;;)
-+ {
-+ Header h;
-+ char *debuginfo, **slot, *s, *s2;
-+ errmsg_t err;
-+ size_t srcrpmlen = sizeof (".src.rpm") - 1;
-+ size_t debuginfolen = sizeof ("-debuginfo") - 1;
-+ rpmdbMatchIterator mi_debuginfo;
-+
-+ h = rpmdbNextIterator_p (mi);
-+ if (h == NULL)
-+ break;
-+
-+ /* Verify the debuginfo file is not already installed. */
-+
-+ debuginfo = headerFormat_p (h, "%{sourcerpm}-debuginfo.%{arch}",
-+ &err);
-+ if (!debuginfo)
-+ {
-+ warning (_("Error querying the rpm file `%s': %s"), filename,
-+ err);
-+ continue;
-+ }
-+ /* s = `.src.rpm-debuginfo.%{arch}' */
-+ s = strrchr (debuginfo, '-') - srcrpmlen;
-+ s2 = NULL;
-+ if (s > debuginfo && memcmp (s, ".src.rpm", srcrpmlen) == 0)
-+ {
-+ /* s2 = `-%{release}.src.rpm-debuginfo.%{arch}' */
-+ s2 = (char *) memrchr (debuginfo, '-', s - debuginfo);
-+ }
-+ if (s2)
-+ {
-+ /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */
-+ s2 = (char *) memrchr (debuginfo, '-', s2 - debuginfo);
-+ }
-+ if (!s2)
-+ {
-+ warning (_("Error querying the rpm file `%s': %s"), filename,
-+ debuginfo);
-+ xfree (debuginfo);
-+ continue;
-+ }
-+ /* s = `.src.rpm-debuginfo.%{arch}' */
-+ /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */
-+ memmove (s2 + debuginfolen, s2, s - s2);
-+ memcpy (s2, "-debuginfo", debuginfolen);
-+ /* s = `XXXX.%{arch}' */
-+ /* strlen ("XXXX") == srcrpmlen + debuginfolen */
-+ /* s2 = `-debuginfo-%{version}-%{release}XX.%{arch}' */
-+ /* strlen ("XX") == srcrpmlen */
-+ memmove (s + debuginfolen, s + srcrpmlen + debuginfolen,
-+ strlen (s + srcrpmlen + debuginfolen) + 1);
-+ /* s = `-debuginfo-%{version}-%{release}.%{arch}' */
-+
-+ /* RPMDBI_PACKAGES requires keylen == sizeof (int). */
-+ /* RPMDBI_LABEL is an interface for NVR-based dbiFindByLabel(). */
-+ mi_debuginfo = rpmtsInitIterator_p (ts, (rpmTag) RPMDBI_LABEL, debuginfo, 0);
-+ xfree (debuginfo);
-+ if (mi_debuginfo)
-+ {
-+ rpmdbFreeIterator_p (mi_debuginfo);
-+ count = 0;
-+ break;
-+ }
-+
-+ /* The allocated memory gets utilized below for MISSING_RPM_HASH. */
-+ debuginfo = headerFormat_p (h,
-+ "%{name}-%{version}-%{release}.%{arch}",
-+ &err);
-+ if (!debuginfo)
-+ {
-+ warning (_("Error querying the rpm file `%s': %s"), filename,
-+ err);
-+ continue;
-+ }
-+
-+ /* Base package name for `debuginfo-install'. We do not use the
-+ `yum' command directly as the line
-+ yum --enablerepo='*debug*' install NAME-debuginfo.ARCH
-+ would be more complicated than just:
-+ debuginfo-install NAME-VERSION-RELEASE.ARCH
-+ Do not supply the rpm base name (derived from .src.rpm name) as
-+ debuginfo-install is unable to install the debuginfo package if
-+ the base name PKG binary rpm is not installed while for example
-+ PKG-libs would be installed (RH Bug 467901).
-+ FUTURE: After multiple debuginfo versions simultaneously installed
-+ get supported the support for the VERSION-RELEASE tags handling
-+ may need an update. */
-+
-+ if (missing_rpm_hash == NULL)
-+ {
-+ /* DEL_F is passed NULL as MISSING_RPM_LIST's HTAB_DELETE
-+ should not deallocate the entries. */
-+
-+ missing_rpm_hash = htab_create_alloc (64, htab_hash_string,
-+ (int (*) (const void *, const void *)) streq,
-+ NULL, xcalloc, xfree);
-+ }
-+ slot = (char **) htab_find_slot (missing_rpm_hash, debuginfo, INSERT);
-+ /* XCALLOC never returns NULL. */
-+ gdb_assert (slot != NULL);
-+ if (*slot == NULL)
-+ {
-+ struct missing_rpm *missing_rpm;
-+
-+ *slot = debuginfo;
-+
-+ missing_rpm = (struct missing_rpm *) xmalloc (sizeof (*missing_rpm) + strlen (debuginfo));
-+ strcpy (missing_rpm->rpm, debuginfo);
-+ missing_rpm->next = missing_rpm_list;
-+ missing_rpm_list = missing_rpm;
-+ missing_rpm_list_entries++;
-+ }
-+ else
-+ xfree (debuginfo);
-+ count++;
-+ }
-+
-+ rpmdbFreeIterator_p (mi);
-+ }
-+
-+ rpmtsFree_p (ts);
-+
-+ return count;
-+}
-+
-+static bool
-+missing_rpm_list_compar (const char *ap, const char *bp)
-+{
-+ return strcoll (ap, bp) < 0;
-+}
-+
-+/* It returns a NULL-terminated array of strings needing to be FREEd. It may
-+ also return only NULL. */
-+
-+static void
-+missing_rpm_list_print (void)
-+{
-+ struct missing_rpm *list_iter;
-+
-+ if (missing_rpm_list_entries == 0)
-+ return;
-+
-+ std::vector<const char *> array (missing_rpm_list_entries);
-+ size_t idx = 0;
-+
-+ for (list_iter = missing_rpm_list; list_iter != NULL;
-+ list_iter = list_iter->next)
-+ {
-+ array[idx++] = list_iter->rpm;
-+ }
-+ gdb_assert (idx == missing_rpm_list_entries);
-+
-+ std::sort (array.begin (), array.end (), missing_rpm_list_compar);
-+
-+ /* We zero out the number of missing RPMs here because of a nasty
-+ bug (see RHBZ 1801974).
-+
-+ When we call 'puts_unfiltered' below, if pagination is on and if
-+ the number of missing RPMs is big enough to trigger pagination,
-+ we will end up in an infinite recursion. The call chain looks
-+ like this:
-+
-+ missing_rpm_list_print -> puts_unfiltered -> fputs_maybe_filtered
-+ -> prompt_for_continue -> display_gdb_prompt ->
-+ debug_flush_missing -> missing_rpm_list_print ...
-+
-+ For this reason, we make sure MISSING_RPM_LIST_ENTRIES is zero
-+ *before* calling any print function. */
-+ missing_rpm_list_entries = 0;
-+
-+ printf_unfiltered (_("Missing separate debuginfos, use: %s"),
-+#ifdef DNF_DEBUGINFO_INSTALL
-+ "dnf "
-+#endif
-+ "debuginfo-install");
-+ for (const char *el : array)
-+ {
-+ puts_unfiltered (" ");
-+ puts_unfiltered (el);
-+ }
-+ puts_unfiltered ("\n");
-+
-+ while (missing_rpm_list != NULL)
-+ {
-+ list_iter = missing_rpm_list;
-+ missing_rpm_list = list_iter->next;
-+ xfree (list_iter);
-+ }
-+}
-+
-+static void
-+missing_rpm_change (void)
-+{
-+ debug_flush_missing ();
-+
-+ gdb_assert (missing_rpm_list == NULL);
-+ if (missing_rpm_hash != NULL)
-+ {
-+ htab_delete (missing_rpm_hash);
-+ missing_rpm_hash = NULL;
-+ }
-+}
-+
-+enum missing_exec
-+ {
-+ /* Init state. EXEC_BFD also still could be NULL. */
-+ MISSING_EXEC_NOT_TRIED,
-+ /* We saw a non-NULL EXEC_BFD but RPM has no info about it. */
-+ MISSING_EXEC_NOT_FOUND,
-+ /* We found EXEC_BFD by RPM and we either have its symbols (either embedded
-+ or separate) or the main executable's RPM is now contained in
-+ MISSING_RPM_HASH. */
-+ MISSING_EXEC_ENLISTED
-+ };
-+static enum missing_exec missing_exec = MISSING_EXEC_NOT_TRIED;
-+
-+#endif /* HAVE_LIBRPM */
-+
-+void
-+debug_flush_missing (void)
-+{
-+#ifdef HAVE_LIBRPM
-+ missing_rpm_list_print ();
-+#endif
-+}
-+
- /* This MISSING_FILEPAIR_HASH tracker is used only for the duplicite messages
-- Try to install the hash file ...
-+ yum --enablerepo='*debug*' install ...
- avoidance. */
-
- struct missing_filepair
-@@ -752,11 +1119,17 @@ missing_filepair_change (void)
- /* All their memory came just from missing_filepair_OBSTACK. */
- missing_filepair_hash = NULL;
- }
-+#ifdef HAVE_LIBRPM
-+ missing_exec = MISSING_EXEC_NOT_TRIED;
-+#endif
- }
-
- static void
- debug_print_executable_changed (void)
- {
-+#ifdef HAVE_LIBRPM
-+ missing_rpm_change ();
-+#endif
- missing_filepair_change ();
- }
-
-@@ -823,14 +1196,38 @@ debug_print_missing (const char *binary, const char *debug)
-
- *slot = missing_filepair;
-
-- /* We do not collect and flush these messages as each such message
-- already requires its own separate lines. */
-+#ifdef HAVE_LIBRPM
-+ if (missing_exec == MISSING_EXEC_NOT_TRIED)
-+ {
-+ const char *execfilename = get_exec_file (0);
-
-- fprintf_unfiltered (gdb_stdlog,
-- _("Missing separate debuginfo for %s\n"), binary);
-- if (debug != NULL)
-- fprintf_unfiltered (gdb_stdlog, _("Try to install the hash file %s\n"),
-- debug);
-+ if (execfilename != NULL)
-+ {
-+ if (missing_rpm_enlist (execfilename) == 0)
-+ missing_exec = MISSING_EXEC_NOT_FOUND;
-+ else
-+ missing_exec = MISSING_EXEC_ENLISTED;
-+ }
-+ }
-+ if (missing_exec != MISSING_EXEC_ENLISTED)
-+ if ((binary[0] == 0 || missing_rpm_enlist (binary) == 0)
-+ && (debug == NULL || missing_rpm_enlist (debug) == 0))
-+#endif /* HAVE_LIBRPM */
-+ {
-+ /* We do not collect and flush these messages as each such message
-+ already requires its own separate lines. */
-+
-+ fprintf_unfiltered (gdb_stdlog,
-+ _("Missing separate debuginfo for %s\n"), binary);
-+ if (debug != NULL)
-+ fprintf_unfiltered (gdb_stdlog, _("Try: %s %s\n"),
-+#ifdef DNF_DEBUGINFO_INSTALL
-+ "dnf"
-+#else
-+ "yum"
-+#endif
-+ " --enablerepo='*debug*' install", debug);
-+ }
- }
-
- /* See build-id.h. */
diff --git a/gdb/config.in b/gdb/config.in
--- a/gdb/config.in
+++ b/gdb/config.in
@@ -696,7 +245,7 @@ diff --git a/gdb/config.in b/gdb/config.in
/* Define to 1 if translation of program messages to the user's native
language is requested. */
#undef ENABLE_NLS
-@@ -246,6 +249,9 @@
+@@ -259,6 +262,9 @@
/* Define if you have the mpfr library. */
#undef HAVE_LIBMPFR
@@ -709,9 +258,9 @@ diff --git a/gdb/config.in b/gdb/config.in
diff --git a/gdb/configure b/gdb/configure
--- a/gdb/configure
+++ b/gdb/configure
-@@ -771,6 +771,11 @@ PKG_CONFIG
- HAVE_NATIVE_GCORE_TARGET
- TARGET_OBS
+@@ -775,6 +775,11 @@ TARGET_OBS
+ ENABLE_BFD_64_BIT_FALSE
+ ENABLE_BFD_64_BIT_TRUE
subdirs
+RPM_LIBS
+RPM_CFLAGS
@@ -721,7 +270,7 @@ diff --git a/gdb/configure b/gdb/configure
GDB_DATADIR
DEBUGDIR
MAKEINFO_EXTRA_FLAGS
-@@ -876,6 +881,7 @@ with_gdb_datadir
+@@ -880,6 +885,7 @@ with_gdb_datadir
with_relocated_sources
with_auto_load_dir
with_auto_load_safe_path
@@ -729,7 +278,7 @@ diff --git a/gdb/configure b/gdb/configure
enable_targets
enable_64_bit_bfd
enable_gdbmi
-@@ -953,6 +959,8 @@ PKG_CONFIG_PATH
+@@ -959,6 +965,8 @@ PKG_CONFIG_PATH
PKG_CONFIG_LIBDIR
DEBUGINFOD_CFLAGS
DEBUGINFOD_LIBS
@@ -738,7 +287,7 @@ diff --git a/gdb/configure b/gdb/configure
YACC
YFLAGS
XMKMF'
-@@ -1625,6 +1633,8 @@ Optional Packages:
+@@ -1635,6 +1643,8 @@ Optional Packages:
do not restrict auto-loaded files locations
--with-debuginfod Enable debuginfo lookups with debuginfod
(auto/yes/no)
@@ -747,7 +296,7 @@ diff --git a/gdb/configure b/gdb/configure
--with-libunwind-ia64 use libunwind frame unwinding for ia64 targets
--with-curses use the curses library instead of the termcap
library
-@@ -1705,6 +1715,8 @@ Some influential environment variables:
+@@ -1715,6 +1725,8 @@ Some influential environment variables:
C compiler flags for DEBUGINFOD, overriding pkg-config
DEBUGINFOD_LIBS
linker flags for DEBUGINFOD, overriding pkg-config
@@ -756,7 +305,7 @@ diff --git a/gdb/configure b/gdb/configure
YACC The `Yet Another Compiler Compiler' implementation to use.
Defaults to the first program found out of: `bison -y', `byacc',
`yacc'.
-@@ -6616,6 +6628,494 @@ _ACEOF
+@@ -6634,6 +6646,494 @@ _ACEOF
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_auto_load_safe_path" >&5
$as_echo "$with_auto_load_safe_path" >&6; }
@@ -1457,15 +1006,15 @@ diff --git a/gdb/configure.ac b/gdb/configure.ac
diff --git a/gdb/event-top.c b/gdb/event-top.c
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
-@@ -41,6 +41,7 @@
- #include "gdbsupport/gdb_select.h"
+@@ -42,6 +42,7 @@
#include "gdbsupport/gdb-sigmask.h"
#include "async-event.h"
+ #include "bt-utils.h"
+#include "symfile.h"
/* readline include files. */
#include "readline/readline.h"
-@@ -363,6 +364,8 @@ display_gdb_prompt (const char *new_prompt)
+@@ -374,6 +375,8 @@ display_gdb_prompt (const char *new_prompt)
/* Reset the nesting depth used when trace-commands is set. */
reset_command_nest_depth ();
@@ -1474,7 +1023,7 @@ diff --git a/gdb/event-top.c b/gdb/event-top.c
/* Do not call the python hook on an explicit prompt change as
passed to this function, as this forms a secondary/local prompt,
IE, displayed but not set. */
-@@ -773,7 +776,10 @@ command_line_handler (gdb::unique_xmalloc_ptr<char> &&rl)
+@@ -800,7 +803,10 @@ command_line_handler (gdb::unique_xmalloc_ptr<char> &&rl)
command_handler (cmd);
if (ui->prompt_state != PROMPTED)
diff --git a/gdb-6.6-buildid-locate-solib-missing-ids.patch b/gdb-6.6-buildid-locate-solib-missing-ids.patch
index 7dd4fb1..df45319 100644
--- a/gdb-6.6-buildid-locate-solib-missing-ids.patch
+++ b/gdb-6.6-buildid-locate-solib-missing-ids.patch
@@ -14,7 +14,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1339862
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
-@@ -1350,14 +1350,28 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm,
+@@ -1250,14 +1250,28 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm,
}
{
@@ -45,7 +45,7 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
if (build_id != NULL)
{
char *name, *build_id_filename;
-@@ -1372,23 +1386,7 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm,
+@@ -1272,23 +1286,7 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm,
xfree (name);
}
else
diff --git a/gdb-6.6-buildid-locate.patch b/gdb-6.6-buildid-locate.patch
index a463e37..6229244 100644
--- a/gdb-6.6-buildid-locate.patch
+++ b/gdb-6.6-buildid-locate.patch
@@ -33,7 +33,7 @@ diff --git a/bfd/libbfd.h b/bfd/libbfd.h
diff --git a/gdb/build-id.c b/gdb/build-id.c
--- a/gdb/build-id.c
+++ b/gdb/build-id.c
-@@ -24,13 +24,70 @@
+@@ -24,13 +24,71 @@
#include "gdbsupport/gdb_vecs.h"
#include "symfile.h"
#include "objfiles.h"
@@ -46,6 +46,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+#include "gdb_bfd.h"
+#include "gdbcmd.h"
#include "gdbcore.h"
++#include "inferior.h"
+#include "objfiles.h"
+#include "observable.h"
+#include "symfile.h"
@@ -105,7 +106,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
{
if (!bfd_check_format (abfd, bfd_object)
&& !bfd_check_format (abfd, bfd_core))
-@@ -43,6 +100,348 @@ build_id_bfd_get (bfd *abfd)
+@@ -43,6 +101,348 @@ build_id_bfd_get (bfd *abfd)
return NULL;
}
@@ -454,7 +455,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
/* See build-id.h. */
int
-@@ -51,7 +450,7 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check)
+@@ -51,7 +451,7 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check)
const struct bfd_build_id *found;
int retval = 0;
@@ -463,14 +464,15 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
if (found == NULL)
warning (_("File \"%s\" has no build-id, file skipped"),
-@@ -66,56 +465,159 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check)
+@@ -66,63 +466,166 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check)
return retval;
}
+static char *
+link_resolve (const char *symlink, int level)
+{
-+ char buf[PATH_MAX + 1], *target, *retval;
++ char buf[PATH_MAX + 1], *retval;
++ gdb::unique_xmalloc_ptr<char> target;
+ ssize_t got;
+
+ if (level > 10)
@@ -482,7 +484,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+ buf[got] = '\0';
+
+ if (IS_ABSOLUTE_PATH (buf))
-+ target = xstrdup (buf);
++ target = make_unique_xstrdup (buf);
+ else
+ {
+ const std::string dir (ldirname (symlink));
@@ -496,8 +498,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+ "%s", dir.c_str(), buf);
+ }
+
-+ retval = link_resolve (target, level + 1);
-+ xfree (target);
++ retval = link_resolve (target.get (), level + 1);
+ return retval;
+}
+
@@ -516,42 +517,49 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+
if (separate_debug_file_debug)
{
-- printf_unfiltered (_(" Trying %s..."), link.c_str ());
-+ printf_unfiltered (_(" Trying %s..."), orig_link.c_str ());
- gdb_flush (gdb_stdout);
+- fprintf_unfiltered (gdb_stdlog, _(" Trying %s..."), link.c_str ());
+- gdb_flush (gdb_stdlog);
++ fprintf_unfiltered (gdb_stdlog, _(" Trying %s..."), orig_link.c_str ());
++ gdb_flush (gdb_stdout);
}
- /* lrealpath() is expensive even for the usually non-existent files. */
-- gdb::unique_xmalloc_ptr<char> filename;
-- if (access (link.c_str (), F_OK) == 0)
-- filename.reset (lrealpath (link.c_str ()));
--
-- if (filename == NULL)
+- gdb::unique_xmalloc_ptr<char> filename_holder;
+- const char *filename = nullptr;
+- if (startswith (link, TARGET_SYSROOT_PREFIX))
+- filename = link.c_str ();
+- else if (access (link.c_str (), F_OK) == 0)
+ for (unsigned seqno = 0;; seqno++)
{
-- if (separate_debug_file_debug)
-- printf_unfiltered (_(" no, unable to compute real path\n"));
+- filename_holder.reset (lrealpath (link.c_str ()));
+- filename = filename_holder.get ();
+- }
+ std::string link = orig_link;
-- return {};
-- }
+- if (filename == NULL)
+- {
+- if (separate_debug_file_debug)
+- fprintf_unfiltered (gdb_stdlog,
+- _(" no, unable to compute real path\n"));
+ if (seqno > 0)
+ {
+ /* There can be multiple build-id symlinks pointing to real files
+ with the same build-id (such as hard links). Some of the real
+ files may not be installed. */
-+
+
+- return {};
+- }
+ string_appendf (link, ".%u", seqno);
+ }
- /* We expect to be silent on the non-existing files. */
-- gdb_bfd_ref_ptr debug_bfd = gdb_bfd_open (filename.get (), gnutarget);
+- gdb_bfd_ref_ptr debug_bfd = gdb_bfd_open (filename, gnutarget);
+ ret_link = link;
- if (debug_bfd == NULL)
- {
- if (separate_debug_file_debug)
-- printf_unfiltered (_(" no, unable to open.\n"));
+- fprintf_unfiltered (gdb_stdlog, _(" no, unable to open.\n"));
+ struct stat statbuf_trash;
+
+ /* `access' automatically dereferences LINK. */
@@ -562,35 +570,42 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+ }
+
+ /* lrealpath() is expensive even for the usually non-existent files. */
-+ gdb::unique_xmalloc_ptr<char> filename;
-+
-+ if (access (link.c_str (), F_OK) == 0)
-+ filename.reset (lrealpath (link.c_str ()));
++ gdb::unique_xmalloc_ptr<char> filename_holder;
++ const char *filename = nullptr;
++ if (startswith (link, TARGET_SYSROOT_PREFIX))
++ filename = link.c_str ();
++ else if (access (link.c_str (), F_OK) == 0)
++ {
++ filename_holder.reset (lrealpath (link.c_str ()));
++ filename = filename_holder.get ();
++ }
+
+ if (filename == NULL)
+ {
+ if (separate_debug_file_debug)
-+ printf_unfiltered (_(" no, unable to compute real path\n"));
++ fprintf_unfiltered (gdb_stdlog,
++ _(" no, unable to compute real path\n"));
+
+ continue;
+ }
+
+ /* We expect to be silent on the non-existing files. */
-+ gdb_bfd_ref_ptr debug_bfd = gdb_bfd_open (filename.get (), gnutarget, -1);
-
-- return {};
++ gdb_bfd_ref_ptr debug_bfd = gdb_bfd_open (filename, gnutarget);
++
+ if (debug_bfd == NULL)
+ {
+ if (separate_debug_file_debug)
-+ printf_unfiltered (_(" no, unable to open.\n"));
-+
++ fprintf_unfiltered (gdb_stdlog, _(" no, unable to open.\n"));
+
+- return {};
+ continue;
+ }
+
+ if (!build_id_verify (debug_bfd.get(), build_id_len, build_id))
+ {
+ if (separate_debug_file_debug)
-+ printf_unfiltered (_(" no, build-id does not match.\n"));
++ fprintf_unfiltered (gdb_stdlog,
++ _(" no, build-id does not match.\n"));
+
+ continue;
+ }
@@ -605,17 +620,16 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+ if (ret_bfd != NULL)
{
if (separate_debug_file_debug)
-- printf_unfiltered (_(" no, build-id does not match.\n"));
--
-- return {};
-+ printf_unfiltered (_(" yes!\n"));
+- fprintf_unfiltered (gdb_stdlog, _(" no, build-id does not match.\n"));
++ fprintf_unfiltered (gdb_stdlog, _(" yes!\n"));
+ }
+ else
+ {
+ /* If none of the real files is found report as missing file
+ always the non-.%u-suffixed file. */
+ std::string link0 = orig_link;
-+
+
+- return {};
+ /* If the symlink has target request to install the target.
+ BASE-debuginfo.rpm contains the symlink but BASE.rpm may be missing.
+ https://bugzilla.redhat.com/show_bug.cgi?id=981154 */
@@ -632,7 +646,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
}
- if (separate_debug_file_debug)
-- printf_unfiltered (_(" yes!\n"));
+- fprintf_unfiltered (gdb_stdlog, _(" yes!\n"));
+ if (link_return != NULL)
+ {
+ if (ret_bfd != NULL)
@@ -650,7 +664,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
}
/* Common code for finding BFDs of a given build-id. This function
-@@ -124,7 +626,7 @@ build_id_to_debug_bfd_1 (const std::string &link, size_t build_id_len,
+@@ -131,7 +634,7 @@ build_id_to_debug_bfd_1 (const std::string &link, size_t build_id_len,
static gdb_bfd_ref_ptr
build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id,
@@ -659,7 +673,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
{
/* Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will
cause "/.build-id/..." lookups. */
-@@ -147,16 +649,17 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id,
+@@ -154,16 +657,17 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id,
if (size > 0)
{
size--;
@@ -680,8 +694,8 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
if (debug_bfd != NULL)
return debug_bfd;
-@@ -170,7 +673,8 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id,
- if (strcmp (gdb_sysroot, TARGET_SYSROOT_PREFIX) != 0)
+@@ -174,7 +678,8 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id,
+ if (!gdb_sysroot.empty ())
{
link = gdb_sysroot + link;
- debug_bfd = build_id_to_debug_bfd_1 (link, build_id_len, build_id);
@@ -690,7 +704,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
if (debug_bfd != NULL)
return debug_bfd;
}
-@@ -179,38 +683,208 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id,
+@@ -183,30 +688,649 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id,
return {};
}
@@ -708,8 +722,440 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+ return result;
+}
+
++#ifdef HAVE_LIBRPM
++
++#include <rpm/rpmlib.h>
++#include <rpm/rpmts.h>
++#include <rpm/rpmdb.h>
++#include <rpm/header.h>
++#ifdef DLOPEN_LIBRPM
++#include <dlfcn.h>
++#endif
++
++/* Workarodun https://bugzilla.redhat.com/show_bug.cgi?id=643031
++ librpm must not exit() an application on SIGINT
++
++ Enable or disable a signal handler. SIGNUM: signal to enable (or disable
++ if negative). HANDLER: sa_sigaction handler (or NULL to use
++ rpmsqHandler()). Returns: no. of refs, -1 on error. */
++extern int rpmsqEnable (int signum, /* rpmsqAction_t handler */ void *handler);
++int
++rpmsqEnable (int signum, /* rpmsqAction_t handler */ void *handler)
++{
++ return 0;
++}
++
++/* This MISSING_RPM_HASH tracker is used to collect all the missing rpm files
++ and avoid their duplicities during a single inferior run. */
++
++static struct htab *missing_rpm_hash;
++
++/* This MISSING_RPM_LIST tracker is used to collect and print as a single line
++ all the rpms right before the nearest GDB prompt. It gets cleared after
++ each such print (it is questionable if we should clear it after the print).
++ */
++
++struct missing_rpm
++ {
++ struct missing_rpm *next;
++ char rpm[1];
++ };
++static struct missing_rpm *missing_rpm_list;
++static int missing_rpm_list_entries;
++
++/* Returns the count of newly added rpms. */
++
++static int
++#ifndef GDB_INDEX_VERIFY_VENDOR
++missing_rpm_enlist (const char *filename)
++#else
++missing_rpm_enlist_1 (const char *filename, int verify_vendor)
++#endif
++{
++ static int rpm_init_done = 0;
++ rpmts ts;
++ rpmdbMatchIterator mi;
++ int count = 0;
++
++#ifdef DLOPEN_LIBRPM
++ /* Duplicate here the declarations to verify they match. The same sanity
++ check is present also in `configure.ac'. */
++ extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
++ static char *(*headerFormat_p) (Header h, const char * fmt, errmsg_t *errmsg);
++ extern int rpmReadConfigFiles(const char * file, const char * target);
++ static int (*rpmReadConfigFiles_p) (const char * file, const char * target);
++ extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
++ static rpmdbMatchIterator (*rpmdbFreeIterator_p) (rpmdbMatchIterator mi);
++ extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
++ static Header (*rpmdbNextIterator_p) (rpmdbMatchIterator mi);
++ extern rpmts rpmtsCreate(void);
++ static rpmts (*rpmtsCreate_p) (void);
++ extern rpmts rpmtsFree(rpmts ts);
++ static rpmts (*rpmtsFree_p) (rpmts ts);
++ extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
++ const void * keyp, size_t keylen);
++ static rpmdbMatchIterator (*rpmtsInitIterator_p) (const rpmts ts,
++ rpmTag rpmtag,
++ const void *keyp,
++ size_t keylen);
++#else /* !DLOPEN_LIBRPM */
++# define headerFormat_p headerFormat
++# define rpmReadConfigFiles_p rpmReadConfigFiles
++# define rpmdbFreeIterator_p rpmdbFreeIterator
++# define rpmdbNextIterator_p rpmdbNextIterator
++# define rpmtsCreate_p rpmtsCreate
++# define rpmtsFree_p rpmtsFree
++# define rpmtsInitIterator_p rpmtsInitIterator
++#endif /* !DLOPEN_LIBRPM */
++
++ gdb_assert (filename != NULL);
++
++ if (strcmp (filename, BUILD_ID_MAIN_EXECUTABLE_FILENAME) == 0)
++ return 0;
++
++ if (is_target_filename (filename))
++ return 0;
++
++ if (filename[0] != '/')
++ {
++ warning (_("Ignoring non-absolute filename: <%s>"), filename);
++ return 0;
++ }
++
++ if (!rpm_init_done)
++ {
++ static int init_tried;
++
++ /* Already failed the initialization before? */
++ if (init_tried)
++ return 0;
++ init_tried = 1;
++
++#ifdef DLOPEN_LIBRPM
++ {
++ void *h;
++
++ h = dlopen (DLOPEN_LIBRPM, RTLD_LAZY);
++ if (!h)
++ {
++ warning (_("Unable to open \"%s\" (%s), "
++ "missing debuginfos notifications will not be displayed"),
++ DLOPEN_LIBRPM, dlerror ());
++ return 0;
++ }
++
++ if (!((headerFormat_p = (char *(*) (Header h, const char * fmt, errmsg_t *errmsg)) dlsym (h, "headerFormat"))
++ && (rpmReadConfigFiles_p = (int (*) (const char * file, const char * target)) dlsym (h, "rpmReadConfigFiles"))
++ && (rpmdbFreeIterator_p = (rpmdbMatchIterator (*) (rpmdbMatchIterator mi)) dlsym (h, "rpmdbFreeIterator"))
++ && (rpmdbNextIterator_p = (Header (*) (rpmdbMatchIterator mi)) dlsym (h, "rpmdbNextIterator"))
++ && (rpmtsCreate_p = (rpmts (*) (void)) dlsym (h, "rpmtsCreate"))
++ && (rpmtsFree_p = (rpmts (*) (rpmts ts)) dlsym (h, "rpmtsFree"))
++ && (rpmtsInitIterator_p = (rpmdbMatchIterator (*) (const rpmts ts, rpmTag rpmtag, const void *keyp, size_t keylen)) dlsym (h, "rpmtsInitIterator"))))
++ {
++ warning (_("Opened library \"%s\" is incompatible (%s), "
++ "missing debuginfos notifications will not be displayed"),
++ DLOPEN_LIBRPM, dlerror ());
++ if (dlclose (h))
++ warning (_("Error closing library \"%s\": %s\n"), DLOPEN_LIBRPM,
++ dlerror ());
++ return 0;
++ }
++ }
++#endif /* DLOPEN_LIBRPM */
++
++ if (rpmReadConfigFiles_p (NULL, NULL) != 0)
++ {
++ warning (_("Error reading the rpm configuration files"));
++ return 0;
++ }
++
++ rpm_init_done = 1;
++ }
++
++ ts = rpmtsCreate_p ();
++
++ mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0);
++ if (mi != NULL)
++ {
++#ifndef GDB_INDEX_VERIFY_VENDOR
++ for (;;)
++#else
++ if (!verify_vendor) for (;;)
++#endif
++ {
++ Header h;
++ char *debuginfo, **slot, *s, *s2;
++ errmsg_t err;
++ size_t srcrpmlen = sizeof (".src.rpm") - 1;
++ size_t debuginfolen = sizeof ("-debuginfo") - 1;
++ rpmdbMatchIterator mi_debuginfo;
++
++ h = rpmdbNextIterator_p (mi);
++ if (h == NULL)
++ break;
++
++ /* Verify the debuginfo file is not already installed. */
++
++ debuginfo = headerFormat_p (h, "%{sourcerpm}-debuginfo.%{arch}",
++ &err);
++ if (!debuginfo)
++ {
++ warning (_("Error querying the rpm file `%s': %s"), filename,
++ err);
++ continue;
++ }
++ /* s = `.src.rpm-debuginfo.%{arch}' */
++ s = strrchr (debuginfo, '-') - srcrpmlen;
++ s2 = NULL;
++ if (s > debuginfo && memcmp (s, ".src.rpm", srcrpmlen) == 0)
++ {
++ /* s2 = `-%{release}.src.rpm-debuginfo.%{arch}' */
++ s2 = (char *) memrchr (debuginfo, '-', s - debuginfo);
++ }
++ if (s2)
++ {
++ /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */
++ s2 = (char *) memrchr (debuginfo, '-', s2 - debuginfo);
++ }
++ if (!s2)
++ {
++ warning (_("Error querying the rpm file `%s': %s"), filename,
++ debuginfo);
++ xfree (debuginfo);
++ continue;
++ }
++ /* s = `.src.rpm-debuginfo.%{arch}' */
++ /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */
++ memmove (s2 + debuginfolen, s2, s - s2);
++ memcpy (s2, "-debuginfo", debuginfolen);
++ /* s = `XXXX.%{arch}' */
++ /* strlen ("XXXX") == srcrpmlen + debuginfolen */
++ /* s2 = `-debuginfo-%{version}-%{release}XX.%{arch}' */
++ /* strlen ("XX") == srcrpmlen */
++ memmove (s + debuginfolen, s + srcrpmlen + debuginfolen,
++ strlen (s + srcrpmlen + debuginfolen) + 1);
++ /* s = `-debuginfo-%{version}-%{release}.%{arch}' */
++
++ /* RPMDBI_PACKAGES requires keylen == sizeof (int). */
++ /* RPMDBI_LABEL is an interface for NVR-based dbiFindByLabel(). */
++ mi_debuginfo = rpmtsInitIterator_p (ts, (rpmTag) RPMDBI_LABEL, debuginfo, 0);
++ xfree (debuginfo);
++ if (mi_debuginfo)
++ {
++ rpmdbFreeIterator_p (mi_debuginfo);
++ count = 0;
++ break;
++ }
++
++ /* The allocated memory gets utilized below for MISSING_RPM_HASH. */
++ debuginfo = headerFormat_p (h,
++ "%{name}-%{version}-%{release}.%{arch}",
++ &err);
++ if (!debuginfo)
++ {
++ warning (_("Error querying the rpm file `%s': %s"), filename,
++ err);
++ continue;
++ }
++
++ /* Base package name for `debuginfo-install'. We do not use the
++ `yum' command directly as the line
++ yum --enablerepo='*debug*' install NAME-debuginfo.ARCH
++ would be more complicated than just:
++ debuginfo-install NAME-VERSION-RELEASE.ARCH
++ Do not supply the rpm base name (derived from .src.rpm name) as
++ debuginfo-install is unable to install the debuginfo package if
++ the base name PKG binary rpm is not installed while for example
++ PKG-libs would be installed (RH Bug 467901).
++ FUTURE: After multiple debuginfo versions simultaneously installed
++ get supported the support for the VERSION-RELEASE tags handling
++ may need an update. */
++
++ if (missing_rpm_hash == NULL)
++ {
++ /* DEL_F is passed NULL as MISSING_RPM_LIST's HTAB_DELETE
++ should not deallocate the entries. */
++
++ missing_rpm_hash = htab_create_alloc (64, htab_hash_string,
++ (int (*) (const void *, const void *)) streq,
++ NULL, xcalloc, xfree);
++ }
++ slot = (char **) htab_find_slot (missing_rpm_hash, debuginfo, INSERT);
++ /* XCALLOC never returns NULL. */
++ gdb_assert (slot != NULL);
++ if (*slot == NULL)
++ {
++ struct missing_rpm *missing_rpm;
++
++ *slot = debuginfo;
++
++ missing_rpm = (struct missing_rpm *) xmalloc (sizeof (*missing_rpm) + strlen (debuginfo));
++ strcpy (missing_rpm->rpm, debuginfo);
++ missing_rpm->next = missing_rpm_list;
++ missing_rpm_list = missing_rpm;
++ missing_rpm_list_entries++;
++ }
++ else
++ xfree (debuginfo);
++ count++;
++ }
++#ifdef GDB_INDEX_VERIFY_VENDOR
++ else /* verify_vendor */
++ {
++ int vendor_pass = 0, vendor_fail = 0;
++
++ for (;;)
++ {
++ Header h;
++ errmsg_t err;
++ char *vendor;
++
++ h = rpmdbNextIterator_p (mi);
++ if (h == NULL)
++ break;
++
++ vendor = headerFormat_p (h, "%{vendor}", &err);
++ if (!vendor)
++ {
++ warning (_("Error querying the rpm file `%s': %s"), filename,
++ err);
++ continue;
++ }
++ if (strcmp (vendor, "Red Hat, Inc.") == 0)
++ vendor_pass = 1;
++ else
++ vendor_fail = 1;
++ xfree (vendor);
++ }
++ count = vendor_pass != 0 && vendor_fail == 0;
++ }
++#endif
++
++ rpmdbFreeIterator_p (mi);
++ }
++
++ rpmtsFree_p (ts);
++
++ return count;
++}
++
++#ifdef GDB_INDEX_VERIFY_VENDOR
++missing_rpm_enlist (const char *filename)
++{
++ return missing_rpm_enlist_1 (filename, 0);
++}
++
++extern int rpm_verify_vendor (const char *filename);
++int
++rpm_verify_vendor (const char *filename)
++{
++ return missing_rpm_enlist_1 (filename, 1);
++}
++#endif
++
++static bool
++missing_rpm_list_compar (const char *ap, const char *bp)
++{
++ return strcoll (ap, bp) < 0;
++}
++
++/* It returns a NULL-terminated array of strings needing to be FREEd. It may
++ also return only NULL. */
++
++static void
++missing_rpm_list_print (void)
++{
++ struct missing_rpm *list_iter;
++
++ if (missing_rpm_list_entries == 0)
++ return;
++
++ std::vector<const char *> array (missing_rpm_list_entries);
++ size_t idx = 0;
++
++ for (list_iter = missing_rpm_list; list_iter != NULL;
++ list_iter = list_iter->next)
++ {
++ array[idx++] = list_iter->rpm;
++ }
++ gdb_assert (idx == missing_rpm_list_entries);
++
++ std::sort (array.begin (), array.end (), missing_rpm_list_compar);
++
++ /* We zero out the number of missing RPMs here because of a nasty
++ bug (see RHBZ 1801974).
++
++ When we call 'puts_unfiltered' below, if pagination is on and if
++ the number of missing RPMs is big enough to trigger pagination,
++ we will end up in an infinite recursion. The call chain looks
++ like this:
++
++ missing_rpm_list_print -> puts_unfiltered -> fputs_maybe_filtered
++ -> prompt_for_continue -> display_gdb_prompt ->
++ debug_flush_missing -> missing_rpm_list_print ...
++
++ For this reason, we make sure MISSING_RPM_LIST_ENTRIES is zero
++ *before* calling any print function. */
++ missing_rpm_list_entries = 0;
++
++ printf_unfiltered (_("Missing separate debuginfos, use: %s"),
++#ifdef DNF_DEBUGINFO_INSTALL
++ "dnf "
++#endif
++ "debuginfo-install");
++ for (const char *el : array)
++ {
++ puts_unfiltered (" ");
++ puts_unfiltered (el);
++ }
++ puts_unfiltered ("\n");
++
++ while (missing_rpm_list != NULL)
++ {
++ list_iter = missing_rpm_list;
++ missing_rpm_list = list_iter->next;
++ xfree (list_iter);
++ }
++}
++
++static void
++missing_rpm_change (void)
++{
++ debug_flush_missing ();
++
++ gdb_assert (missing_rpm_list == NULL);
++ if (missing_rpm_hash != NULL)
++ {
++ htab_delete (missing_rpm_hash);
++ missing_rpm_hash = NULL;
++ }
++}
++
++enum missing_exec
++ {
++ /* Init state. EXEC_BFD also still could be NULL. */
++ MISSING_EXEC_NOT_TRIED,
++ /* We saw a non-NULL EXEC_BFD but RPM has no info about it. */
++ MISSING_EXEC_NOT_FOUND,
++ /* We found EXEC_BFD by RPM and we either have its symbols (either embedded
++ or separate) or the main executable's RPM is now contained in
++ MISSING_RPM_HASH. */
++ MISSING_EXEC_ENLISTED
++ };
++static enum missing_exec missing_exec = MISSING_EXEC_NOT_TRIED;
++
++#endif /* HAVE_LIBRPM */
++
++void
++debug_flush_missing (void)
++{
++#ifdef HAVE_LIBRPM
++ missing_rpm_list_print ();
++#endif
++}
++
+/* This MISSING_FILEPAIR_HASH tracker is used only for the duplicite messages
-+ Try to install the hash file ...
++ yum --enablerepo='*debug*' install ...
+ avoidance. */
+
+struct missing_filepair
@@ -763,11 +1209,17 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+ /* All their memory came just from missing_filepair_OBSTACK. */
+ missing_filepair_hash = NULL;
+ }
++#ifdef HAVE_LIBRPM
++ missing_exec = MISSING_EXEC_NOT_TRIED;
++#endif
+}
+
+static void
+debug_print_executable_changed (void)
+{
++#ifdef HAVE_LIBRPM
++ missing_rpm_change ();
++#endif
+ missing_filepair_change ();
+}
+
@@ -834,14 +1286,38 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+
+ *slot = missing_filepair;
+
-+ /* We do not collect and flush these messages as each such message
-+ already requires its own separate lines. */
++#ifdef HAVE_LIBRPM
++ if (missing_exec == MISSING_EXEC_NOT_TRIED)
++ {
++ const char *execfilename = get_exec_file (0);
+
-+ fprintf_unfiltered (gdb_stdlog,
-+ _("Missing separate debuginfo for %s\n"), binary);
-+ if (debug != NULL)
-+ fprintf_unfiltered (gdb_stdlog, _("Try to install the hash file %s\n"),
-+ debug);
++ if (execfilename != NULL)
++ {
++ if (missing_rpm_enlist (execfilename) == 0)
++ missing_exec = MISSING_EXEC_NOT_FOUND;
++ else
++ missing_exec = MISSING_EXEC_ENLISTED;
++ }
++ }
++ if (missing_exec != MISSING_EXEC_ENLISTED)
++ if ((binary[0] == 0 || missing_rpm_enlist (binary) == 0)
++ && (debug == NULL || missing_rpm_enlist (debug) == 0))
++#endif /* HAVE_LIBRPM */
++ {
++ /* We do not collect and flush these messages as each such message
++ already requires its own separate lines. */
++
++ fprintf_unfiltered (gdb_stdlog,
++ _("Missing separate debuginfo for %s\n"), binary);
++ if (debug != NULL)
++ fprintf_unfiltered (gdb_stdlog, _("Try: %s %s\n"),
++#ifdef DNF_DEBUGINFO_INSTALL
++ "dnf"
++#else
++ "yum"
++#endif
++ " --enablerepo='*debug*' install", debug);
++ }
+}
+
/* See build-id.h. */
@@ -884,8 +1360,9 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
if (build_id != NULL)
{
if (separate_debug_file_debug)
- printf_unfiltered (_("\nLooking for separate debug info (build-id) for "
- "%s\n"), objfile_name (objfile));
+@@ -214,8 +1338,21 @@ find_separate_debug_file_by_buildid (struct objfile *objfile)
+ _("\nLooking for separate debug info (build-id) for "
+ "%s\n"), objfile_name (objfile));
+ char *build_id_filename_cstr = NULL;
gdb_bfd_ref_ptr abfd (build_id_to_debug_bfd (build_id->size,
@@ -906,15 +1383,15 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
/* Prevent looping on a stripped .debug file. */
if (abfd != NULL
&& filename_cmp (bfd_get_filename (abfd.get ()),
-@@ -223,3 +897,22 @@ find_separate_debug_file_by_buildid (struct objfile *objfile)
+@@ -228,3 +1365,22 @@ find_separate_debug_file_by_buildid (struct objfile *objfile)
return std::string ();
}
+
-+extern void _initialize_build_id (void);
++void _initialize_build_id ();
+
+void
-+_initialize_build_id (void)
++_initialize_build_id ()
+{
+ add_setshow_zinteger_cmd ("build-id-verbose", no_class, &build_id_verbose,
+ _("\
@@ -1056,7 +1533,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
-@@ -21415,6 +21415,27 @@ information files.
+@@ -21524,6 +21524,27 @@ information files.
@end table
@@ -1087,7 +1564,7 @@ diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
diff --git a/gdb/dwarf2/index-cache.c b/gdb/dwarf2/index-cache.c
--- a/gdb/dwarf2/index-cache.c
+++ b/gdb/dwarf2/index-cache.c
-@@ -95,7 +95,7 @@ index_cache::store (dwarf2_per_objfile *per_objfile)
+@@ -97,7 +97,7 @@ index_cache::store (dwarf2_per_objfile *per_objfile)
return;
/* Get build id of objfile. */
@@ -1095,8 +1572,8 @@ diff --git a/gdb/dwarf2/index-cache.c b/gdb/dwarf2/index-cache.c
+ const bfd_build_id *build_id = build_id_bfd_shdr_get (obj->obfd);
if (build_id == nullptr)
{
- if (debug_index_cache)
-@@ -113,7 +113,8 @@ index_cache::store (dwarf2_per_objfile *per_objfile)
+ index_cache_debug ("objfile %s has no build id",
+@@ -114,7 +114,8 @@ index_cache::store (dwarf2_per_objfile *per_objfile)
if (dwz != nullptr)
{
@@ -1109,7 +1586,7 @@ diff --git a/gdb/dwarf2/index-cache.c b/gdb/dwarf2/index-cache.c
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
-@@ -5447,7 +5447,7 @@ get_gdb_index_contents_from_section (objfile *obj, T *section_owner)
+@@ -5476,7 +5476,7 @@ get_gdb_index_contents_from_section (objfile *obj, T *section_owner)
static gdb::array_view<const gdb_byte>
get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_bfd *dwarf2_per_bfd)
{
@@ -1118,7 +1595,7 @@ diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
if (build_id == nullptr)
return {};
-@@ -5460,7 +5460,7 @@ get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_bfd *dwarf2_per_bfd)
+@@ -5489,7 +5489,7 @@ get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_bfd *dwarf2_per_bfd)
static gdb::array_view<const gdb_byte>
get_gdb_index_contents_from_cache_dwz (objfile *obj, dwz_file *dwz)
{
@@ -1130,7 +1607,7 @@ diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
diff --git a/gdb/elfread.c b/gdb/elfread.c
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
-@@ -1272,7 +1272,9 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
+@@ -1270,7 +1270,9 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
&& objfile->separate_debug_objfile == NULL
&& objfile->separate_debug_objfile_backlink == NULL)
{
@@ -1141,7 +1618,7 @@ diff --git a/gdb/elfread.c b/gdb/elfread.c
if (debugfile.empty ())
debugfile = find_separate_debug_file_by_debuglink (objfile);
-@@ -1287,7 +1289,7 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
+@@ -1285,7 +1287,7 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
else
{
has_dwarf2 = false;
@@ -1150,7 +1627,7 @@ diff --git a/gdb/elfread.c b/gdb/elfread.c
if (build_id != nullptr)
{
-@@ -1312,6 +1314,10 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
+@@ -1310,6 +1312,10 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
has_dwarf2 = true;
}
}
@@ -1164,7 +1641,7 @@ diff --git a/gdb/elfread.c b/gdb/elfread.c
diff --git a/gdb/exec.c b/gdb/exec.c
--- a/gdb/exec.c
+++ b/gdb/exec.c
-@@ -237,7 +237,7 @@ validate_exec_file (int from_tty)
+@@ -238,7 +238,7 @@ validate_exec_file (int from_tty)
current_exec_file = get_exec_file (0);
const bfd_build_id *exec_file_build_id
@@ -1173,7 +1650,7 @@ diff --git a/gdb/exec.c b/gdb/exec.c
if (exec_file_build_id != nullptr)
{
/* Prepend the target prefix, to force gdb_bfd_open to open the
-@@ -250,7 +250,7 @@ validate_exec_file (int from_tty)
+@@ -251,7 +251,7 @@ validate_exec_file (int from_tty)
if (abfd != nullptr)
{
const bfd_build_id *target_exec_file_build_id
@@ -1185,7 +1662,7 @@ diff --git a/gdb/exec.c b/gdb/exec.c
diff --git a/gdb/objfiles.h b/gdb/objfiles.h
--- a/gdb/objfiles.h
+++ b/gdb/objfiles.h
-@@ -812,6 +812,10 @@ struct objfile
+@@ -769,6 +769,10 @@ struct objfile
bool skip_jit_symbol_lookup = false;
};
@@ -1228,7 +1705,7 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
static struct link_map_offsets *svr4_fetch_link_map_offsets (void);
static int svr4_have_link_map_offsets (void);
-@@ -1348,9 +1349,51 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm,
+@@ -1248,9 +1249,51 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm,
continue;
}
@@ -1286,7 +1763,7 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
diff --git a/gdb/source.c b/gdb/source.c
--- a/gdb/source.c
+++ b/gdb/source.c
-@@ -1178,7 +1178,7 @@ open_source_file (struct symtab *s)
+@@ -1199,7 +1199,7 @@ open_source_file (struct symtab *s)
srcpath += s->filename;
}
@@ -1381,7 +1858,17 @@ diff --git a/gdb/testsuite/gdb.base/new-ui-pending-input.exp b/gdb/testsuite/gdb
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
-@@ -2130,6 +2130,17 @@ proc default_gdb_start { } {
+@@ -141,7 +141,8 @@ if ![info exists INTERNAL_GDBFLAGS] {
+ "-nx" \
+ "-data-directory $BUILD_DATA_DIRECTORY" \
+ {-iex "set height 0"} \
+- {-iex "set width 0"}]]
++ {-iex "set width 0"} \
++ {-iex "set build-id-verbose 0"}]]
+ }
+
+ # The variable gdb_prompt is a regexp which matches the gdb prompt.
+@@ -2200,6 +2201,17 @@ proc default_gdb_start { } {
}
}
diff --git a/gdb-readline.patch b/gdb-readline.patch
index 9346a85..1566be5 100644
--- a/gdb-readline.patch
+++ b/gdb-readline.patch
@@ -1,6 +1,6 @@
---- gdb-6.7.org/gdb/Makefile.in 2007-09-05 02:14:02.000000000 +0200
-+++ gdb-6.7/gdb/Makefile.in 2007-10-10 21:11:18.119976680 +0200
-@@ -175,11 +175,11 @@ LIBDECNUMBER_SRC = $(srcdir)/$(LIBDECNUM
+--- gdb-12.1/gdb/Makefile.in.orig 2022-06-23 22:08:57.971168251 +0200
++++ gdb-12.1/gdb/Makefile.in 2022-06-23 22:15:34.112355503 +0200
+@@ -180,11 +180,11 @@ LIBDECNUMBER_SRC = $(srcdir)/$(LIBDECNUM
LIBDECNUMBER_CFLAGS = -I$(LIBDECNUMBER_DIR) -I$(LIBDECNUMBER_SRC)
# Where is the READLINE library? Typically in ../readline/readline.
@@ -17,18 +17,18 @@
# Where is expat? This will be empty if expat was not available.
LIBEXPAT = @LIBEXPAT@
-@@ -613,7 +613,7 @@ CLIBS = $(SIM) $(READLINE) $(OPCODES) $(
+@@ -652,7 +652,7 @@ CLIBS = $(SIM) $(READLINE) $(OPCODES) $(
$(WIN32LIBS) $(LIBGNU) $(LIBGNU_EXTRA_LIBS) $(LIBICONV) \
$(LIBMPFR) $(LIBGMP) $(SRCHIGH_LIBS) $(LIBXXHASH) $(PTHREAD_LIBS) \
- $(DEBUGINFOD_LIBS)
+ $(DEBUGINFOD_LIBS) $(LIBBABELTRACE_LIB)
-CDEPS = $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE_DEPS) $(CTF_DEPS) \
+CDEPS = $(NAT_CDEPS) $(SIM) $(BFD) $(CTF_DEPS) \
$(OPCODES) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS) $(LIBGNU) \
$(LIBSUPPORT)
---- gdb-7.4.50.20120120/Makefile.in.orig 2012-01-20 02:48:18.000000000 +0100
-+++ gdb-7.4.50.20120120/Makefile.in 2012-03-17 10:35:14.194730128 +0100
-@@ -922,7 +922,6 @@
+--- gdb-12.1/Makefile.in.orig 2022-05-01 20:47:43.000000000 +0200
++++ gdb-12.1/Makefile.in 2022-06-23 22:06:05.298770364 +0200
+@@ -1087,7 +1087,6 @@ configure-host: \
maybe-configure-libiberty-linker-plugin \
maybe-configure-libiconv \
maybe-configure-m4 \
@@ -36,7 +36,15 @@
maybe-configure-sid \
maybe-configure-sim \
maybe-configure-texinfo \
-@@ -1149,7 +1148,6 @@
+@@ -1261,7 +1260,6 @@ all-host: maybe-all-libiberty-linker-plu
+ all-host: maybe-all-libiconv
+ @endif libiconv-no-bootstrap
+ all-host: maybe-all-m4
+-all-host: maybe-all-readline
+ all-host: maybe-all-sid
+ all-host: maybe-all-sim
+ all-host: maybe-all-texinfo
+@@ -1373,7 +1371,6 @@ info-host: maybe-info-libiberty
info-host: maybe-info-libiberty-linker-plugin
info-host: maybe-info-libiconv
info-host: maybe-info-m4
@@ -44,7 +52,7 @@
info-host: maybe-info-sid
info-host: maybe-info-sim
info-host: maybe-info-texinfo
-@@ -1226,7 +1224,6 @@
+@@ -1464,7 +1461,6 @@ dvi-host: maybe-dvi-libiberty
dvi-host: maybe-dvi-libiberty-linker-plugin
dvi-host: maybe-dvi-libiconv
dvi-host: maybe-dvi-m4
@@ -52,7 +60,7 @@
dvi-host: maybe-dvi-sid
dvi-host: maybe-dvi-sim
dvi-host: maybe-dvi-texinfo
-@@ -1303,7 +1300,6 @@
+@@ -1555,7 +1551,6 @@ pdf-host: maybe-pdf-libiberty
pdf-host: maybe-pdf-libiberty-linker-plugin
pdf-host: maybe-pdf-libiconv
pdf-host: maybe-pdf-m4
@@ -60,7 +68,7 @@
pdf-host: maybe-pdf-sid
pdf-host: maybe-pdf-sim
pdf-host: maybe-pdf-texinfo
-@@ -1380,7 +1376,6 @@
+@@ -1646,7 +1641,6 @@ html-host: maybe-html-libiberty
html-host: maybe-html-libiberty-linker-plugin
html-host: maybe-html-libiconv
html-host: maybe-html-m4
@@ -68,7 +76,7 @@
html-host: maybe-html-sid
html-host: maybe-html-sim
html-host: maybe-html-texinfo
-@@ -1457,7 +1452,6 @@
+@@ -1737,7 +1731,6 @@ TAGS-host: maybe-TAGS-libiberty
TAGS-host: maybe-TAGS-libiberty-linker-plugin
TAGS-host: maybe-TAGS-libiconv
TAGS-host: maybe-TAGS-m4
@@ -76,7 +84,7 @@
TAGS-host: maybe-TAGS-sid
TAGS-host: maybe-TAGS-sim
TAGS-host: maybe-TAGS-texinfo
-@@ -1534,7 +1528,6 @@
+@@ -1828,7 +1821,6 @@ install-info-host: maybe-install-info-li
install-info-host: maybe-install-info-libiberty-linker-plugin
install-info-host: maybe-install-info-libiconv
install-info-host: maybe-install-info-m4
@@ -84,7 +92,15 @@
install-info-host: maybe-install-info-sid
install-info-host: maybe-install-info-sim
install-info-host: maybe-install-info-texinfo
-@@ -1611,7 +1604,6 @@
+@@ -1919,7 +1911,6 @@ install-dvi-host: maybe-install-dvi-libi
+ install-dvi-host: maybe-install-dvi-libiberty-linker-plugin
+ install-dvi-host: maybe-install-dvi-libiconv
+ install-dvi-host: maybe-install-dvi-m4
+-install-dvi-host: maybe-install-dvi-readline
+ install-dvi-host: maybe-install-dvi-sid
+ install-dvi-host: maybe-install-dvi-sim
+ install-dvi-host: maybe-install-dvi-texinfo
+@@ -2010,7 +2001,6 @@ install-pdf-host: maybe-install-pdf-libi
install-pdf-host: maybe-install-pdf-libiberty-linker-plugin
install-pdf-host: maybe-install-pdf-libiconv
install-pdf-host: maybe-install-pdf-m4
@@ -92,7 +108,7 @@
install-pdf-host: maybe-install-pdf-sid
install-pdf-host: maybe-install-pdf-sim
install-pdf-host: maybe-install-pdf-texinfo
-@@ -1688,7 +1680,6 @@
+@@ -2101,7 +2091,6 @@ install-html-host: maybe-install-html-li
install-html-host: maybe-install-html-libiberty-linker-plugin
install-html-host: maybe-install-html-libiconv
install-html-host: maybe-install-html-m4
@@ -100,7 +116,7 @@
install-html-host: maybe-install-html-sid
install-html-host: maybe-install-html-sim
install-html-host: maybe-install-html-texinfo
-@@ -1765,7 +1756,6 @@
+@@ -2192,7 +2181,6 @@ installcheck-host: maybe-installcheck-li
installcheck-host: maybe-installcheck-libiberty-linker-plugin
installcheck-host: maybe-installcheck-libiconv
installcheck-host: maybe-installcheck-m4
@@ -108,7 +124,7 @@
installcheck-host: maybe-installcheck-sid
installcheck-host: maybe-installcheck-sim
installcheck-host: maybe-installcheck-texinfo
-@@ -1842,7 +1832,6 @@
+@@ -2283,7 +2271,6 @@ mostlyclean-host: maybe-mostlyclean-libi
mostlyclean-host: maybe-mostlyclean-libiberty-linker-plugin
mostlyclean-host: maybe-mostlyclean-libiconv
mostlyclean-host: maybe-mostlyclean-m4
@@ -116,7 +132,7 @@
mostlyclean-host: maybe-mostlyclean-sid
mostlyclean-host: maybe-mostlyclean-sim
mostlyclean-host: maybe-mostlyclean-texinfo
-@@ -1919,7 +1908,6 @@
+@@ -2374,7 +2361,6 @@ clean-host: maybe-clean-libiberty
clean-host: maybe-clean-libiberty-linker-plugin
clean-host: maybe-clean-libiconv
clean-host: maybe-clean-m4
@@ -124,7 +140,7 @@
clean-host: maybe-clean-sid
clean-host: maybe-clean-sim
clean-host: maybe-clean-texinfo
-@@ -1996,7 +1984,6 @@
+@@ -2465,7 +2451,6 @@ distclean-host: maybe-distclean-libibert
distclean-host: maybe-distclean-libiberty-linker-plugin
distclean-host: maybe-distclean-libiconv
distclean-host: maybe-distclean-m4
@@ -132,7 +148,7 @@
distclean-host: maybe-distclean-sid
distclean-host: maybe-distclean-sim
distclean-host: maybe-distclean-texinfo
-@@ -2073,7 +2060,6 @@
+@@ -2556,7 +2541,6 @@ maintainer-clean-host: maybe-maintainer-
maintainer-clean-host: maybe-maintainer-clean-libiberty-linker-plugin
maintainer-clean-host: maybe-maintainer-clean-libiconv
maintainer-clean-host: maybe-maintainer-clean-m4
@@ -140,7 +156,7 @@
maintainer-clean-host: maybe-maintainer-clean-sid
maintainer-clean-host: maybe-maintainer-clean-sim
maintainer-clean-host: maybe-maintainer-clean-texinfo
-@@ -2205,7 +2191,6 @@
+@@ -2705,7 +2689,6 @@ check-host: \
maybe-check-libiberty-linker-plugin \
maybe-check-libiconv \
maybe-check-m4 \
@@ -148,7 +164,7 @@
maybe-check-sid \
maybe-check-sim \
maybe-check-texinfo \
-@@ -2308,7 +2293,6 @@
+@@ -2843,7 +2826,6 @@ install-host-nogcc: \
maybe-install-libiberty-linker-plugin \
maybe-install-libiconv \
maybe-install-m4 \
@@ -156,7 +172,7 @@
maybe-install-sid \
maybe-install-sim \
maybe-install-texinfo \
-@@ -2354,7 +2338,6 @@
+@@ -2899,7 +2881,6 @@ install-host: \
maybe-install-libiberty-linker-plugin \
maybe-install-libiconv \
maybe-install-m4 \
@@ -164,7 +180,7 @@
maybe-install-sid \
maybe-install-sim \
maybe-install-texinfo \
-@@ -2450,7 +2433,6 @@
+@@ -3010,7 +2991,6 @@ install-strip-host: \
maybe-install-strip-libiberty-linker-plugin \
maybe-install-strip-libiconv \
maybe-install-strip-m4 \
@@ -172,7 +188,7 @@
maybe-install-strip-sid \
maybe-install-strip-sim \
maybe-install-strip-texinfo \
-@@ -51050,7 +51032,6 @@ all-stagefeedback-intl: maybe-all-stagef
+@@ -63072,7 +63052,6 @@ configure-gdb: maybe-all-gnulib
configure-gdb: maybe-all-gdbsupport
all-gdb: maybe-all-gnulib
all-gdb: maybe-all-gdbsupport
@@ -180,11 +196,11 @@
all-gdb: maybe-all-build-bison
all-gdb: maybe-all-sim
all-gdb: maybe-all-libtermcap
-@@ -51387,7 +51368,6 @@ install-sid: maybe-install-tcl
+@@ -63562,7 +63541,6 @@ install-strip-sid: maybe-install-strip-t
install-sid: maybe-install-tk
install-strip-sid: maybe-install-strip-tk
configure-sim: maybe-all-gnulib
--all-sim: maybe-all-readline
+-configure-sim: maybe-all-readline
all-fastjar: maybe-all-build-texinfo
all-libctf: all-libiberty
all-stage1-libctf: all-stage1-libiberty
diff --git a/gdb-vla-intel-stringbt-fix.patch b/gdb-vla-intel-stringbt-fix.patch
deleted file mode 100644
index 20cb3fe..0000000
--- a/gdb-vla-intel-stringbt-fix.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
-From: Jan Kratochvil <jan.kratochvil at redhat.com>
-Date: Fri, 1 Aug 2014 23:02:17 +0200
-Subject: gdb-vla-intel-stringbt-fix.patch
-
-;;=push+jan
-
-http://sourceware.org/ml/gdb-patches/2014-08/msg00025.html
-
-On Fri, 01 Aug 2014 09:20:19 +0200, Keven Boell wrote:
-> I just tried it on Fedora 20 i686. Applied the patch, you mentioned, on top of
-> the Fortran VLA series and executed your dynamic-other-frame test. Everything
-> is working fine here, I cannot reproduce the crash.
-
-I have it reproducible on Fedora 20 i686 with plain
-CFLAGS=-g ./configure;make;cd gdb/testsuite;make site.exp;runtest gdb.fortran/dynamic-other-frame.exp
-
-Besides that I have updated the testcase with
- gdb_test_no_output "set print frame-arguments all"
-so that there is no longer needed the patch:
- [patch] Display Fortran strings in backtraces
- https://sourceware.org/ml/gdb-patches/2014-07/msg00709.html
-
-The fix below has no regressions for me. Unfortunately I do not see why you
-cannot reproduce it.
-
-Thanks,
-Jan
-
-diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c
---- a/gdb/dwarf2/loc.c
-+++ b/gdb/dwarf2/loc.c
-@@ -2249,6 +2249,20 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
- ctx.per_cu = per_cu;
- ctx.obj_address = 0;
-
-+frame_id old_frame_id (get_frame_id (deprecated_safe_get_selected_frame ()));
-+class RestoreCall {
-+private:
-+ const std::function<void ()> func;
-+public:
-+ RestoreCall(std::function<void ()> func_):func(func_) {}
-+ ~RestoreCall() { func(); }
-+} restore_frame([=]() {
-+ frame_info *old_frame (frame_find_by_id (old_frame_id));
-+ if (old_frame != NULL)
-+ select_frame (old_frame);
-+});
-+if (frame != NULL) select_frame (frame);
-+
- scoped_value_mark free_values;
-
- ctx.gdbarch = per_objfile->objfile->arch ();
-diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
-new file mode 100644
---- /dev/null
-+++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
-@@ -0,0 +1,24 @@
-+! Copyright 2010 Free Software Foundation, Inc.
-+!
-+! This program is free software; you can redistribute it and/or modify
-+! it under the terms of the GNU General Public License as published by
-+! the Free Software Foundation; either version 2 of the License, or
-+! (at your option) any later version.
-+!
-+! This program is distributed in the hope that it will be useful,
-+! but WITHOUT ANY WARRANTY; without even the implied warranty of
-+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+! GNU General Public License for more details.
-+!
-+! You should have received a copy of the GNU General Public License
-+! along with this program; if not, write to the Free Software
-+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+!
-+! Ihis file is the Fortran source file for dynamic.exp.
-+! Original file written by Jakub Jelinek <jakub at redhat.com>.
-+! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil at redhat.com>.
-+
-+subroutine bar
-+ real :: dummy
-+ dummy = 1
-+end subroutine bar
-diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp b/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
-new file mode 100644
---- /dev/null
-+++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
-@@ -0,0 +1,39 @@
-+# Copyright 2010 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 2 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program; if not, write to the Free Software
-+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+
-+set testfile "dynamic-other-frame"
-+set srcfile1 ${testfile}.f90
-+set srcfile2 ${testfile}-stub.f90
-+set objfile2 [standard_output_file ${testfile}-stub.o]
-+set executable ${testfile}
-+set binfile [standard_output_file ${executable}]
-+
-+if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${objfile2}" object {f90}] != ""
-+ || [gdb_compile "${srcdir}/${subdir}/${srcfile1} ${objfile2}" "${binfile}" executable {debug f90}] != "" } {
-+ untested "Couldn't compile ${srcfile1} or ${srcfile2}"
-+ return -1
-+}
-+
-+clean_restart ${executable}
-+
-+gdb_test_no_output "set print frame-arguments all"
-+
-+if ![runto bar_] then {
-+ perror "couldn't run to bar_"
-+ continue
-+}
-+
-+gdb_test "bt" {foo \(string='hello'.*}
-diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
-new file mode 100644
---- /dev/null
-+++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
-@@ -0,0 +1,36 @@
-+! Copyright 2010 Free Software Foundation, Inc.
-+!
-+! This program is free software; you can redistribute it and/or modify
-+! it under the terms of the GNU General Public License as published by
-+! the Free Software Foundation; either version 2 of the License, or
-+! (at your option) any later version.
-+!
-+! This program is distributed in the hope that it will be useful,
-+! but WITHOUT ANY WARRANTY; without even the implied warranty of
-+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+! GNU General Public License for more details.
-+!
-+! You should have received a copy of the GNU General Public License
-+! along with this program; if not, write to the Free Software
-+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+!
-+! Ihis file is the Fortran source file for dynamic.exp.
-+! Original file written by Jakub Jelinek <jakub at redhat.com>.
-+! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil at redhat.com>.
-+
-+subroutine foo (string)
-+ interface
-+ subroutine bar
-+ end subroutine
-+ end interface
-+ character string*(*)
-+ call bar ! stop-here
-+end subroutine foo
-+program test
-+ interface
-+ subroutine foo (string)
-+ character string*(*)
-+ end subroutine
-+ end interface
-+ call foo ('hello')
-+end
diff --git a/gdb-vla-intel-tests.patch b/gdb-vla-intel-tests.patch
deleted file mode 100644
index b2febb6..0000000
--- a/gdb-vla-intel-tests.patch
+++ /dev/null
@@ -1,149 +0,0 @@
-From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
-From: Fedora GDB patches <invalid at email.com>
-Date: Fri, 27 Oct 2017 21:07:50 +0200
-Subject: gdb-vla-intel-tests.patch
-
-;;=fedoratest
-
-diff --git a/gdb/testsuite/gdb.fortran/vla-func.exp b/gdb/testsuite/gdb.fortran/vla-func.exp
-new file mode 100644
---- /dev/null
-+++ b/gdb/testsuite/gdb.fortran/vla-func.exp
-@@ -0,0 +1,61 @@
-+# Copyright 2014 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+standard_testfile ".f90"
-+
-+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
-+ {debug f90 quiet}] } {
-+ return -1
-+}
-+
-+if ![runto MAIN__] then {
-+ perror "couldn't run to breakpoint MAIN__"
-+ continue
-+}
-+
-+# Check VLA passed to first Fortran function.
-+gdb_breakpoint [gdb_get_line_number "func1-vla-passed"]
-+gdb_continue_to_breakpoint "func1-vla-passed"
-+gdb_test "print vla" " = \\( *\\( *22, *22, *22,\[()22, .\]*\\)" \
-+ "print vla (func1)"
-+gdb_test "ptype vla" "type = integer\\\(kind=4\\\), allocatable \\\(10,10\\\)" \
-+ "ptype vla (func1)"
-+
-+gdb_breakpoint [gdb_get_line_number "func1-vla-modified"]
-+gdb_continue_to_breakpoint "func1-vla-modified"
-+gdb_test "print vla(5,5)" " = 55" "print vla(5,5) (func1)"
-+gdb_test "print vla(7,7)" " = 77" "print vla(5,5) (func1)"
-+
-+# Check if the values are correct after returning from func1
-+gdb_breakpoint [gdb_get_line_number "func1-returned"]
-+gdb_continue_to_breakpoint "func1-returned"
-+gdb_test "print ret" " = .TRUE." "print ret after func1 returned"
-+
-+# Check VLA passed to second Fortran function
-+gdb_breakpoint [gdb_get_line_number "func2-vla-passed"]
-+gdb_continue_to_breakpoint "func2-vla-passed"
-+gdb_test "print vla" \
-+ " = \\\(44, 44, 44, 44, 44, 44, 44, 44, 44, 44\\\)" \
-+ "print vla (func2)"
-+gdb_test "ptype vla" "type = integer\\\(kind=4\\\) \\\(10\\\)" \
-+ "ptype vla (func2)"
-+
-+# Check if the returned VLA has the correct values and ptype.
-+gdb_breakpoint [gdb_get_line_number "func2-returned"]
-+gdb_continue_to_breakpoint "func2-returned"
-+gdb_test "print vla3" " = \\\(1, 2, 44, 4, 44, 44, 44, 8, 44, 44\\\)" \
-+ "print vla3 (after func2)"
-+gdb_test "ptype vla3" "type = integer\\\(kind=4\\\), allocatable \\\(10\\\)" \
-+ "ptype vla3 (after func2)"
-diff --git a/gdb/testsuite/gdb.fortran/vla-func.f90 b/gdb/testsuite/gdb.fortran/vla-func.f90
-new file mode 100644
---- /dev/null
-+++ b/gdb/testsuite/gdb.fortran/vla-func.f90
-@@ -0,0 +1,71 @@
-+! Copyright 2014 Free Software Foundation, Inc.
-+!
-+! This program is free software; you can redistribute it and/or modify
-+! it under the terms of the GNU General Public License as published by
-+! the Free Software Foundation; either version 2 of the License, or
-+! (at your option) any later version.
-+!
-+! This program is distributed in the hope that it will be useful,
-+! but WITHOUT ANY WARRANTY; without even the implied warranty of
-+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+! GNU General Public License for more details.
-+!
-+! You should have received a copy of the GNU General Public License
-+! along with this program; if not, write to the Free Software
-+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+
-+logical function func1 (vla)
-+ implicit none
-+ integer, allocatable :: vla (:, :)
-+ func1 = allocated(vla)
-+ vla(5,5) = 55 ! func1-vla-passed
-+ vla(7,7) = 77
-+ return ! func1-vla-modified
-+end function func1
-+
-+function func2(vla)
-+ implicit none
-+ integer :: vla (:)
-+ integer :: func2(size(vla))
-+ integer :: k
-+
-+ vla(1) = 1 ! func2-vla-passed
-+ vla(2) = 2
-+ vla(4) = 4
-+ vla(8) = 8
-+
-+ func2 = vla
-+end function func2
-+
-+program vla_func
-+ implicit none
-+ interface
-+ logical function func1 (vla)
-+ integer, allocatable :: vla (:, :)
-+ end function
-+ end interface
-+ interface
-+ function func2 (vla)
-+ integer :: vla (:)
-+ integer func2(size(vla))
-+ end function
-+ end interface
-+
-+ logical :: ret
-+ integer, allocatable :: vla1 (:, :)
-+ integer, allocatable :: vla2 (:)
-+ integer, allocatable :: vla3 (:)
-+
-+ ret = .FALSE.
-+
-+ allocate (vla1 (10,10))
-+ vla1(:,:) = 22
-+
-+ allocate (vla2 (10))
-+ vla2(:) = 44
-+
-+ ret = func1(vla1)
-+ vla3 = func2(vla2) ! func1-returned
-+
-+ ret = .TRUE. ! func2-returned
-+end program vla_func
diff --git a/x32.patch b/x32.patch
deleted file mode 100644
index a7753d0..0000000
--- a/x32.patch
+++ /dev/null
@@ -1,18 +0,0 @@
---- gdb-11.1/gdb/nat/amd64-linux-siginfo.c.orig 2021-07-03 19:41:10.000000000 +0200
-+++ gdb-11.1/gdb/nat/amd64-linux-siginfo.c 2021-11-21 18:32:29.634785279 +0100
-@@ -330,6 +330,7 @@
- to->cpt_si_pid = from_ptrace.cpt_si_pid;
- to->cpt_si_uid = from_ptrace.cpt_si_uid;
- }
-+#ifndef __ILP32__
- else if (to->si_code == SEGV_BNDERR
- && to->si_signo == SIGSEGV)
- {
-@@ -337,6 +338,7 @@
- to->cpt_si_lower = from_ptrace.cpt_si_lower;
- to->cpt_si_upper = from_ptrace.cpt_si_upper;
- }
-+#endif
- else if (to->si_code < 0)
- {
- to->cpt_si_pid = from_ptrace.cpt_si_pid;
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/gdb.git/commitdiff/0e7ddf04c2f9c2b815faa1f7c5b4f64407523e81
More information about the pld-cvs-commit
mailing list