简体   繁体   English

在UNIX上获取调试符号

[英]Getting debug symbols on UNIX


On windows we can get the debug symbols using the dbgHelp library. 在Windows上,我们可以使用dbgHelp库获取调试符号。
How can we do it on UNIX/linux (with c++)? 我们如何在UNIX / Linux(使用C ++)上做到这一点?

thanks :) 谢谢 :)

This is dependent on exactly which Unix version or Linux distribution you are using. 这取决于您使用的是哪个Unix版本或Linux发行版。 For Debian and Debian derived distributions such as Ubuntu you need to install the debug packages using your normal package manager. 对于Debian和Debian派生的发行版(例如Ubuntu),您需要使用常规的软件包管理器来安装调试软件包 Fedora uses debuginfo rpms to add the debugging symbols. Fedora使用debuginfo rpms添加调试符号。 For other systems I'm afraid you'll have to search yourself. 对于其他系统,恐怕您必须进行自我搜索。

I'm pretty sure that now all versions of unix used the same format for debugging. 我很确定现在所有版本的unix都使用相同的格式进行调试。 Linux for instance has used at least two formats, and several versions of the latter one. 例如,Linux使用了至少两种格式,以及后者的几种版本。 That one, DWARF (yes it is a word play, coming along with ELF which is the object format) is standardised and used by some other Unix. DWARF(是一种文字游戏,与ELF一起是对象格式)已经标准化,并由其他Unix使用。 There are several variants of a libdwarf which is intended to help reading the debugging information. libdwarf有多种变体,旨在帮助读取调试信息。 Look first if one is provided by your unix vendor (ISTR that IBM does on AIX for instance, several Linux distribution are doing the same), if not, search for one suitable on the web. 首先查看您的Unix供应商是否提供了一个(例如,IBM在AIX上执行的ISTR,几个Linux发行版也在做同样的事情),如果不是,则在网络上搜索一个合适的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM