gdb/gdb-remove-path-in-test-name.patch
Andrew Burgess 08bfd0a4a7 switch rpm suggestion feature to a Python extension
This commit backports several patches from upstream GDB:

  7d21600b31f
  dd5516bf98f
  e8c3dafa5f5
  1146d27749f
  7db795bc67a
  8f6c452b5a4
  661d98a3331
  6234ba17598
  27807da5849
  7628a997f27

These commits provide a new Python API which allows users to catch the
case where GDB tries to load an objfile, but can't find any debug
information.

I've then added a new patch which uses this Python API to hook into
GDB and make suggestions about RPMs to install that could provide
missing debug information, this should replace some of the rpm
suggestion functionality that is currently implemented within GDB's
C++ code, as such I've deleted all of the code related to opening
librpm and querying the RPM database.

There is still code in GDB which will make suggestions about
installing RPMs based on the path to the build-id symlink for the
file.  This code is hit when a user tries to open a core-file and the
corresponding executable can't be found, or if a shared library
required by the core-file isn't found.

In these cases the librpm lookup would always fail anyway and we'd
just suggest that the user try to install the required package based
on the path to the build-id symlink, e.g.:

  Missing separate debuginfo for the main executable file.
  Try: yum --enablerepo='*debug*' install /usr/local/lib/debug/.build-id/bf/c9fbd13046db58c28ba332e6c991240e775c96

This should still work just as it did before.

Now GDB no longer links against librpm I'm able to remove all the
librpm related stuff from the configure scripts, which is a nice
cleanup.

There are a couple of patches:

  gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
  gdb-6.6-buildid-locate-rpm.patch

which deal exclusively with updating code (added in earlier patches)
related to the use of librpm from GDB's C++ code, these patches are
removed by this commit.  Other patches are changed either by the
removal of the librpm code, or as a consequence of that code having
been removed.

I've also taken the opportunity to fix up some of the test cases which
only exist in the Fedora tree so that they will run again.  This is
mostly just updating the tests to match upstream GDB's current
testsuite infrastructure, these are all pretty minor fixes.
2024-03-15 14:04:11 +00:00

30 lines
1.0 KiB
Diff

From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Tom Tromey <tromey@adacore.com>
Date: Tue, 14 Nov 2023 11:47:27 -0700
Subject: gdb-remove-path-in-test-name.patch
;; Backport upstream commit 1146d27749f.
Remove path name from test case
'runtest' complains about a path in a test name, from the new test
case py-missing-debug.exp.
This patch fixes the problem by providing an explicit test name to
gdb_test. I chose something very basic because the block in question
is already wrapped in with_test_prefix.
diff --git a/gdb/testsuite/gdb.python/py-missing-debug.exp b/gdb/testsuite/gdb.python/py-missing-debug.exp
--- a/gdb/testsuite/gdb.python/py-missing-debug.exp
+++ b/gdb/testsuite/gdb.python/py-missing-debug.exp
@@ -321,7 +321,8 @@ with_test_prefix "enable 'abc-def'" {
set re [string_to_regexp $binfile]
gdb_test "enable missing-debug-handler \"$re\" abc-def" \
- "^1 missing debug handler enabled"
+ "^1 missing debug handler enabled" \
+ "enable missing-debug-handler"
gdb_test "info missing-debug-handlers" \
[multi_line \