LLVM-DWARFUTIL(1)

πŸ’… LLVM-DWARFUTIL(1) β€” like, the whole manual, but make it make sense

okay bestie, welcome to the LLVM corner of the manual pages, this one's llvm-dwarfutil and honestly? it's giving "quiet little tool that does a LOT" ✨


πŸŽ€ NAME πŸŽ€

llvm-dwarfutil β€” a tool to copy and manipulate debug info πŸ¦‹


✨ SYNOPSIS ✨

llvm-dwarfutil [options] input output

that's it. that's the shape of it. input, output, and whatever options your heart desires πŸ’–


πŸ’œ DESCRIPTION πŸ’œ

so llvm-dwarfutil is a tool to copy and manipulate debug info. iconic behavior fr.

in basic usage, it makes a semantic copy of the input to the output β€” like, the vibes are preserved, not just the bytes. and if you pass any options, the output may get modified along the way, e.g. by removing unused debug info. lowkey a glow-up for your binary πŸ”₯

if - is specified for the input file, the input is read from the program's standard input stream. if - is specified for the output file, the output is written to the standard output stream of the program. pipe girlies, this one's for you 🫢

heads up bestie: the tool is still in active development. it's a work in progress, main character energy but still growing 🌱

🌈 COMMAND-LINE OPTIONS 🌈

  • --garbage-collection β€” removes pieces of debug information related to discarded sections. here's the tea: when the linker does section garbage collection, the abandoned debug info is left behind πŸ—‘οΈ and that abandoned debug info references address ranges using tombstone values. so when this option is specified, the tool removes debug info which is marked with the tombstone value. it's enabled by default, no cap ⭐
  • --odr-deduplication β€” remove duplicated types (if "One Definition Rule" is supported by source language). it keeps the first type definition and removes other definitions, potentially significantly reducing the size of output debug info. also enabled by default. slay, less bytes πŸ’…
  • --help, -h β€” print a summary of command line options. the classic "what does anything do again" button πŸ™ˆ
  • --no-garbage-collection β€” disable --garbage-collection.
  • --no-odr-deduplication β€” disable --odr-deduplication.
  • --no-separate-debug-file β€” disable --separate-debug-file.
  • --num-threads=<n>, -j β€” specifies the maximum number (n) of simultaneous threads to use for processing. parallel processing, we love to see it 🧚
  • --separate-debug-file β€” generate a separate file containing output debug info. using llvm-dwarfutil with that option equals to the following set of commands:
llvm-objcopy --only-keep-debug in-file out-file.debug
llvm-objcopy --strip-debug in-file out-file
llvm-objcopy --add-gnu-debuglink=out-file.debug out-file
  • --tombstone=<value> β€” value can be one of the following values:
    • bfd: zero for all addresses and [1,1] for DWARF v4 (or less) address ranges and exec.
    • maxpc: -1 for all addresses and -2 for DWARF v4 (or less) address ranges.
    • universal: both bfd and maxpc.
    • exec: match with address ranges of executable sections.

the value universal is used by default. πŸ‘‘

  • --verbose β€” enable verbose logging. this option disables multi-thread mode 🫠
  • --verify β€” run the DWARF verifier on the output DWARF debug info. trust but verify, periodt βœ…
  • --version β€” print the version of this program.

πŸ¦‹ SUPPORTED FORMATS πŸ¦‹

the following formats are currently supported by llvm-dwarfutil:

  • ELF

just ELF. that's the list. short and sweet πŸ“


πŸ’€ EXIT STATUS πŸ’€

llvm-dwarfutil exits with a non-zero exit code if there is an error. otherwise, it exits with code 0. so like, if your script is checking $?, it's gonna behave 😌


🌸 BUGS 🌸

to report bugs, please visit <https://github.com/llvm/llvm-project/labels/tools:llvm-dwarfutil/>. go tell them everything, they wanna know πŸŽ€


πŸ‘‘ AUTHOR πŸ‘‘

maintained by the LLVM Team (<https://llvm.org/>). kings πŸ’œ


2003-2023, LLVM Project


okay that's the whole page, go forth and debug ✨ and just so you know β€” this was LLVM llvm-dwarfutil version 17, dated 2023-12-01. love that for us πŸ’– bye bestie!! 🌈

πŸ“¦ where this page comes from