According to lothar’s answer at How to generate gcc debug symbol outside the build target, I can create a two part executable – the stripped executable and the debug information file.
After creating the stripped executable and the debug information file, I install the executable as normal (with make install
). But I’m not sure what to do with the debug information file for Red Hat/Fedora.
I have two questions related to debugging the executable with GDB or LLDB (if debugging is needed):
What is the name of the debug information file on Red Hat/Fedora? Is there a convention to follow so the debugger associates them with the executable automatically?
Where do I place the the debug information file on Red Hat/Fedora? What is the location so the debugger finds them when debugging the executable?
Here’s a related question for a different platform: Debug information file conventions for Debian/Ubuntu? It would also be helpful to know the same for OS X since I work on it on occasion.
Advertisement
Answer
The Debuginfo Packaging page in the Fedora wiki discusses the generation (or lack thereof) of the -debuginfo
subpackage when creating a RPM package, but it also includes some information about the debuginfo itself. In short, the debug symbols should be placed under /usr/lib/debug
and the source under /usr/src/debug
. Reading the script named in that page (/usr/lib/rpm/find-debuginfo.sh
found in the rpm-build
package) will give more insight.