GDB重置配置

时间:2013-04-28 23:10:09

标签: c gdb valgrind

编辑: 我尝试使用gdb然后sudo apt-get autoremove gdb重新安装sudo apt-get install gdb。仍然没有解决问题。

原始问题:

最近,大约3个小时前,我安装valgrind来检查内存泄漏,现在我尝试编译内容并运行GDB(终端或在Eclipse中),所有malloc / { {1}}命令也在逐步调试。

测试文件:

calloc

Eclipse调试器错误(仍显示malloc和etc函数中的变量):

#include<stdio.h>
#include<stdlib.h>

typedef struct tem{
    int i;
} name;

int main() {
    name *t;
    printf("EASD");
    t = malloc(sizeof(name));
    return 0;
}




编译使用: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:

(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]

1 个答案:

答案 0 :(得分:0)

目前,我必须使用(gdb) skip file malloc.c感谢GDB 7.4。

我很感激恢复GDB以前做的任何替代方案,所以我不必手动手动添加所有标准库源文件(我只是为那些想知道的人试过(gdb) skip file stdlib.h