使用 lldb 时,基本 C 程序的调试失败
程序是:hello.c
#include <stdio.h>
int main()
{
printf("Hello world\n");
return (0);
}
Run Code Online (Sandbox Code Playgroud)
编译后,链接并运行lldb,然后运行命令。显示错误
$ lldb hello
(lldb) target create "hello"
Current executable set to 'hello' (x86_64).
(lldb) run
error: process exited with status -1 (Error 1)
Run Code Online (Sandbox Code Playgroud)
非常感谢这方面的任何帮助
我的程序cc非常简单
#include <stdio.h>
int main()
{
int ret = 0;
return ret;
}
Run Code Online (Sandbox Code Playgroud)
当我使用“clang -fsanitize=address cc ”编译它并运行 a.out 时,会显示以下消息,但是程序运行成功
a.out(40820,0x106ffe600) malloc:由于无法预分配保留的虚拟机空间,纳米区域被放弃。
代码使用(Xcode 13)Apple clang版本13.0.0(clang-1300.0.29.3)编译目标:x86_64-apple-darwin21.1.0线程模型:posix
操作系统是 macOS Monterey (12.0.1)
任何更好地理解这一点的见解都会有所帮助