LLVM-DWARFDUMP(1)

πŸ“¦
version 12.0.1 Β· 4 versions
, in fedora 43, fedora 44

okay bestie, welcome to LLVM-DWARFDUMP(1) β€” this is the LLVM page for llvm-dwarfdump, and it's genuinely one of my faves because it lets you peek directly inside DWARF debug info like it's a lil terrarium πŸ”¬βœ¨ let's get into it

🌸 NAME 🌸

llvm-dwarfdump β€” dump and verify DWARF debug information πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

llvm-dwarfdump [options] [filename ...]

🌈 DESCRIPTION 🌈

okay so here's the vibe: llvm-dwarfdump parses the DWARF sections living inside object files, archives, and .dSYM bundles, and then prints all that stuff out in a form a human can actually read. human-readable, iconic.

now the important part β€” by default it only prints the .debug_info section. that's it. just that one. if you want the other sections you have to ask for them with one of the section-specific options or with --all. no cap πŸ’…

and if you don't hand it any input file at all? it just uses a.out instead. and if you use - as the input file, llvm-dwarfdump reads the input from its standard input stream. cute, flexible, we love that 🫢


πŸŽ€ OPTIONS πŸŽ€

  • -a, --all β€” dump all supported DWARF sections. the whole buffet, not just the one plate ✨
  • --arch=<arch> β€” dump DWARF debug info for the specified CPU architecture. you can name the architecture by name or by number. this option can be specified multiple times, once for each architecture you want. by default, all CPU architectures get printed 🌈
  • -c, --show-children β€” show a debug info entry's children when you're selectively printing with the =<offset> argument of --debug-info, or with options like --find or --name πŸ‘Ά
  • --color β€” use colors in the output 🎨
  • -f <name>, --find=<name> β€” search for the exact text <name> in the accelerator tables and print the matching debug info entries. if there are no accelerator tables, or the name of the DIE you're hunting isn't in the accelerator tables, try the slower but more complete --name option instead πŸ”
  • -F, --show-form β€” show DWARF form types after the DWARF attribute types 🏷️
  • -h, --help β€” show help and usage for this command πŸ™‹
  • --help-list β€” show help and usage for this command without grouping the options into categories πŸ“‹
  • -i, --ignore-case β€” ignore case distinctions when using --name πŸ” 
  • -n <name>, --name=<name> β€” find and print all debug info entries whose name (the DW_AT_name attribute) is <name> 🏷️
  • --lookup=<address> β€” look up <address> in the debug information and print out the file, function, block, and line table details πŸ“
  • -o <path> β€” redirect output to a file specified by <path>, where - is the standard output stream πŸ“
  • -p, --show-parents β€” show a debug info entry's parents when you're selectively printing with the =<offset> argument of --debug-info, or with options like --find or --name πŸ‘ͺ
  • --parent-recurse-depth=<N> β€” when displaying debug info entry parents, only show them to a maximum depth of <N> πŸ“
  • --quiet β€” use with --verify to not emit to STDOUT 🀫
  • -r <N>, --recurse-depth=<N> β€” when displaying debug info entries, only show children to a maximum depth of <N> πŸ“
  • --show-section-sizes β€” show the sizes of all debug sections, expressed in bytes πŸ“
  • --statistics β€” collect debug info quality metrics and print the results as machine-readable single-line JSON output. the output format is described in the section below (FORMAT OF STATISTICS OUTPUT) πŸ“Š
  • --summarize-types β€” abbreviate the description of type unit entries βœ‚οΈ
  • -x, --regex β€” treat any <name> strings as regular expressions when searching with --name. if --ignore-case is also specified, the regular expression becomes case-insensitive 🧠
  • -u, --uuid β€” show the UUID for each architecture πŸ†”
  • --diff β€” dump the output in a format that is more friendly for comparing DWARF output from two different files βš–οΈ
  • -v, --verbose β€” display verbose information when dumping. this can help to debug DWARF issues πŸ—£οΈ
  • --verify β€” verify the structure of the DWARF information by verifying the compile unit chains, DIE relationships graph, address ranges, and more βœ…
  • --version β€” display the version of the tool πŸ”’

and now the section-by-section squad β€” every one of these dumps the specified DWARF section by name πŸ’–

  • --debug-abbrev β€” dump the .debug_abbrev section
  • --debug-addr β€” dump the .debug_addr section
  • --debug-aranges β€” dump the .debug_aranges section
  • --debug-cu-index β€” dump the .debug_cu_index section
  • --debug-frame[=<offset>] β€” dump .debug_frame, optionally at =<offset>
  • --debug-gnu-pubnames β€” dump the .debug_gnu_pubnames section
  • --debug-gnu-pubtypes β€” dump the .debug_gnu_pubtypes section
  • --debug-info [=<offset>] β€” dump .debug_info, optionally at =<offset>
  • --debug-line [=<offset>] β€” dump .debug_line, optionally at =<offset>
  • --debug-line-str β€” dump the .debug_line_str section
  • --debug-loc [=<offset>] β€” dump .debug_loc, optionally at =<offset>
  • --debug-loclists [=<offset>] β€” dump .debug_loclists, optionally at =<offset>
  • --debug-macro β€” dump the .debug_macro section
  • --debug-names β€” dump the .debug_names section
  • --debug-pubnames β€” dump the .debug_pubnames section
  • --debug-pubtypes β€” dump the .debug_pubtypes section
  • --debug-ranges β€” dump the .debug_ranges section
  • --debug-rnglists β€” dump the .debug_rnglists section
  • --debug-str β€” dump the .debug_str section
  • --debug-str-offsets β€” dump the .debug_str_offsets section
  • --debug-tu-index β€” dump the .debug_tu_index section
  • --debug-types [=<offset>] β€” dump .debug_types, optionally at =<offset>
  • --eh-frame [=<offset>] β€” dump .eh_frame, optionally at =<offset>
  • --gdb-index β€” dump the .gdb_index section
  • --apple-names β€” dump the .apple_names section
  • --apple-types β€” dump the .apple_types section
  • --apple-namespaces β€” dump the .apple_namespaces section
  • --apple-objc β€” dump the .apple_objc section

okay and here's the rules for that whole section squad, bestie: only the .debug_info section is shown by default. some of those entries support adding an =<offset> as a way to provide an optional offset of the exact entry to dump within the respective section. when an offset is provided, only the entry at that offset gets dumped β€” otherwise the entire section gets dumped. periodt πŸ’…

  • @<FILE> β€” read command-line options from <FILE> πŸ“„

πŸ“Š FORMAT OF STATISTICS OUTPUT πŸ“Š

so the --statistics option generates single-line JSON output representing quality metrics of the processed debug info. these metrics are useful to compare changes between two compilers, particularly for judging the effect that a change to the compiler has on the debug info quality. very "who changed what and did it make things worse" energy 😭

the output is formatted as key-value pairs. the first pair contains a version number. the following naming scheme is used for the keys:

  • variables ==> local variables and parameters
  • local vars ==> local variables
  • params ==> formal parameters

for aggregated values, the following keys are used:

  • sum_of_all_variables(...) ==> the sum applied to all variables
  • #bytes ==> the number of bytes
  • #variables - entry values ... ==> the number of variables excluding the entry values etc.

🚦 EXIT STATUS 🚦

llvm-dwarfdump returns 0 if the input files were parsed and dumped successfully. otherwise, it returns 1. so like, zero is the slay outcome, one is the "something went sideways" outcome πŸ’€


πŸ‘€ SEE ALSO πŸ‘€

dsymutil(1)


🫢 AUTHOR 🫢

maintained by the LLVM Team (https://llvm.org/). they keep this thing alive, respect πŸ‘‘


2003-2024, LLVM Project


and that's the whole page bestie, mwah πŸ’‹ this was LLVM-DWARFDUMP(1) from the LLVM fam, and this version of the page is dated 2024-07-18 β€” go dump something iconic πŸ¦‹βœ¨πŸ’–

πŸ“¦ where this page comes from