LLVM-DWARFDUMP(1)
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--findor--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--nameoption 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 (theDW_AT_nameattribute) 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--findor--nameπͺ--parent-recurse-depth=<N>β when displaying debug info entry parents, only show them to a maximum depth of<N>π--quietβ use with--verifyto 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-caseis 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_abbrevsection--debug-addrβ dump the.debug_addrsection--debug-arangesβ dump the.debug_arangessection--debug-cu-indexβ dump the.debug_cu_indexsection--debug-frame[=<offset>]β dump.debug_frame, optionally at=<offset>--debug-gnu-pubnamesβ dump the.debug_gnu_pubnamessection--debug-gnu-pubtypesβ dump the.debug_gnu_pubtypessection--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_strsection--debug-loc [=<offset>]β dump.debug_loc, optionally at=<offset>--debug-loclists [=<offset>]β dump.debug_loclists, optionally at=<offset>--debug-macroβ dump the.debug_macrosection--debug-namesβ dump the.debug_namessection--debug-pubnamesβ dump the.debug_pubnamessection--debug-pubtypesβ dump the.debug_pubtypessection--debug-rangesβ dump the.debug_rangessection--debug-rnglistsβ dump the.debug_rnglistssection--debug-strβ dump the.debug_strsection--debug-str-offsetsβ dump the.debug_str_offsetssection--debug-tu-indexβ dump the.debug_tu_indexsection--debug-types [=<offset>]β dump.debug_types, optionally at=<offset>--eh-frame [=<offset>]β dump.eh_frame, optionally at=<offset>--gdb-indexβ dump the.gdb_indexsection--apple-namesβ dump the.apple_namessection--apple-typesβ dump the.apple_typessection--apple-namespacesβ dump the.apple_namespacessection--apple-objcβ dump the.apple_objcsection
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 π
π«Ά AUTHOR π«Ά
maintained by the LLVM Team (https://llvm.org/). they keep this thing alive, respect π
Β©οΈ COPYRIGHT Β©οΈ
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
- fedora 43: llvm12 12.0.1-12.fc41 Β· NCSA
- fedora 43: llvm12 12.0.1-12.fc41 Β· NCSA
- fedora 44: llvm12 12.0.1-12.fc41 Β· NCSA
- fedora 44: llvm12 12.0.1-12.fc41 Β· NCSA
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms