【发布时间】:2015-04-15 12:44:08
【问题描述】:
我在 C++ 中创建了一个 Hello World 示例,并尝试从 Mac OSX 的终端使用 lldb 对其进行调试。
> lldb a.out
Current executable set to 'a.out' (x86_64).
我可以在名称上设置断点(例如'main'),但不能在行号上。如果我尝试
breakpoint set --file test.c --line 5
或
b test.c:5
我明白了
Breakpoint 1: no locations (pending).
WARNING: Unable to resolve breakpoint to any actual locations.
文件“test.c”位于当前文件夹中。出了什么问题?
【问题讨论】:
-
你如何构建
a.out? -
当然.. 忘记了 -g 标志。谢谢!
-
这正是我的怀疑:)。你不相信这种情况发生在我身上的频率有多高:)