gdb/gdb-sync-coffread-with-elfread.patch
Tom de Vries 8aea3c9b98 - Update to fedora rawhide @ 08bfd0a.
- Patches dropped:
  * fixup-gdb-6.3-gstack-20050411.patch
  * fixup-skip-tests.patch
  * gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
  * gdb-6.6-buildid-locate-rpm.patch
- Patches added:
  * gdb-add-missing-debug-ext-lang-hook.patch
  * gdb-add-missing-debug-info-python-hook.patch
  * gdb-add-rpm-suggestion-script.patch
  * gdb-do-not-import-py-curses-ascii-module.patch
  * gdb-handle-no-python-gdb-module.patch
  * gdb-merge-debug-symbol-lookup.patch
  * gdb-python-avoid-depending-on-the-curses-library.patch
  * gdb-refactor-find-and-add-separate-symbol-file.patch
  * gdb-reformat-missing-debug-py-file.patch
  * gdb-remove-path-in-test-name.patch
  * gdb-remove-use-of-py-isascii
  * gdb-sync-coffread-with-elfread.patch
- Patches updated:
  * fixup-gdb-bz634108-solib_address.patch
  * gdb-6.3-gstack-20050411.patch
  * gdb-6.6-buildid-locate-rpm-suse.patch
  * gdb-6.6-buildid-locate-solib-missing-ids.patch
  * gdb-6.6-buildid-locate.patch
  * gdb-archer-next-over-throw-cxx-exec.patch
  * gdb-bz634108-solib_address.patch
  * gdb-fedora-libncursesw.patch
  * gdb-glibc-strstr-workaround.patch
  * gdb-rhbz1007614-memleak-infpy_read_memory-test.patch

OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=409
2025-01-23 14:31:06 +00:00

48 lines
1.8 KiB
Diff

From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Andrew Burgess <aburgess@redhat.com>
Date: Thu, 12 Oct 2023 19:42:19 +0100
Subject: gdb-sync-coffread-with-elfread.patch
;; Backport upstream commit 7628a997f27.
gdb/coffread: bring separate debug file logic into line with elfread.c
In this commit:
commit 8a92335bfca80cc9b4cd217505ea0dcbfdefbf07
Date: Fri Feb 1 19:39:04 2013 +0000
the logic for when we try to load a separate debug file in elfread.c
was extended. The new code checks that the objfile doesn't already
have a separate debug objfile linked to it, and that the objfile isn't
itself a separate debug objfile for some other objfile.
The coffread code wasn't extended at the same time.
I don't know if it's possible for the coffread code to get into the
same state where these checks are needed, but I don't see why having
these checks would be a problem. In a later commit I plan to merge
this part of the elfread and coffread code, so bringing these two
pieces of code into line first makes that job easier.
I've tested this with a simple test binary compiled with the mingw
toolchain on a Linux host. After compiling the binary and splitting
out the debug info GDB still finds and loads the separate debug info.
Approved-By: Tom Tromey <tom@tromey.com>
diff --git a/gdb/coffread.c b/gdb/coffread.c
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -725,7 +725,9 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
}
/* Try to add separate debug file if no symbols table found. */
- if (!objfile->has_partial_symbols ())
+ else if (!objfile->has_partial_symbols ()
+ && objfile->separate_debug_objfile == NULL
+ && objfile->separate_debug_objfile_backlink == NULL)
{
deferred_warnings warnings;
std::string debugfile