简体   繁体   English

为什么我的malloc导致在lubuntu上的netbeans中未找到源错误(malloc.c)?

[英]Why does my malloc result in a source not found error (malloc.c) in netbeans on lubuntu?

I am using netbeans8.0.1 on lubuntu and I can not get past my malloc instances in the debugging environment. 我在lubuntu上使用netbeans8.0.1,在调试环境中无法通过malloc实例。 I just get to my build tree malloc function and the dissembly window appears saying "!Source not found, file: malloc.c, line: 2,876". 我只是进入构建树malloc函数,反汇编窗口出现,显示“!找不到源,文件:malloc.c,行:2,876”。 I had this same code working on xcode but now that I am using linux and netbeans it will not run. 我在xcode上使用了相同的代码,但是现在我正在使用linux和netbeans,它将无法运行。 By the way this is with the c programming language and the code is for a parser and automated differentiation tool. 顺便说一下,这是使用c编程语言编写的,而代码则是用于解析器和自动区分工具的。 I am new to the c language but as I said before I had this very same program working on xcode but when I brought it to my laptop for further development I ran into this problem. 我是C语言的新手,但是正如我之前说过的那样,我在Xcode上有同样的程序,但是当我将其带到笔记本电脑进行进一步开发时,遇到了这个问题。

struct node *buildtree(){
struct node* name=(struct node*)malloc(sizeof(struct node));
name->val=0;
name->sym='\0';
return name;

}; };

To step into function in debugger you have to posses the code of the function. 要进入调试器功能,您必须拥有该功能的代码。 It seems that you don't have access to the code of malloc, you have a binary, compiled version, but no source code. 似乎您无权访问malloc的代码,您具有二进制的编译版本,但没有源代码。 Your program can be still run because for this to happen the binary code is necessary and not the source files. 您的程序仍可以运行,因为要做到这一点,二进制代码是必需的,而不是源文件。 You should install/download correct file or step over this function while in debug. 在调试时,您应该安装/下载正确的文件或跳过此功能。 A minor hint: no need to cast the result of mallloc in C . 一个小提示: 无需在C中强制转换mallloc的结果

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM