0
编辑: 我试图重新安装gdb
与sudo apt-get autoremove gdb
然后sudo apt-get install gdb
。仍然不能解决问题。GDB重置配置
原来的问题:
所以最近,这意味着约3小时前,我安装了valgrind
检查内存泄漏和现在的一切,我尝试编译的东西和运行GDB(终端或在Eclipse),所有malloc
/calloc
命令也逐步被调试。
测试文件:
#include<stdio.h>
#include<stdlib.h>
typedef struct tem{
int i;
} name;
int main() {
name *t;
printf("EASD");
t = malloc(sizeof(name));
return 0;
}
Eclipse调试器错误(仍显示在malloc和等功能变量):
Can't find a source file at "malloc.c"
Locate the file or edit the source lookup path to include its location.
使用编译:cc -g -o asd a.c
使用调试的:gdb asd
终端:
(gdb) run
Starting program: /home/userName/workspace/as/asd
Breakpoint 2, main() at a.c:10
10 t = malloc(sizeof(name));
(gdb) step 18442
Single stepping until exit from function _fini,
which has no line number information.
Single stepping until exit from function __do_global_dtors_aux,
which has no line number information.
Single stepping until exit from function _fini,
which has no line number information.
EASD33 ../sysdeps/unix/sysv/linux/_exit.c: No such file or directory.
(gdb) step
[Inferior 1 (process 6621) exited normally]
GDB无断点:
(gdb) run
Starting program: /home/userName/workspace/as/asd
EASD[Inferior 1 (process 6631) exited normally]
我的问题是,如何我重新配置/复位GDB跳过标准库函数像以前那样?
从另一台计算机:
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/userName/a.out a.out
warning: Could not load shared library symbols for linux-gate.so.1.
Do you need "set solib-search-path" or "set sysroot"?
Breakpoint 1, main() at a.c:10
10 printf("EASD");
(gdb) step
11 t = malloc(sizeof(name));
(gdb) step
12 return 0;
(gdb) step
13 }
(gdb) step
0xb7e067c3 in __libc_start_main() from /usr/lib/libc.so.6
你确定这与valgrind有关?请参阅http://stackoverflow.com/questions/8424211/ignoring-standard-and-boost-libraries-while-debugging-with-gdb。 – dbrank0 2013-04-29 07:33:58
@ dbrank0类似的,感谢您的链接,但我想知道是否有一种方式让它像过去那样工作。从字面上我安装了'valgrind',接下来我知道'GDB'开始工作了。我没有事先使用'valgrind',但是我没有看到任何问题(现在)。我使用它来主要检查内存泄漏。 – SGM1 2013-04-29 17:04:17