Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/56.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/silverlight/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C GDB重置配置_C_Gdb_Valgrind - Fatal编程技术网

C GDB重置配置

C GDB重置配置,c,gdb,valgrind,C,Gdb,Valgrind,编辑: 我试图用sudo-apt-get-autoremove-gdb重新安装gdb,然后sudo-apt-get-install-gdb。仍然不能解决这个问题 原始问题: 所以最近,也就是大约3小时前,我安装了valgrind来检查内存泄漏,现在我尝试编译一些东西并运行GDB(终端或Eclipse),所有malloc/calloc命令也在逐步调试 测试文件: #include<stdio.h> #include<stdlib.h> typedef struct tem

编辑: 我试图用
sudo-apt-get-autoremove-gdb
重新安装
gdb
,然后
sudo-apt-get-install-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;
}



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

现在,由于GDB7.4,我不得不使用
(gdb)跳过文件malloc.c


我希望能找到其他方法来恢复GDB以前的功能,这样我就不必手动添加所有标准库源文件(我尝试了
(GDB)跳过文件stdlib.h
,只针对那些想知道的人)

你确定这与valgrind有关吗?请参阅。@dbrank0类似,谢谢您的链接,但我想知道是否有一种方法可以让它像以前那样工作。我安装了
valgrind
,接下来我知道的
GDB
开始工作。我之前没有使用过
valgrind
,但我看不出有任何问题(目前)。我用它来检查内存泄漏。
(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