[Linux] 在Fedora中使用debuginfo进行调试
Fedora发行的RPM包中,一般都带有可用于调试的debuginfo包。以wget为例:
http://koji.fedoraproject.org/koji/buildinfo?buildID=291804
可以看到wget-1.13.4-2.fc17.i686.rpm同时配有wget-debuginfo-1.13.4-2.fc17.i686.rpm。
一般情况下,使用yum安装相关软件时,是不会自动安装相应的debuginfo包的。假设我们的机器上安装了wget:
yum install wget
-bash-4.2$ gdb wgetGNU gdb (GDB) Fedora (7.3.50.20110722-9.fc16)...Reading symbols from /usr/bin/wget...(no debugging symbols found)...done.Missing separate debuginfos, use: debuginfo-install wget-1.12-4.fc16.i686
(gdb) listNo symbol table is loaded. Use the "file" command.
sudo debuginfo-install wget-1.12-4.fc16.i686
-bash-4.2$ gdb wget...Reading symbols from /usr/bin/wget...Reading symbols from /usr/lib/debug/usr/bin/wget.debug...done.
(gdb) list858 fputs (_("Please send bug reports and questions to <bug-wget@gnu.org>.\n"),859 stdout);860 exit (0);861 }862863 char *program_name; /* Needed by lib/error.c. */864865 int866 main (int argc, char **argv)867 {