Commit Graph

132 Commits

Author SHA1 Message Date
Kevin Buettner 0ef7ce6648 Backport upstream workaround for GCC 14 problem
The GCC problem is responsible for GDB internal errors.  See:

https://sourceware.org/bugzilla/show_bug.cgi?id=31281
2024-01-29 15:59:22 -07:00
Guinevere Larsen ce2a1b8ca4 remove gdb-6.5-BEA-testsuite.patch
A similar version was accepted upstream and will make its way back here
with the next rebase.
2024-01-25 19:27:30 +01:00
Guinevere Larsen 9283c2ae14 backport gdb: fix "list ." related crash
This fixes RHBZ 2259850
2024-01-25 18:26:48 +01:00
Kevin Buettner 46b67ac265 Backport upstream commit 54195469c18, fixing a build problem 2024-01-17 13:10:14 -07:00
Kevin Buettner a84ff66cf3 Backport upstream commit bc23ea51f8a83e9524dfb553baa8baacb29e68a9
This backport might fix RHBZ 2257562.
2024-01-16 20:12:34 -07:00
Alexandra Hájková 9b90152921 Backport upstream commits 7ae9ecfd801 and 8170efad364 to avoid
using _PyOS_ReadlineTState  (RHBZ 2250652).
2024-01-09 13:41:13 +01:00
Kevin Buettner ebdac5bb6e Rebase to FSF GDB 14.1
Update local patches:
    gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
    gdb-6.6-buildid-locate-rpm.patch
    gdb-6.6-buildid-locate.patch
    gdb-container-rh-pkg.patch
    gdb-core-open-vdso-warning.patch
    gdb-fedora-libncursesw.patch
    gdb-linux_perf-bundle.patch

Update backported patches which didn't make it into 14.1:
    gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch
    gdb-rhbz-2232086-generate-gdb-index-consistently.patch

Drop upstreamed local patches:
    gdb-6.5-sharedlibrary-path.patch

Drop gdb-13.2 backports (which are now in gdb-14.1):
    gdb-binutils29988-read_indexed_address.patch
    gdb-bz2196395-debuginfod-legacy-openssl-crash.patch
    gdb-bz2237392-dwarf-obstack-allocation.patch
    gdb-bz2237515-debuginfod-double-free.patch
    gdb-rhbz2192105-ftbs-dangling-pointer
    gdb-rhbz2233961-CVE-2022-4806.patch
    gdb-rhbz2233965-memory-leak.patch

Adjust gdb.spec so that --with-mpfr is no longer passed to
configure; doing so, combined with some configury changes triggered
a latent build problem.
2023-12-08 18:43:22 -07:00
Kevin Buettner a27201b2a0 Remove gdb-6.5-missed-trap-on-step-test.patch 2023-12-04 14:55:15 -07:00
Andrew Burgess c26c6b70cb Back-port upstream commits to fix non-consistent gdb-index creation
Backport upstream commits 1f0fab7ff86, aa19bc1d259, acc117b57f7,
aff250145af, and 3644f41dc80.  These commits reduce the size of the
generated gdb-index file, and also ensure that the gdb-index and
dwarf-5 index are generated consistently even as the number of worker
threads that GDB uses changes (RHBZ 2232086).

The first and third of these patches are refactoring, but are required
by the other patches in this series.

The second patch fixes a bug that causes the gdb-index files to
be (sometimes) bigger than needed.

The fourth and fifth patches ensure that the gdb-index and dwarf-5
index (respectively) are generated the same (for the same input
binary), regardless of how many worker threads that GDB uses.
2023-11-28 15:20:27 +00:00
Alexandra Hájková 52a4dabc57 Remove gdb-6.5-ia64-libunwind-leak-test.patch.
The patch doesn't include any actual fixes, the architecture
is end of life and the kernel is planning to drop IA64 support.
2023-10-19 16:09:06 +02:00
Guinevere Larsen 87ade3a000 Remove gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch
The test was upstreamed back in 2010, but the final file has a different
name, so this was never removed:
https://sourceware.org/legacy-ml/gdb-patches/2010-06/msg00046.html
2023-10-11 16:25:55 +02:00
Kevin Buettner f4fc320c3e Backport upstream commit for overly large gdb-index files
Backport upstream commit which prevents internal error when
generating an overly large gdb-index file.  (RHBZ 1773651, Kevin
Buettner.)
2023-10-02 16:42:52 -07:00
Alexandra Hájková fec73092bb Backport upstream commit d28fbc7197b which fixes RHBZ 2233965 (
CVE-2022-48065).
2023-10-01 11:38:40 +02:00
Kevin Buettner aca26db9ee Delete gdb-6.5-sharedlibrary-path.patch, which was upstreamed in
commit 3ec033fab4a.
2023-09-28 19:13:18 -07:00
Keith Seitz 52db67646d Remove gdb-rhbz1553104-s390x-arch12-test.patch
This patch adds an s390x/arch12 binary file to disassemble, checking
for the appearance of two arch12 insns. Remove this patch in favor
of binutil's version, which is much more complete with much more
coverage.
2023-09-19 09:24:27 -07:00
Alexandra Hájková a5080fa18b Backport upstream commit 8f2c64de86b which fixes RHBZ 2233961,
CVE-2022-48064, (Alan Modra).
2023-09-17 13:59:16 +02:00
Andrew Burgess ed8eee7ab5 Backport upstream fix for RHBZ 2237392
Backport upstream commit 54392c4df604f20 to fix an incorrect
obstack allocation that wold lead to memory corruption (RHBZ 2237392).
2023-09-14 22:22:33 +01:00
Andrew Burgess 60fc6a1e0f Backport upstream fix for RHBZ 2237515
Backport upstream commit f96328accde1e63 to fix a potential double
free issue in the debuginfod code (RHBZ 2237515).
2023-09-13 15:31:17 +01:00
Guinevere Larsen 9a4f6d6e4c remove gdb-6.7-testsuite-stable-results.patch
That patch only changed gdb.base/fileio.{c|exp} tests, supposedly to
make them work better when running the test as root. However, that test
only increased the number of fails by 20
2023-08-09 09:31:00 +02:00
Andrew Burgess 899498bb21 Backport upstream fix for RHBZ 2196395
Backport upstream commit f3eee5861743d635 to fix a crash triggered
when debuginfod makes use of particular openssl settings.
2023-08-03 09:29:19 +01:00
Andrew Burgess dd38aa36ce Remove gdb-test-pid0-core.patch
The patch gdb-test-pid0-core.patch only contains a test.  A similar
test has been merged upstream in commit 8bcead69665, so I propose that
we drop this patch from Fedora, the test will be picked up next time
we rebase.
2023-07-04 14:29:08 +01:00
Kevin Buettner d5dc87ea90 Suppress repeated warnings when loading a core file
Backport upstream changes which prevent repeated warnings from being
printed when loading a core file  (RHBZ 2160211, Lancelot SIX).
2023-06-30 15:20:10 -07:00
Alexandra Hájková b85c01223e Rebase to FSF GDB 13.2. 2023-06-25 16:05:18 +02:00
Andrew Burgess 5f67b86ed1 Remove gdb-lineno-makeup-test.patch
An equivalent test has been merged upstream in this commit:

  commit ef56b006501ba52b128d4e5f36657ddbf56d22bc
  Date:   Wed May 17 15:14:15 2023 +0100

      gdb/testsuite: test for a function with no line table

As this is only a test there seems little point in backporting this
commit to Fedora -- we'll pick it up next time we rebase.  For now I
suggest that we drop this patch.
2023-05-20 10:24:29 +01:00
Andrew Burgess f71aced2fd Remove gdb-ccache-workaround.patch
This patch adds a work around for an issue with older versions of
ccache -- the line number for macros defined at the compiler command
line was '1' instead of '0'.

Not only is this ccache issue fixed with newer versions of ccache, but
upstream GDB now disables ccache during testing, see commit:

  commit 49b4de64242d4ae035e0e2197837278e33c187fc
  Date:   Thu Sep 15 14:04:20 2016 +0200

      testsuite: Disable ccache

As a result this work around is no longer needed, and this patch can
be dropped.
2023-05-16 16:38:15 +01:00
Andrew Burgess 2a935aa29b Remove gdb-ppc-power7-test.patch
The test added by this patch claims to be a power7 test, however, it
actually appears to test instructions from power7, power8, and power9.

All the instructions tested by this patch are already tested by
upstream tests:

  gdb.arch/powerpc-power7.exp
  gdb.arch/powerpc-power8.exp
  gdb.arch/powerpc-power9.exp

As such this patch is redundant and can be removed.
2023-05-16 15:23:14 +01:00
Alexandra Hájková 7046f4cf6f Remove gdb-rhel5.9-testcase-xlf-var-inside-mod.patch
The patch adds gdb.fortran/xlf-variable.exp test,
the test can only be run on PPC64 machines which
are not supported anymore.
2023-05-06 18:28:28 +02:00
Andrew Burgess e19c0f8fb7 Rewrite (and rename) gdb-libexec-add-index.patch
It has been observed that the changes added by
gdb-libexec-add-index.patch will result in GDB testing hanging when
the tests are being run using an in-tree GDB; that is when using 'make
check'.  One test that is known to fail is gdb.base/with-mf.exp,
though any test that calls the gdb-add-index.sh script will also hang.

The problem is that when the gdb-add-index.sh script is run, the GDB
testsuite passes the GDB command to use within the GDB environment
variable.  For in-tree testing this will be something like:

  GDB="/path/to/gdb -data-directory /path/to/data-directory"

Notice that the environment variable contains both an executable and
an argument.

Our changes to gdb-add-index.sh add this:

  GDB2=/usr/libexec/gdb
  if test -x $GDB2 && ! which $GDB &>/dev/null; then
      GDB=$GDB2
  fi

The problem then is that '-data-directory' is treated as a set of
options to 'which'.  Many of these options are not known to 'which',
but the '-i' option is known.  The documentation of '-i' says:

    --read-alias, -i
        Read aliases from stdin, reporting matching ones on
        stdout. This is useful in combination with using an alias for
        which itself. For example
        alias which=´alias | which -i´.

And here's the problem; this option causes 'which' to read from
stdin.  As the GDB testsuite doesn't send any additional input on
stdin then the which command will never complete, and the test will
hang.

The solution I think is to avoid calling 'which' like this on a user
supplied GDB environment variable.

The changes in the gdb-libexec-add-index.patch were really about what
the _default_ GDB executable should be.  The upstream version of this
script does this:

  GDB=${GDB:=gdb}

That is, the default is just 'gdb'.  However, for RH this is not good
enough.  We want to handle two additional cases, first, when only the
gdb-minimal package is installed, in which case the default should be
/usr/bin/gdb.minimal.  Then we also want to handle the case where the
user doesn't have 'gdb' itself in their $PATH, but does have the 'gdb'
executable installed in /usr/libexec/gdb.

The code as it currently stands also has a problem where, if
gdb.minimal is installed on the machine this will _always_ be used in
preference to the user supplied GDB value (assuming the code worked at
all) this means that when doing in-tree testing we wouldn't actually
be using the in-tree GDB to build the index, which isn't ideal.

So in this commit I propose that we rework our gdb-add-index.sh
changes.  Now, we only use the RH special values in the case that
there is no GDB environment variable set.  I believe this handles all
the required use cases:

  1. When doing in-tree testing GDB environment variable will be set,
  and this will always be used as is, with no special processing,

  2. When gdb-add-index.sh is used and GDB environment variable is not
  set then we will use the first of the following as the default:

    (a) /usr/bin/gdb.minimal if this file exists and is executable,
    (b) The first gdb executable that can be found in the $PATH,
    (c) /usr/libexec/gdb if this file exists and is executable.

While I was changing this patch anyway I've removed the libexec part
of the patch name -- this no longer seemed relevant, I suspect this
related to an older version of this patch.
2023-05-04 15:11:19 +01:00
Kevin Buettner f68e769d70 Backport upstream fix for RHBZ 2192105
Specifically, "Pass const frame_info_ptr reference for
skip_[language_]trampoline". (Mark Wielaard, RHBZ 2192105, build/30413)
2023-05-03 13:32:42 -07:00
Andrew Burgess 7cd90204c9 Remove gdb-opcodes-clflushopt-test.patch
Remove gdb-opcodes-clflushopt-test.patch.  This patch tests that GDB
can disassemble the clflushopt instruction correctly.  Such
disassembly is a feature of libopcode and is covered by the gas
tests i386/x86-64-clflushopt.s and i386/clflushopt.s.  Lets remove
this test from GDB and just rely on the gas tests instead.
2023-05-02 19:15:44 +01:00
Kevin Buettner b1e9fbcc29 Remove gdb-6.7-charsign-test.patch
This patch originally contained some changes to GDB which were
rejected by upstream maintainers.  All that remained was a testcase
which had a number of failures due to the rest of the work not being
present in GDB.
2023-04-29 19:34:05 -07:00
Bruno Larsen 231ea6585a Remove gdb-6.5-bz109921-DW_AT_decl_file-test.patch
This patch only had a test for basic DWARF-2 support, and the test was
already covered by other tests, such as gdb.linespec/linespec.exp
2023-04-25 14:14:49 +02:00
Bruno Larsen d18c2a5bd9 Remove gdb-6.5-last-address-space-byte-test.patch
This patch exercised an edge case for 32-bit systems in
target_xfer_memory, a function that has been removed in 2006.
The test that patch added has been irrelevant for some time.
2023-04-24 15:48:54 +02:00
Alexandra Hájková 9dbae0620d Remove gdb-6.3-bz140532-ppc-unwinding-test.patch.
It adds powerpc-bcl-prologue.exp test which seems
to be a subset of upstream powerpc-prologue.exp
2023-04-13 12:22:36 +02:00
Keith Seitz ff60ea4e26 Backport fix for binutils/29988 2023-04-11 10:32:14 -07:00
Keith Seitz 33590be3ac Backport "Fix crash in inside_main_func"
Resolves: rhbz#2183595
2023-03-31 13:14:15 -07:00
Kevin Buettner 7403afbaf9 Backport fix for RHBZ 2177655. (Luis Machado) 2023-03-24 19:22:09 -04:00
Bruno Larsen 50c864895c Remove gdb-rhbz1350436-type-printers-error.patch since it is upstreamed.
The test introduced by that patch is now available on upstream commit
83b755117d7a13e75877c3f166dfef1d8b69ec75, and will probably be
backported soon.
2023-03-20 10:18:06 +01:00
Kevin Buettner 92d162c371 Rebase to FSF GDB 13.1
Update gdb-6.3-rh-testversion-20041202.patch.
Update gdb-6.3-bz140532-ppc-unwinding-test.patch.
Update gdb-6.6-buildid-locate.patch.
Update gdb-6.6-buildid-locate-rpm.patch.
Remove 'Recommends: ' line for gcc-gdb-plugin for BZ2149246.
Add 'define _lto_cflags ' to avoid ODR violations.
Add -Wno-stringop-overflow to --enable-gdb-build-warnings to work around
  gcc problem.
2023-03-08 21:42:55 -07:00
Andrew Burgess 17914b3d53 Remove gdb-test-ivy-bridge.patch
The patch 'gdb-test-ivy-bridge.patch' adds some disassembly tests for
various i386/x86-64 instructions.  In fact, the tests added by this
patch are copied directly from gas and should all be covered by
gas/testsuite/gas/i386/i386.exp.

I guess historically, when support for these instructions was first
added, it made sense to have these tests in both GDB and binutils.
But today I think that the testing in binutils is sufficient; if we
really want to validate libopcodes we'd be better off building and
testing gas/binutils as well as GDB.

I propose that we just drop 'gdb-test-ivy-bridge.patch' from the
Fedora GDB tree.
2023-02-12 06:04:03 +00:00
Andrew Burgess d7818464ae Remove gdb-6.5-readline-long-line-crash-test.patch
Remove gdb-6.5-readline-long-line-crash-test.patch, this test is now
upstream in commit:

  commit bb146a79c7d65e2b578e8c3f652cb118c63741e5
  Date:   Thu Feb 9 10:52:47 2023 +0000

      gdb: add test for readline handling very long commands

As this is only a test, I don't see any point in backporting the
upstream commit, we'll pick this up with a later rebase.
2023-02-11 17:21:20 +00:00
Andrew Burgess 7fd1c9cb3f Remove gdb-6.8-bz442765-threaded-exec-test.patch
Following on from the previous commit, this commit remove
gdb-6.8-bz442765-threaded-exec-test.patch.

Like the previous commit, this patch was a testsuite only patch that
extended the test originally added in the previous commit, in order to
do some additional threads/exec related testing.

The issue exposed by this test (Bug bz442765) was present on Fedora 9,
with GDB 6.8-1.fc9.  I have setup a Fedora 9 VM and recreated the
failure with the test in the patch I'm deleting here.

The test does a number of exec's, in each iteration the test binary
runs in a different mode.  However, the failure is triggered when we
have a main thread that spawns a worker thread and then called exec
from the main thread.

Just like the previous commit, this situation already exists in the
upstream test gdb.threads/execl.exp, and, if I copy this upstream test
to my Fedora 9 VM, I can reproduce the failure using this upstream
test.

The test being deleted here does do a number of other permutations of
threading and execing, for example it tests calling exec in a
non-threaded inferior, but this is also tested upstream with things
like gdb.base/foll-exec.exp.

In summary, I don't believe there is anything new added by this test
that is not already covered with existing upstream tests, as such, I
think we should drop this patch.
2023-02-10 15:39:01 +00:00
Andrew Burgess 89f20beb5e Remove gdb-6.3-bz202689-exec-from-pthread-test.patch
Remove gdb-6.3-bz202689-exec-from-pthread-test.patch.  The test
included in this patch is covered by the already upstream test
gdb/testsuite/gdb.threads/execl.exp which was added with this commit:

  commit 49fd4a422bb6152043b2b41a1f734694056dbf3b
  Date:   Thu Jun 5 21:03:59 2008 +0000

Unfortunately, the situation is not as simple as just removing this
patch file.  The later patch gdb-6.8-bz442765-threaded-exec-test.patch
builds on the earlier test to cover additional cases.

So, what I've actually done is remove the first patch, but merged the
test entirely into the second patch.  I think this is a better
reflection of the current situation; the first patch is
redundant (it's test is already covered upstream), while the second
patch has not yet been reviewed, so it _might_ contain a useful test.

To confirm that the upstream test quoted above actually covers this
test case I did the following:

  - Setup a Fedora 3 virtual machine,

  - Built the test from the first patch and confirmed that it failed
    as described in bug bz202689,

  - Copied the upstream execl.exp sources to the virtual machine, and
    built the test binary,

  - Manually ran the test binary just as the .exp script does, and
    confirmed that it failed in the same way as the test from the
    original patch.
2023-02-10 12:33:43 +00:00
Andrew Burgess ad65e1854b Remove gdb-6.6-bz230000-power6-disassembly-test.patch
Remove gdb-6.6-bz230000-power6-disassembly-test.patch as this is now
covered by upstream tests.  This patch added some tests of the Power6
disassembler.  Disassembler tests are better carried in the gas tree.

Upstream commit:

  commit 0fcf99b8ab5ccbde30fa7d36742e670cd4df48ef
  Date:   Mon Jan 30 11:47:31 2023 +0000

      gas/ppc: Additional tests for DFP instructions

Added some new assembler/disassembler tests to the gas tree that
covered all the instructions that were covered by our local patch.
2023-01-31 09:38:56 +00:00
Andrew Burgess a5f9e28701 Remove gdb-6.3-focus-cmd-prev-test.patch this test is now upstream
This upstream commit:

  commit 24f3aded1d42f515527e2de7e8e9e26f0b77c932
  Date:   Tue Dec 20 15:01:29 2022 +0000

      gdb/testsuite/tui: more testing of the 'focus' command

replaces the tests added in gdb-6.3-focus-cmd-prev-test.patch.  As
this patch was only adding a test I see no need to back-port the
upstream commit, we'll pick this up in a later rebase.
2023-01-26 14:50:06 +00:00
Bruno Larsen 6de2f1fd32 Remove gdb-rhbz1398387-tab-crash-test.patch as that test didn't work anymore 2023-01-26 12:40:53 +01:00
Keith Seitz e2df45df10 Backport of backtrace/29374
(Simon Marchi, sw backtrace/29374)
2023-01-23 04:26:24 -08:00
Kevin Buettner b443fb3970 Fixes to get GDB to build again with GCC 13 and Python 3.12
- Backport fix for problems associated with GCC 13's self-move warning.
- Tweak gdb-6.6-buildid-locate-rpm.patch so that running GDB's configure
  script will not error out due to GCC 13's warnings.
- Backport replace deprecated distutils.sysconfig in python-config.
2023-01-20 17:14:37 -07:00
Alexandra Hájková ed2e95dc63 Backport replace deprecated distutils.sysconfig in python-config.
(Lancelot SIX)
2023-01-19 19:33:30 +01:00
Andrew Burgess 69f0c792d6 Back-port fix for RHBZ 2152431
Fixes RHBZ 2152431, an issue where reading a label symbol's value
would cause GDB to crash.  This pulls in two upstream commits
38665d717a3 and c3efaf0afd9 both of which should be in GDB 13 when it
is released.
2022-12-19 17:01:56 +00:00