From: Andrew Burgess <aburgess@redhat.com>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 1/5] gdb/coffread: bring separate debug file logic into line with elfread.c
Date: Tue, 24 Oct 2023 12:59:55 +0100 [thread overview]
Message-ID: <87msw82ptw.fsf@redhat.com> (raw)
In-Reply-To: <87bkctp58a.fsf@tromey.com>
Tom Tromey <tom@tromey.com> writes:
>>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes:
>
> Andrew> I haven't tested this, I don't have a coff target to hand.
>
> I suspect you can do a smoke test by building a "hello world" with the
> the mingw toolchain shipped in Fedora. IIRC this goes through
> coff_symfile_read.
Yes it does. I've given this a try and I still see the debug
information being loaded so I've updated the commit message to indicate
that minimal testing has been done.
> The suspected-to-be-dead part of coffread is coffstab_build_psymtabs.
I didn't understand this part.
Thanks,
Andrew
---
commit 3ea19ccbd59c20d5534c9331c10766eb707ce81d
Author: Andrew Burgess <aburgess@redhat.com>
Date: Thu Oct 12 19:42:19 2023 +0100
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.
diff --git a/gdb/coffread.c b/gdb/coffread.c
index 4a6a83b15ad..e1415d6b258 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
next prev parent reply other threads:[~2023-10-24 12:00 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-18 10:53 [PATCH 0/5] New Python hook for missing debug information Andrew Burgess
2023-10-18 10:53 ` [PATCH 1/5] gdb/coffread: bring separate debug file logic into line with elfread.c Andrew Burgess
2023-10-20 17:35 ` Tom Tromey
2023-10-24 11:59 ` Andrew Burgess [this message]
2023-10-18 10:53 ` [PATCH 2/5] gdb: merge debug symbol file lookup code from coffread & elfread paths Andrew Burgess
2023-10-18 13:18 ` Jon Turney
2023-10-18 17:25 ` Andrew Burgess
2023-10-18 10:53 ` [PATCH 3/5] gdb: refactor objfile::find_and_add_separate_symbol_file Andrew Burgess
2023-10-20 17:50 ` Tom Tromey
2023-10-24 12:03 ` Andrew Burgess
2023-11-08 15:22 ` Andrew Burgess
2023-10-18 10:53 ` [PATCH 4/5] gdb: add an extension language hook for missing debug info Andrew Burgess
2023-10-18 10:53 ` [PATCH 5/5] gdb: implement missing debug handler hook for Python Andrew Burgess
2023-10-18 12:08 ` Eli Zaretskii
2023-11-08 15:48 ` [PATCHv2 0/5] New Python hook for missing debug information Andrew Burgess
2023-11-08 15:48 ` [PATCHv2 1/5] gdb/coffread: bring separate debug file logic into line with elfread.c Andrew Burgess
2023-11-08 15:48 ` [PATCHv2 2/5] gdb: merge debug symbol file lookup code from coffread & elfread paths Andrew Burgess
2023-11-08 15:48 ` [PATCHv2 3/5] gdb: refactor objfile::find_and_add_separate_symbol_file Andrew Burgess
2023-11-08 15:48 ` [PATCHv2 4/5] gdb: add an extension language hook for missing debug info Andrew Burgess
2023-11-08 15:48 ` [PATCHv2 5/5] gdb: implement missing debug handler hook for Python Andrew Burgess
2023-11-12 22:38 ` Tom Tromey
2023-11-15 12:36 ` Tom de Vries
2023-11-16 10:59 ` Andrew Burgess
2023-11-16 11:16 ` Tom de Vries
2023-11-16 17:21 ` Andrew Burgess
2023-11-16 15:26 ` Tom Tromey
2023-11-12 22:39 ` [PATCHv2 0/5] New Python hook for missing debug information Tom Tromey
2023-11-13 16:04 ` Andrew Burgess
2023-11-13 17:18 ` Tom Tromey
2023-11-12 22:40 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87msw82ptw.fsf@redhat.com \
--to=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).