Bug 30000 - introduce new srcfiles tool
Summary: introduce new srcfiles tool
Status: RESOLVED FIXED
Alias: None
Product: elfutils
Classification: Unclassified
Component: debuginfod (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Serhei Makarov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-13 20:55 UTC by Frank Ch. Eigler
Modified: 2023-10-24 20:00 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Ch. Eigler 2023-01-13 20:55:51 UTC
Let's implement 

% debuginfod-find source-list PATH|BUILDID

so it fetches the debuginfo, then runs the dwarf_getsrcfiles / dwarf_getsrcdirs / CU comp_dir traversal, and prints a deduped list of all CUs' source file lists.  An adventurous user can then use that to fetch all source files of a particular binary.
Comment 1 Frank Ch. Eigler 2023-09-26 20:01:31 UTC
Work is now proceeding instead toward a tool src/srcfiles to list names of source files from dwarf content.

A hypothetical followup idea: an option for srcfiles and/or debuginfod-find that uses this list to construct a tarball of source files themselves (fetched via debuginfod).
Comment 2 Aaron Merey 2023-10-24 20:00:52 UTC
srcfiles tool has been added in the following commit

commit cb4f0e0fffbcdb124bd1b82f558095a9c7aa64b1
Author: Housam Alamour <halamour@redhat.com>
Date:   Thu Sep 7 14:29:19 2023 -0400

    PR 30000: debuginfod-find should have a source-list verb
    
    * seclines.cxx: Introduce new tool  that compiles a list of source
    files associated with a specified dwarf/elf file. This
    compilation relies on searching the dwarf debug information,
    which can be automatically retrieved via debuginfod using
    libdwfl functions when required. The target file can
    encompass various types, such as an executable, a coredump,
    a running process, or the currently executing kernel. The
    source file names are rendered as unique entries and then
    displayed on the standard output.
    
    *  run-srcfiles-self.sh: New test-case for tool.
    
    https://sourceware.org/bugzilla/show_bug.cgi?id=30000
    
    Signed-off-by: Housam Alamour <halamour@redhat.com>