From Fedora Project Wiki
Description
This test case validates that the debugedit tool is functioning correctly by editing and verifying a debuginfo file.
Setup
Ensure that the debugedit package is installed:
sudo dnf install rpmdevtools
How to test
- Create a directory for the test
mkdir ~/debugedit-test
cd ~/debugedit-test
- Create a simple C program
echo -e '#include <stdio.h>\nint main() { printf("Hello, World!\\n"); return 0; }' > hello.c
- Compile the C program with debug information
gcc -g -o hello hello.c
- Extract the debuginfo
objcopy --only-keep-debug hello hello.debug
- Use debugedit to modify the file paths in the debuginfo file
debugedit -b /tmp/build-dir -d /usr/src/debug -i -l ~/changes.log hello.debug
Expected Results
- The debugedit command should complete without errors.
- The
~/changes.log
file should contain the changes made by debugedit.
Optional
For exploratory testing:
- Try editing different debuginfo files with different options.
- Experiment with
-F
option for canonicalizing the file names. - Use the
readelf -w hello.debug
command to view the modified file paths and check that they were changed as expected.