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:

  1. sudo dnf install rpmdevtools

How to test

  1. Create a directory for the test
  2. mkdir ~/debugedit-test
  3. cd ~/debugedit-test
  4. Create a simple C program
  5. echo -e '#include <stdio.h>\nint main() { printf("Hello, World!\\n"); return 0; }' > hello.c
  6. Compile the C program with debug information
  7. gcc -g -o hello hello.c
  8. Extract the debuginfo
  9. objcopy --only-keep-debug hello hello.debug
  10. Use debugedit to modify the file paths in the debuginfo file
  11. debugedit -b /tmp/build-dir -d /usr/src/debug -i -l ~/changes.log hello.debug

Expected Results

  1. The debugedit command should complete without errors.
  2. The ~/changes.log file should contain the changes made by debugedit.

Optional

For exploratory testing:

  1. Try editing different debuginfo files with different options.
  2. Experiment with -F option for canonicalizing the file names.
  3. Use the readelf -w hello.debug command to view the modified file paths and check that they were changed as expected.