免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4092 | 回复: 3
打印 上一主题 下一主题

请问gdb的list命令怎么不能用阿? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-05-31 14:23 |只看该作者 |倒序浏览
我的运行结果如下, init。c是怎么回事啊?

----------------------------------------------
[wanglt@sz-gw hello]$ ls
a.out  configure  configure.in  greeting  greeting.c  hello  hello.c
[wanglt@sz-gw hello]$ gdb greeting
GNU gdb Red Hat Linux (5.1.90CVS-5)
Copyright 2002 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"...
(gdb)  list
1       init.c: No such file or directory.
        in init.c
(gdb) list
1       in init.c
(gdb)
(gdb) list 22
17      in init.c
(gdb) list greeting.c
Can't find member of namespace, class, struct, or union named "greeting.c"
Hint: try 'greeting.c<TAB> or 'greeting.c<ESC-?>
(Note leading single quote.)
(gdb)

论坛徽章:
0
2 [报告]
发表于 2006-05-31 14:24 |只看该作者
我想列出greeting.c
主机运行环境是linux redhat

论坛徽章:
0
3 [报告]
发表于 2006-05-31 14:41 |只看该作者
编译时 必须加 -g  参数 ,   
gdb  a.out
或者
gdb
file a.out

list 可以跟好多种参数,进去help 一下看看怎么用

论坛徽章:
0
4 [报告]
发表于 2006-05-31 14:43 |只看该作者
行了, 谢谢
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP