public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: Jon Turney <jon.turney@dronecode.org.uk>, gdb-patches@sourceware.org
Subject: Re: [PATCH 2/5] gdb: merge debug symbol file lookup code from coffread & elfread paths
Date: Wed, 18 Oct 2023 18:25:37 +0100	[thread overview]
Message-ID: <87bkcv4zce.fsf@redhat.com> (raw)
In-Reply-To: <03de655e-5fab-46a6-b2ee-3ef3ddf185e1@dronecode.org.uk>

Jon Turney <jon.turney@dronecode.org.uk> writes:

> On 18/10/2023 11:53, Andrew Burgess wrote:
>> This commit merges the code that looks for and loads the separate
>> debug symbol files from coffread.c and elfread.c.  The factored out
>> code is moved into a new objfile::find_and_add_separate_symbol_file()
>> method.
>> 
>> For the elfread.c path there should be no user visible changes after
>> this commit.
>> 
>> For the coffread.c path GDB will now attempt to perform a debuginfod
>> lookup for the missing debug information, assuming that GDB can find a
>> build-id in the COFF file.
>> 
>> I don't know if COFF files can include a build-id, but I the existing
>
> This is at least possible for PE/COFF.
>
> (I wrote the code to add support for this back in 2015, see commit 
> c74f7d1c6c5a968330208757f476c67a4bb66643)

Thanks for the link.  I figured they probably could based on the code,
but I didn't dig too hard as I didn't think it really mattered for this
change.

Thanks,
Andrew

>
>> coffread.c code already includes a call to
>> find_separate_debug_file_by_build-id, so I know that it is at least OK
>> for GDB to ask a COFF file for a build-id.  If the COFF file doesn't
>> include a build-id then the debuginfod lookup code will not trigger
>> and the new code is harmless.
>> 
>> If the COFF file does include a build-id, then we're going to end up
>> asking debuginfod for the debug file.  As build-ids should be unique,
>> this should be harmless, even if debuginfod doesn't contain any
>> suitable debug data, it just costs us one debuginfod lookup, so I'm
>> not too worried about this for now.
>
> But yes, as you say, should be harmless.
>
>> I don't have access to a COFF target right now, so beyond compiling
>> it, the coffread.c changes are completely untested.


  reply	other threads:[~2023-10-18 17:25 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
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 [this message]
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=87bkcv4zce.fsf@redhat.com \
    --to=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jon.turney@dronecode.org.uk \
    /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).