LinuxSir.cn,穿越时空的Linuxsir!

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

gdb新手上路,懂的请帮忙!

[复制链接]
发表于 2005-12-6 21:47:38 | 显示全部楼层 |阅读模式
list不论是用l,还是用list都出现:
No symbol table is loaded.  Use the "file" command.
其它的如r,break等都没问题。
发表于 2005-12-6 23:24:55 | 显示全部楼层
编译时有没有加-g选项
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-12-7 23:33:26 | 显示全部楼层
你是说编译.C文件时吗,我试试
回复 支持 反对

使用道具 举报

发表于 2005-12-8 10:12:29 | 显示全部楼层
"No symbol table is loaded",这样还能用break?
回复 支持 反对

使用道具 举报

发表于 2005-12-8 10:54:02 | 显示全部楼层
编译的时候没有加 符号表

二楼是对的,编译的时候加 -g
回复 支持 反对

使用道具 举报

发表于 2005-12-9 16:53:27 | 显示全部楼层
好像是文件没有加载吧!!
>file a.out
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-12-9 23:55:16 | 显示全部楼层
还是没搞明白
回复 支持 反对

使用道具 举报

发表于 2005-12-10 08:28:58 | 显示全部楼层
你是怎么运行gdb的?
把你输入的命令完整地帖出来
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-12-10 19:04:01 | 显示全部楼层
[root@DYS tmp]# gdb
GNU gdb Red Hat Linux (6.3.0.0-1.21rh)
Copyright 2004 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".
(gdb) file test
Reading symbols from /root/myc/tmp/test...(no debugging symbols found)...done.
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) r
Starting program: /root/myc/tmp/test
Reading symbols from shared object read from target memory...(no debugging symbols found)...done.
Loaded system supplied DSO at 0x4d9000
(no debugging symbols found)
(no debugging symbols found)
The string is hello there
The string printed backward is

Program exited with code 040.
(gdb) l
No symbol table is loaded.  Use the "file" command.
(gdb) list
No symbol table is loaded.  Use the "file" command.
(gdb)
回复 支持 反对

使用道具 举报

发表于 2005-12-11 18:27:20 | 显示全部楼层
no debugging symbols found
你编译时有加-g吗?
看一下gcc 的manpage
回复 支持 反对

使用道具 举报

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

本版积分规则

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