From Fedora Project Wiki
Description
This test case ensures that dwz
can optimize DWARF debugging information in ELF binaries without corruption.
Setup
- Ensure
dwz
is installed using:dnf install dwz
. - Compile a helloworld C/C++ application with debugging information:
gcc -g -o sample sample.c
.
How to test
- Optimize the debugging information with
dwz
:dwz sample
. - Use a debugging tool, like
gdb
, to debug thesample
binary. - Check if debug symbols are accessible and the application is debuggable.
Expected Results
- Debugging tools should access the symbols and debug the application without any issues, indicating the DWARF sections were not corrupted.
dwz
should complete its optimization without errors.
[r00t@fedora ~]$ dwz sample
dwz: sample: DWARF compression not beneficial - old size 340 new size 340
Optional
- Run
dwz
on more complex applications or shared libraries. - Monitor for any size reduction in the debugging information.
- Check for speed improvements during debugging due to optimized debug info.