当前位置: 技术问答>linux和unix
我的程序为什么用GDB不能调试?
来源: 互联网 发布时间:2015-04-29
本文导语: 我编译的时候已经加了-g的参数但当执行: gdb Main 时,出现下列提示: GNU gdb 19991004 Copyright 1998 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/o...
我编译的时候已经加了-g的参数但当执行:
gdb Main
时,出现下列提示:
GNU gdb 19991004
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
(no debugging symbols found)...
哪位大虾知道原因?
gdb Main
时,出现下列提示:
GNU gdb 19991004
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
(no debugging symbols found)...
哪位大虾知道原因?
|
1。确定你调试的是可知性文件
2。确定该文件是可调试的,必须使用-g 或 -ggdb参数
3。确定你的原文件路径没有变化
4。确定你可以对原文件有读权限
2。确定该文件是可调试的,必须使用-g 或 -ggdb参数
3。确定你的原文件路径没有变化
4。确定你可以对原文件有读权限
|
编译的时候要加参数 -g
|
是attach到一个进程上去调试的么?可以指定文件来装入symbols。具体的你查gdb的手册吧。
如果不是,那我就不知道了
如果不是,那我就不知道了
|
编译时加-ggdb应该不会出问题的,或者就是你的gdb 有问题
|
gdb 19991004 programname
|
输入错了文件名,我经常犯这样的毛病
|
估计是权限问题。
|
http://www.hotit.net/netschool/linux/faq/program-gdb-1.html