EU-SRCFILES(1)

πŸ“¦
version 0.197 Β· 2 versions
  • 0.197 Β· alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 0.190 Β· ubuntu noble
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– EU-SRCFILES(1) πŸ’–

okay bestie, pull up a chair, this is eu-srcfiles from the elfutils manual (General Commands Manual section, iykyk) and she is so useful. let's get into it 🫢


✨ NAME ✨

eu-srcfiles β€” she lists the source files of a DWARF/ELF file. that's the whole job. that's her main character energy. πŸ‘‘


✨ SYNOPSIS ✨

eu-srcfiles [-0|--null] [-c|--cu-only] [-v|--verbose] [-z|--zip] INPUT

✨ DESCRIPTION ✨

okay so here's the tea β˜• β€” eu-srcfiles lists all the source files of a given DWARF/ELF file. that list comes from searching the DWARF debuginfo, and that debuginfo may get automatically fetched by debuginfod if applicable. no cap.

and like, the target file? it can be literally anything:

  • an executable
  • a coredump
  • a process
  • or even the running kernel 🌈

the default input is the file a.out (yes, that a.out, the og).

the source file names get made unique by prepending the full path name, and then they're printed to standard output. and if you want, the source files can be placed in a zip file that gets sent to stdout. it's giving "here's your whole source tree in a zip" πŸ’…

heads up bestie: all occurrences of /./ and /../ in the path name are canonicalized. so don't come for her about path weirdness, she already handled it ✨

✨ INPUT OPTIONS ✨

the long and short forms of options, shown here as alternatives, are equivalent. fr fr, pick whichever one feels right in your heart πŸ’œ

  • --core=COREFILE β€” find addresses from signatures found in COREFILE.
  • --debuginfo-path=PATH β€” search path for separate debuginfo files. that's where she goes looking for the goods.
  • *-e *FILE, --executable=FILE β€” find addresses in FILE.
  • -k, --kernel β€” find addresses in the running kernel. yes, the actual live kernel, she's not scared 🧚
  • -K, --offline-kernel[=RELEASE] β€” kernel with all modules.
  • *-M *FILE, --linux-process-map=FILE β€” find addresses in files mapped as read from FILE in Linux /proc/PID/maps format.
  • *-p *PID, --pid=PID β€” find addresses in files mapped into process PID.
  • -?, --help β€” give this help list. she will simply tell you the options.
  • --usage β€” give a short usage message.
  • -V, --version β€” print program version.

✨ OUTPUT OPTIONS ✨

  • -0, --null β€” separate items by a null instead of a newline. for when newlines are simply not the vibe.
  • -b, --no-backup β€” disables local source file search when debuginfod fails to fetch files. ⚠️ this option is only applicable when fetching and zipping files. so don't expect it to do anything in other situations, bestie.
  • -c, --cu-only β€” only list the CU (compilation unit) names. short and sweet, love that for her πŸŽ€
  • -v, --verbose β€” increase verbosity of logging messages. more lore, more logging.
  • -z, --zip β€” zip all the source files and send to stdout. by default, files will be automatically fetched by debuginfod (if applicable) or locally as a backup. any source files that were not found will not be archived β€” so yeah, missing is missing, no magic πŸ’€

✨ EXAMPLES ✨

list all source files for a binary

eu-srcfiles -e /bin/ls

list all compilation units (CU) names for a given process (including shared libraries)

eu-srcfiles -c -p $$

list source files of a binary based on its buildid, using debuginfod

binary=`debuginfod-find executable 9c22d8d9e42bd051ffdc1064fdfd456ba781c629`
eu-srcfiles -c -e $binary

show the source code of the first CU of a shared library

binary=/usr/lib64/libc.so.6
srcfile=`eu-srcfiles -c -e $binary | head -1`
cat `debuginfod-find source $binary $srcfile`

list the source files of a kernel image

eu-srcfiles -e /boot/vmlinuz-`uname -r`

zip all the source files for a binary

eu-srcfiles -z -e /bin/ls > ls.zip

✨ AUTHOR ✨

written by Housam Alamour. ty king 🫢


✨ REPORTING BUGS ✨

please reports bugs at https://sourceware.org/bugzilla/ β€” be nice about it, it's giving constructive πŸ’…


copyright (c) 2023 Red Hat Inc. License GPLv3+: GNU GPL version 3 or later https://gnu.org/licenses/gpl.html. this is free software: you are free to change and redistribute it. there is NO WARRANTY, to the extent permitted by law. periodt. πŸ”₯


and that's the whole page, bestie!! πŸ’– this one is from elfutils, dated 2023-Sept-25, and yeah, EU-SRCFILES(1) ate and left no crumbs. go list some source files, you got this πŸŒΈπŸ¦‹

πŸ“¦ where this page comes from