我在使用调试器 LLDB 时遇到了问题,
如果在 "main.c"中,我包含另一个文件,如 "a.c",并在 "a.c"中设置断点 断点永远不会停止。
还有其他人得到这个吗?
好的,这是例子
// main.c
#include "a.c"
int main()
{
test();
}
// a.c
void test()
{
return; // (Using UI to)set break point here, the gdb will stop, and lldb will not
}
============================================= =======================
木马敌人: 我曾在 Xcode 4.6.3 命令行实用程序中尝试过这些步骤, 结果和你的一样,但我的问题是在 GUI 上,
当我用鼠标在“a.c”上设置断点时,它不起作用。
我曾尝试在 main() 上停止,然后输入此命令“br list”, 这是控制台上的消息,
(lldb) br list
Current breakpoints:
1: file ='a.c', line = 13, locations = 0 (pending)
2: file ='main.c', line = 15, locations = 1, resolved = 1
2.1: where = test`main + 15 at main.c:15, address = 0x0000000100000f3f, resolved, hit count = 1
(lldb)
如果您需要使用命令行实用程序的日志,请告诉我, 谢谢~
最佳答案
参见 http://lldb.llvm.org/troubleshooting.html 中的“文件和行断点未命中” - 这似乎是在谈论您的构建场景,而我刚刚遇到了这个问题。为了解决这个问题,我不仅要将它放在 $HOME/.lldbinit 中:
设置始终设置 target.inline-breakpoint-strategy
我还必须进行 clobber (distclean) 构建并重新启动 Xcode。
关于带 lldb 断点的 Xcode 4.6/5 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19702714/