繁体   English   中英

Xcode 4.6 / 5,lldb断点不起作用

[英]Xcode 4.6 / 5 with lldb breakpoints not working

我在使用调试器LLDB时遇到问题,

如果在“main.c”中,我包含另一个文件,如“ac”,并在“ac”中设置断点,则断点永远不会被停止。

还有其他人得到这个吗?

好的,这是一个例子

// 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
}

================================================== ====================

to trojanfoe:我在Xcode 4.6.3命令行实用程序中尝试了这些步骤,结果和你的一样,但我的问题是在GUI上,

当我使用鼠标在“ac”上设置断点时,它将无法工作。

我试图在main()上停止,然后输入这个cmd“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。

注意这不是一个答案,但我想完整地记录作品

OP:请按照以下步骤查看它与您的不同之处。

$ clang -g -o bptest main.c
$ ls -l
total 32
-rw-r--r--  1 andy  staff   110 Oct 31 10:55 a.c
-rwxr-xr-x  1 andy  staff  4664 Oct 31 10:56 bptest
drwxr-xr-x  3 andy  staff   102 Oct 31 10:56 bptest.dSYM     (NOTE THIS)
-rw-r--r--  1 andy  staff    42 Oct 31 10:55 main.c
$ lldb
(lldb) target create bptest
Current executable set to 'bptest' (x86_64).
(lldb) break set -b test
Breakpoint 1: where = bptest`test + 4 at a.c:4, address = 0x0000000100000f34
(lldb) run
Process 9743 launched: '/Users/andy/tmp/bptest/bptest' (x86_64)
Process 9743 stopped
* thread #1: tid = 0x65287, 0x0000000100000f34 bptest`test + 4 at a.c:4, queue = 'com.apple.main-thread, stop reason = breakpoint 1.1
    frame #0: 0x0000000100000f34 bptest`test + 4 at a.c:4
   1    // a.c
   2    void test()
   3    {
-> 4        return; // (Using UI to)set break point here, the gdb will stop, and lldb will not
   5    }
(lldb) bt
* thread #1: tid = 0x65287, 0x0000000100000f34 bptest`test + 4 at a.c:4, queue = 'com.apple.main-thread, stop reason = breakpoint 1.1
    frame #0: 0x0000000100000f34 bptest`test + 4 at a.c:4
    frame #1: 0x0000000100000f49 bptest`main + 9 at main.c:4
    frame #2: 0x00007fff8eb3f7e1 libdyld.dylib`start + 1
(lldb) 

注意:我使用的是Xcode 5.0.1命令行实用程序。

暂无
暂无

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

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