LinuxCommandLibrary

dwp

Inspect and debug Wayland protocol

SYNOPSIS

dwp [options] [dwo-files...] | directory

PARAMETERS

-h, --help
    Display help and exit

-V, --version
    Display version info and exit

-o NAME, --output-file=NAME
    Set output .dwp filename

-d DIR, --directory=DIR
    Search for .dwo files in DIR

--compress, --no-compress
    Enable/disable compression (default: compress)

--compress-algorithm=ALG
    Set compression algorithm (zlib, zstd)

--force-write
    Overwrite existing output file

--check
    Verify package integrity

--info
    Print package information

-v, --verbose
    Increase verbosity

--print-dwo-name
    Print canonical DWO name

--section=.secname
    Specify section to process

DESCRIPTION

The dwp command, part of GNU Binutils, is the DWARF Packager used to combine multiple .dwo files into a single .dwp archive. This is essential for split DWARF debugging, where compilers like GCC and Clang (with -gsplit-dwarf) generate separate .dwo files containing debug information, keeping executables smaller.

dwp indexes and packs these files by creating a package index, allowing debuggers like GDB to access debug info efficiently from one file instead of many scattered ones. It supports compression, custom output names, and directory scanning for .dwo files.

Common workflow: Compile with split dwarf, collect .dwo files, run dwp to bundle them into .dwp, then distribute executable + .dwp for debugging. This improves build systems and debug info management in large projects.

CAVEATS

Requires matching compilation units across .dwo files; mismatches cause errors.
Output overwrites only with --force-write. Large packages may need ample memory.

EXAMPLE USAGE

dwp -o app.dwp *.dwo
Packs all .dwo into app.dwp.

dwp objdir/
Packs from directory.

INPUT SOURCES

Accepts explicit .dwo files, directories (scans recursively for *.dwo), or existing .dwp for repacking.

HISTORY

Introduced in Binutils 2.21 (2011) to support GCC 4.8's split DWARF (-gsplit-dwarf). Enhanced in later versions with compression (zlib/zstd) and better indexing for Clang/GCC.

SEE ALSO

gdb(1), objdump(1), dwarfdump(1), strip(1)

Copied to clipboard