首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 操作系统 > UNIXLINUX >

应用gdb调试出错

2013-07-01 
使用gdb调试出错This GDB was configured as mips-linux...(no debugging symbols found)(gdb) b tspecd

使用gdb调试出错
This GDB was configured as "mips-linux"...
(no debugging symbols found)
(gdb) b tspecd_api_cmd
Function "tspecd_api_cmd" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y

Breakpoint 1 (tspecd_api_cmd) pending.
(gdb) run
Starting program: /usr/bin/tspec 
exec /usr/bin/tspec : cannot open

Program exited with code 0377.
(no debugging symbols found)
No registers.

tspecd_api_cmd()是tspec模块的函数,我想要调试tspecd_api_cmd()函数,但是报错,不知道是什么原因。请各位大侠帮忙看看。
[解决办法]
首先编译时加-g选项没(将.c文件编译成.o文件时)
$ gdb
(gdb) file ./execute_file
(gdb) set args  // (如果需要参数)
(gdb) b xxx
[解决办法]
gdb要加载你编译出来的二进制物件才行啊,而且得是debug的版本才行哦。
[解决办法]
g++ -g   源文件名.c  -o 目标文件名
gdb  目标文件名
break main    //设置断点
list    //查看源代码   

热点排行