LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 529|回复: 1

[help]我的gdb不能工作

[复制链接]
发表于 2007-2-13 09:46:24 | 显示全部楼层 |阅读模式
我用的是FC6
用vi写了一个非常简单的程序用gdb调试时出现:
GNU gdb Red Hat Linux (6.5-8.fc6rh)
Copyright (C) 2006 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-gnu"...“/home/feng/Ccode/main.c": not in executable format: 不可识别的文件格式
(gdb)


请问这是为什么呀! 请教高手的指点!!
发表于 2007-2-13 10:27:47 | 显示全部楼层
你用gdb调试什么?main.c? 要调试可执行文件。
$ gcc -g main.c
$ gdb a.out
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表