Linux command
dwp 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Package
dwp -o [out.dwp] [a.dwo] [b.dwo]
Package all .dwo files
dwp -e [program] -o [program.dwp]
List .dwo files
dwp @[dwo_list.txt] -o [out.dwp]
Show help
dwp -h
说明
dwp (DWARF packaging utility) combines DWARF debugging information from multiple split-DWARF object files (.dwo) into a single package file (.dwp). This is part of the split-DWARF workflow enabled by gcc -gsplit-dwarf or clang -gsplit-dwarf, where the compiler writes most debug data into per-translation-unit .dwo files rather than embedding it in the linked binary. Packaging the .dwo files with dwp keeps debug info distributable as a single file and lets debuggers locate symbols by following the DW_AT_GNU_dwo_name / DW_AT_GNU_dwo_id references stored in the executable. Split DWARF significantly reduces link times and executable sizes while preserving full source-level debugging, which is especially valuable for large C++ codebases.
参数
- -e _executable_, --exec _executable_
- Read the list of .dwo files from the DW_AT_GNU_dwo_name attributes inside the given executable or shared library.
- -o _file_, --output _file_
- Write the packaged DWARF to _file_. Defaults to a.dwp if omitted.
- -v, --verbose
- Print the name of each .dwo file as it is added.
- @_file_
- Read additional command-line arguments (typically .dwo file names) from _file_, one per line.
- -h, --help
- Display usage information.
- -V, --version
- Print version information.
FAQ
What is the dwp command used for?
dwp (DWARF packaging utility) combines DWARF debugging information from multiple split-DWARF object files (.dwo) into a single package file (.dwp). This is part of the split-DWARF workflow enabled by gcc -gsplit-dwarf or clang -gsplit-dwarf, where the compiler writes most debug data into per-translation-unit .dwo files rather than embedding it in the linked binary. Packaging the .dwo files with dwp keeps debug info distributable as a single file and lets debuggers locate symbols by following the DW_AT_GNU_dwo_name / DW_AT_GNU_dwo_id references stored in the executable. Split DWARF significantly reduces link times and executable sizes while preserving full source-level debugging, which is especially valuable for large C++ codebases.
How do I run a basic dwp example?
Run `dwp -o [out.dwp] [a.dwo] [b.dwo]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -e _executable_, --exec _executable_ do in dwp?
Read the list of .dwo files from the DW_AT_GNU_dwo_name attributes inside the given executable or shared library.