调试Red Hat / Fedora的信息文件惯例? [英] Debug information file conventions for Red Hat/Fedora?

查看:146
本文介绍了调试Red Hat / Fedora的信息文件惯例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据lothar在如何在构建目标之外生成gcc调试符号的回答,我可以创建一个两部分可执行文件 - 剥离可执行文件和调试信息文件。



创建剥离的可执行文件和调试信息文件后,我像常规那样安装可执行文件(使用 make install )。但我不确定如何处理Red Hat / Fedora的调试信息文件。



我有两个问题涉及用GDB或LLDB调试可执行文件(if需要调试):


  • Red Hat / Fedora上调试信息文件的名称是什么?是否有一个约定,以便调试器自动将它们与可执行文件相关联?


  • 我在哪里将调试信息文件放在Red Hat / Fedora上?调试器在调试可执行文件时发现它们的位置是什么?

  • 下面是针对不同平台的相关问题: 调试Debian / Ubuntu的信息文件约定 由于我有时会对OS X有所了解,因此了解OS X的相关知识也是有帮助的。 Debuginfo Packaging页面讨论了创建RPM包时 -debuginfo 子包的生成(或缺少),但它也包含了一些有关debuginfo本身的信息。简而言之,调试符号应该放在 / usr / lib / debug 下,并且放在 / usr / src / debug 。阅读该页面中指定的脚本( rpm-build 中找到的 /usr/lib/rpm/find-debuginfo.sh c>包)将给予更多的见解。


    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.

    解决方案

    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.

    这篇关于调试Red Hat / Fedora的信息文件惯例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆