使用gdb时未找到调试符号 [英] no debugging symbols found when using gdb

查看:160
本文介绍了使用gdb时未找到调试符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  GNU gdb Fedora(6.8-37.el5)
Kernal 2.6.18-164.el5

我试图调试我的应用程序。但是,每次我传递二进制到gdb它说:

 (没有调试符号)

这里是二进制文件的文件输出,你可以看到它没有被剥离:

  vid:ELF 32位LSB可执行文件,Intel 80386版本1(SYSV),适用于GNU / Linux 2.6.9,动态链接GNU / Linux 2.6.9,未剥离

我正在使用以下CFLAGS进行编译:

  CFLAGS = -Wall -Wextra -ggdb -O0-无法到达代码
任何人都可以告诉我,如果我在这里缺少一些简单?



b $ b

解决方案

一些Linux发行版不使用 gdb 样式调试符号。 (IIRC他们喜欢 dwarf2 。)



一般来说, gcc gdb 将同步它们使用什么样的调试符号,强制特定的样式只会导致问题;除非你知道你需要别的东西,只需使用 -g


GNU gdb Fedora (6.8-37.el5)
Kernal 2.6.18-164.el5

I am trying to debug my application. However, everytime I pass the binary to the gdb it says:

(no debugging symbols found)

Here is the file output of the binary, and as you can see it is not stripped:

vid: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped

I am compiling with the following CFLAGS:

CFLAGS = -Wall -Wextra -ggdb -O0 -Wunreachable-code

Can anyone tell me if I am missing some simple here?

Many thanks in advance,

解决方案

Some Linux distributions don't use the gdb style debugging symbols. (IIRC they prefer dwarf2.)

In general, gcc and gdb will be in sync as to what kind of debugging symbols they use, and forcing a particular style will just cause problems; unless you know that you need something else, use just -g.

这篇关于使用gdb时未找到调试符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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