Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: Sergio Durigan Junior <sergiodj@sergiodj.net>,
	gdb-patches@sourceware.org
Subject: Re: [PATCH] Search for DWZ files in debug-file-directories as well
Date: Sun, 15 Nov 2020 14:19:03 +0100	[thread overview]
Message-ID: <f89997592e9bd39b380d5141914f056bf65fe0a6.camel@klomp.org> (raw)
In-Reply-To: <20201114234842.2334396-1-sergiodj@sergiodj.net>

Hi Sergio,

On Sat, 2020-11-14 at 18:48 -0500, Sergio Durigan Junior wrote:
> Separate debug info file: /usr/lib/debug/.dwz/x86_64-linux-gnu/coreutils.debug
> [...]
> It occurred to me that a good way to workaround this problem is to
> actually try to locate the DWZ alt debug file inside the
> debug-file-directories (that were likely provided by the user).  So
> this is what the proposed patch does.
> 
> The idea here is simple: get the filename extracted from the
> .gnu_debugaltlink section, and manipulate it in order to replace the
> initial part of the path (everything before "/.dwz/") by whatever
> debug-file-directories the user might have provided.
> 
> I talked with Mark Wielaard and he agrees this is a sensible
> approach.
> In fact, apparently this is something that eu-readelf also does.

I double checked what elfutils libdw (the dwfl interface) does for alt
files. In general it tries to find them similar to how .debug files are
found described in libdwfl.h under *** Standard callbacks ***:
https://sourceware.org/git/?p=elfutils.git;a=blob;f=libdwfl/libdwfl.h;hb=HEAD#l242
Then for alt files it also looks for a .dwz subdir to find the basename
of the alt file. Which is close to what you are proposing. But your
version would also find alt files in (arch) subdirs of the .dwz dir.
Which seems to be an extension of Debian/Ubuntu. In Fedora/CentOS the
arch is part of the basename (e.g. the elfutils supplemental file is
called elfutils-0.179-1.fc32.i386 or elfutils-0.182-1.fc33.x86_64). It
might make sense to match what you are doing if the alt file path
contains /.dwz/ and has any directories after it (presumably
representing the arch).

Cheers,

Mark

  reply	other threads:[~2020-11-15 13:19 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-14 23:48 Sergio Durigan Junior via Gdb-patches
2020-11-15 13:19 ` Mark Wielaard [this message]
2020-11-16  1:25 ` Simon Marchi
2020-11-16  9:32   ` Mark Wielaard
2020-11-16 17:57   ` Sergio Durigan Junior via Gdb-patches
2020-11-19  2:27 ` [PATCH v2] " Sergio Durigan Junior via Gdb-patches
2020-11-25 15:09   ` Sergio Durigan Junior via Gdb-patches
2020-11-25 16:58   ` Luis Machado via Gdb-patches
2020-11-28 20:51     ` Sergio Durigan Junior via Gdb-patches
2020-11-26 16:53   ` Simon Marchi
2020-11-28 20:58     ` Sergio Durigan Junior via Gdb-patches
2020-11-28 21:35       ` Sergio Durigan Junior via Gdb-patches
2020-11-28 22:13         ` Simon Marchi
2020-11-28 22:12       ` Simon Marchi
2020-11-29  0:57         ` Sergio Durigan Junior via Gdb-patches
2020-11-29  1:29           ` Simon Marchi
2020-11-29  1:08 ` [PATCH v3] " Sergio Durigan Junior via Gdb-patches
2020-12-01 14:45   ` Simon Marchi
2020-12-02  3:08     ` Sergio Durigan Junior via Gdb-patches

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=f89997592e9bd39b380d5141914f056bf65fe0a6.camel@klomp.org \
    --to=mark@klomp.org \
    --cc=gdb-patches@sourceware.org \
    --cc=sergiodj@sergiodj.net \
    /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