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.
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).
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>