Debug information file conventions for Red Hat/Fedora?

China☆狼群 提交于 2019-12-13 00:39:30

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/28787559/debug-information-file-conventions-for-red-hat-fedora

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!