【发布时间】:2015-12-05 21:37:39
【问题描述】:
环境:
- 面向 C/C++ 开发人员的 Eclipse IDE 版本:Mars 版本 (4.5.0)
- Ubuntu 14.04
Eclipse 下的“调试模式”有问题。我尝试调试一个简单的程序作为实验:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char* argv[])
{
char *s = malloc(1);
free(s);
s = NULL;
return 0;
}
程序正在正确构建并且没有任何错误/警告的情况下运行,但在调试期间我收到以下错误:
我已经搜索了我的整个硬盘驱动器并且文件 malloc.c 不存在。
问题:
如果找不到文件malloc.c,为什么程序可以编译 并且运行正常?
为什么调试器在对 编译器?
过去有没有人看到这个问题并知道解决方案?
您使用的是哪种带调试模式的编程环境 除了 Eclipse?
我发现了几个类似的主题,但没有一般问题的解决方案:
- How can i Escape from "no source available" errors when stepping OVER a stdio function in eclipse (C language, using CDT)
- GDB on eclipse debug mode can't find stdlib/rand.c
运行命令:
# apt-get install libc6-dbg
# apt-get source libc6
不能解决问题。
【问题讨论】:
-
你可能需要一次问一个问题/