我在使用lldb和clang++在MacOSX上进行调试时遇到了问题。我正在使用一个Makefile来编译一个C++项目,但我不知道是否需要在编译命令中启用调试选项。
这是我的Makefile的一部分:
FLAGS =-g -Wall -O0
[...]
clang++ $(FLAGS) $^ -o $@
当我尝试使用我的makefile配置运行lldb时,它返回了一个错误:
Breakpoint 1: no locations (pending).
WARNING: Unable to resolve breakpoint to any actual locations.
我想我需要在我的makefile中启用调试工具,但我在互联网上没有找到如何做到这一点。我尝试了
-g
和-ggdb
选项,但没有成功。然而,当我尝试以不同的方式设置断点时,它可以正常工作(但是设置特定函数的断点对我没有兴趣...):
breakpoint set -n fonction
Breakpoint 1: [...]
我在互联网上没有找到答案,所以我很希望能得到一些帮助!谢谢!
这段话与IT技术无关。
lldb
时,如何设置断点? - m.s.breakpoint set --file foo.cpp --line 12
和breakpoint set -f foo.cpp -l 12
两种方式。 - Epsxy