Red Hat Training

A Red Hat training course is available for Red Hat Developer Toolset

Chapter 6. dwz

dwz is a command line tool that attempts to optimize DWARF debugging information contained in ELF shared libraries and ELF executables for size. To do so, dwz replaces DWARF information representation with equivalent smaller representation where possible and reduces the amount of duplication by using techniques from Appendix E of the DWARF Standard.

Red Hat Developer Toolset is distributed with dwz 0.12.

6.1. Installing dwz

In Red Hat Developer Toolset, the dwz utility is provided by the devtoolset-7-dwz package and is automatically installed with devtoolset-7-toolchain as described in Section 1.5, “Installing Red Hat Developer Toolset”.

6.2. Using dwz

To optimize DWARF debugging information in a binary file, run the dwz tool as follows:

$ scl enable devtoolset-7 'dwz option... file_name'

Note that you can execute any command using the scl utility, causing it to be run with the Red Hat Developer Toolset binaries used in preference to the Red Hat Enterprise Linux system equivalent. This allows you to run a shell session with Red Hat Developer Toolset dwz as default:

$ scl enable devtoolset-7 'bash'

To verify the version of dwz you are using at any point:

$ which dwz

Red Hat Developer Toolset’s dwz executable path will begin with /opt. Alternatively, you can use the following command to confirm that the version number matches that for Red Hat Developer Toolset dwz:

$ dwz -v

6.3. Additional Resources

A detailed description of dwz and its features is beyond the scope of this book. For more information, see the resources listed below.

Installed Documentation

  • dwz(1) — The manual page for the dwz utility provides detailed information on its usage. To display the manual page for the version included in Red Hat Developer Toolset:

    $ scl enable devtoolset-7 'man dwz'

See Also