aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2023-10-12 19:42:19 +0100
committerAndrew Burgess <aburgess@redhat.com>2023-11-14 11:32:02 +0000
commit7628a997f27af115006c370d58f27d38330814fe (patch)
treebec2b6aa00600e8c0fc77c22129a8fddbcec0d65 /gdb
parentb2a6584d753a4dc94139e98c6998f570ed1e2341 (diff)
downloadgdb-7628a997f27af115006c370d58f27d38330814fe.zip
gdb-7628a997f27af115006c370d58f27d38330814fe.tar.gz
gdb-7628a997f27af115006c370d58f27d38330814fe.tar.bz2
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>
Diffstat (limited to 'gdb')
-rw-r--r--gdb/coffread.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/coffread.c b/gdb/coffread.c
index 4a6a83b..e1415d6 100644
--- 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