[PATCH] libdwfl: add dwfl_local_find_debuginfo callback

Mark Wielaard mark@klomp.org
Fri Jul 2 21:59:39 GMT 2021

Hi Nick,

Sorry for the late reply.

On Sun, Jun 13, 2021 at 11:27:02AM +0800, Nick Gasson via Elfutils-devel wrote:
> This patch adds a variant of dwfl_standard_find_debuginfo that only
> searches the local filesystem and does not fall back to debuginfod.
> In my application I am using libdw to decode stack traces where some of
> the loaded DSOs are generated on-the-fly by LLVM.  If these don't have
> debug information I want the find_debuginfo callback to fail immediately
> and not fall back to debuginfod which will never succeed.  Similarly if
> the main executable is stripped.  I supposed I could unset the
> DEBUGINFOD_URLS environment variable before calling into libdw, but that
> seems a bit hacky and liable to break in the future if the debuginfod
> client loads the URLs from a different place.

I don't think the (un)setting of DEBUGINFOD_URLS will ever change. It
is API now. But I can see a need for this.

I wonder if we can use the Dwfl_Callbacks debuginfo_path for this
instead of introducing a dwfl_standard_find_debuginfo variant. That
might make things a bit more configurable.

Something like the following maybe:

- If the last path element is "@" then the debuginfo client won't be used.
- If the last path element is "@{URLs}" (space separated) then the debuginfo client
  will be used with to given URLs.
- If there is no path element starting with @ then the default debuginfo client
  will be used after all local searches failed (or not when DEBUGINFOD_URLS isn't set).

Does that sound helpful? Does it make sense to make things configurable like this?



More information about the Elfutils-devel mailing list