Print each section as independently as possible. Sections that
can safely be printed independently (like .debug_abbrev)
have relevant info printed in the report (sometimes dependent
Print the .debug_abbrev section. Because the DWARF specfications
do not rule out garbage data areas in .debug_abbrev (if they are not
referenced from .debug_info) any garbage bytes can result in
this print failing.
Print locations lists.
|-E||Print ELF header information and index, address and size for all sections.|
|-Eh||Effectively does nothing (use another tool to print the Elf file header).|
|-El||Print index, address and size for the .debug_line section.|
|-Ei||Print index, address and size for the .debug_info section.|
|-Ea||Print index, address and size for the .debug_abbrev section.|
|-Ep||Print index, address and size for the .debug_pubnames section.|
|-Er||Print index, address and size for the .debug_aranges section.|
|-Ef||Print index, address and size for the .debug_frame section.|
|-Eo||Print index, address and size for the .debug_loc section.|
|-ER||Print index, address and size for the .debug_ranges section.|
|-Es||Print index, address and size for the .debug_string section.|
|-Et||Print index, address and size for the .debug_pubtypes section.|
|-Ex||Print index, address and size for the .text section.|
Print index, address and size for the .text and .debug_* sections.
|-f||Print the .debug_frame section.|
Print the .eh_frame section.
Print IRIX exception tables (unsupported).
Print the .debug_info section.
|-l||Print the .debug_info section and the associated line section data.|
Print the .debug_info section and the associated line section data, but omits
the <pc> address. Useful when a comparison is required.
Print the .debug_macinfo section.
Print .debug_ranges section. Because the DWARF specfications
do not rule out garbage data areas in .debug_ranges (if they are not
referenced from .debug_info) any garbage bytes can result in
this print failing.
Print the .debug_pubnames section.
|-r||Print the .debug_aranges section.|
Print .debug_string section.
Print the IRIX only sections .debug_static_funcs and .debug_static_vars.
|-tf||Print the IRIX only section .debug_static_funcs.|
Print the IRIX only section .debug_static_vars.
Print the IRIX-only .debug_weaknames section.
Print the .debug_pubtypes section (and .debug_typenames,
an SGI IRIX-only section).
Having dwarfdump print relocations may help establish whether
dwarfdump understands any relocations that might exist.
|-o||Print all relocation records as well as we can manage.|
|-oi||Print .rel*debug_info relocations.|
|-ol||Print .rel*debug_line relocation.|
|-op||Print .rel*debug_pubnames relocation.|
|-oa||Has no effect.|
|-or||Print .rel*debug_aranges relocations.|
|-of||Print .rel*debug_frame relocations.|
|-oo||Print .rel*debug_loc relocations.|
Print .rel*debug_ranges relocations.
|-g||Normally used only for testing libdwarf, this tells dwarfdump to print .debug_info and use an older dwarf_loclist() interface function (a function that cannot handle all current location lists).|
Print a dwarfdump date/version string and stop.
-cg Restricts checking to compilers whose producer string starts with GNU and turns off -cs.
-cs Restricts checking to compilers whose producer string starts with SN and turns off -cg. -cname Restricts checking to compilers whose producer string contains name (not case sensitive). The name is read as a URI string.
-ka Turns on all checking options except -kxe (-kxe might be slow enough one mignt not want to use it routinely.)
-kb Checks for certain abbreviations section errors when reading DIEs. -kc Checks for errors in constants in debug_info. -kd Turns on full reporting of error totals per producer. (the default shows less detail). -ke Turns on reading pubnames and checking for fde errors. -kE Checks the integer encoding representation in debug_info, computing whether these integer values could fit in fewer bytes if represented in LEB128.
-kf Turns on checking for FDE errors. -kF Turns on checking for line table errors. -kg Turns on checking for unused gaps in .debug_info (these gaps are not an error, just a waste of space).
-ki Causes a summary of checking results per compiler (producer) to be printed at the end. -kl Turns on locations list checking. -km Turns on checking of ranges. -kM Turns on checking of aranges. -kr Turns on DIE tag-attr combinations checking. -kR Turns on reading DIEs and checking for forward declarations rom DW_AT_specification attributes. (which are not an error but can be a source of inefficiency for debuggers). -ks Turns on extra reporting for some DIE errors checking detects. -kS Turns on checking DIE references for circular references. -kt Turns on tag-tag combinations checking. -kx Turns on check_frames. -kxe Turns off basic check_frames and turns on extended frame checking. -ky Turns on type_offset, decl_file checking,
-C Normally when checking for tag-tag or tag-attribute combinations both the standard combinations and some common extensions are allowed. With -C the extensions are taken out of the allowed class of combinations.
-d When printing DIEs, put all the attributes for each DIE on the same (long) line as the TAG. This makes searching for DIE information (as with grep) much simpler as the entire DIE is on one line.
-D Turns off the display of section offsets and attribute values in printed output. So the .debug_info output is just TAGs and Attributes. For pubnames (and the like) it removes offsets from the output. For locations lists it removes offsets from the output, but that is useless since the attribute values dont show so neither does the location data.
-e Turns on truncation of attribute and tag names. For example DW_TAG_foo becomes foo. Not compatible with checking, only useful for printing DIEs.
-G When printing, add global offsets to the offsets printed.
-H number When printing or checking .debug_info, this terminates the search after number compilation units. When printing frame information this terminates the FDE reporting after number FDEs and the CIE reporting (which occurs if one adds -v) after number CIEs. Example -H 1
-M When printing, this means one want to have the FORM show for each attribute. If a -v is also added (or more than one) then details of any form indirection are also shown.
-n When printing frames, this turns off the search for function names. In a really large object the search can take more time than one wants to wait, so this avoids the search.
-Q Suppresses section data printing (set automatically with a checking option).
-R When printing frames for ABIs with lots of registers, this allows up to 1200 registers to be named (like R999) without choosing an ABI with, for example -x abi=ppc
-v Increases the detail shown when printing. In some sections, using more -v options will increase the detail (one to three are useful) or may change the report to show, for example, the actual line-data-commands instead of the resultant line-table.
These -S options stand alone and basic print information about the compilation unit and DIE where the string(s) appear. At most one of each of the following is effective (so for example one can only have one match, but one can have a match, an any, and a regex). Any -S causes the .debug_info section to be inspected. No checking options or printing options should be supplied with -S.
If v is added to the -S option, the number of occurrences is printed. (see below for an example).
-S match=string When printing DIEs for each tag value or attribute name that matches string exactly print the compilation unit information and its section offset. Any CU with no match is not printed. The string is read as a URI string. -S any=string When printing DIEs for each tag value or attribute name that contains string somewhere in the tag or attribute (case insensitive) print the compilation unit information and its section offset. Any CU with no match is not printed. The string is read as a URI string. -S regex=string When printing DIEs for each tag value or attribute name where the string reqular expression matches print the compilation unit information and its section offset. Any CU with no match is not printed. The string is read as a URI string.
The string cannot have spaces or other characters which are meaningful to getopt(3) and the shell will strip off quotes and other characters. So the string is assumed to be in URI style and is translated. In other words, to match a b make the -S string a%20b Instead of escaping " quotes in the string, type %25, as in
a "b should be typed a%20%25b (the are for exposition here, not part of the strings). Any characters can be typed in URI style, not just characters which are problematic to the shell or getopt.
The -S any= and -S regex= options are only usable if the library functions required are found at configure time. The -W option is a modifier to the -S option, and increases the amount of output -W prints. An example v modifier to the -S option is shown below. And we show the -W in context with a -S option.
-S vmatch=string1 Prints information about the DIEs that -S matches and prints the count of occurences
-S match=string1 -W Prints the parent tree and the children tree for the DIEs that -S matches.
-S match=string2 -Wp Prints the parent tree for the DIEs that -S matches.
-S match=string3 -Wc Prints the parent tree for the DIEs that -S matches.
-# number This option controls internal debugging output, higher numbers mean more debug actions. See the source code.
-x name=/p/a/t/h.conf The file path given is the name of a file assumed to be a dwarfdump.conf-like file. The file path is read as a URI string.
-x abi=ppc Selects the abi (from a dwarfdump.conf file) to be used in printing frame information (here using ppc as an example). The abi is read as a URI string.
-P When checking this adds the list of compilation-unit names seen for each producer-compiler to the printed checking results. -q When a URI is found and translated while reading the command line, be quiet about the URI translation. That is, dont print the original and translated option strings.
-E Turns on printing object-internal header data for some systems (for Unix/Linux does nothing).
-u cuname Turns on selective printing of DIEs (printing like -i). Only the DIEs for a compilation unit that match the name provided are printed. If the compilation unit is ./a/b/c.c the cuname you provide should be c.c as the characters through the final path-separating / are ignored. If cuname begins with a / then the entire name string of a compilation unit must match cuname. The cuname is read as a URI string.
-U Turn off the URI interpretation of the command line strings entirely. Must be be on the command line before any URI strings encountered to be fully effective.
-z No longer suported.
In some cases compilers use DW_FORM_data1 (for example) and in such cases the signedness of the value must be taken from context. Rather than attempt to determine the context, dwarfdump prints the value with both signednesses whenever there is ambiguity about the correct interpretation. For example, "DW_AT_const_value 176(as signed = -80)". For normal DWARF consumers that correctly and fully evaluate all attributes there is no ambiguity of signedness: the ambiguity for dwarfdump is due to dwarfdump evaluating DIEs in a simple order and not keeping track of much context.
Support for DWARF3 is being completed but may not be complete.