简体   繁体   English

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

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

I had a problem with using debugger LLDB, 我在使用调试器LLDB时遇到问题,

if in "main.c" , I include another file like "ac" , and set breakpoint in "ac" the breakpoint will never been stopped. 如果在“main.c”中,我包含另一个文件,如“ac”,并在“ac”中设置断点,则断点永远不会被停止。

Is anyone else getting this? 还有其他人得到这个吗?

ok, here is the example 好的,这是一个例子

// 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: I had tried these steps in Xcode 4.6.3 command line utilities, the result is like yours, but my problem is on GUI, to trojanfoe:我在Xcode 4.6.3命令行实用程序中尝试了这些步骤,结果和你的一样,但我的问题是在GUI上,

When I use the mouse to set a break point on "ac", it will not work. 当我使用鼠标在“ac”上设置断点时,它将无法工作。

I had tried to stop on main(), and enter this cmd "br list", here is the message on console, 我试图在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) 

if you need the log by using command line utilities, please tell me, thanks~ 如果您需要使用命令行实用程序的日志,请告诉我,谢谢〜

See "File and line breakpoints are not getting hit" in http://lldb.llvm.org/troubleshooting.html - that seems to be talking about exactly your build scenario, and I've just had this problem. 请参阅http://lldb.llvm.org/troubleshooting.html中的 “文件和行断点未被命中” - 这似乎正在谈论您的构建方案,我刚刚遇到了这个问题。 To solve it I not only had to put this in $HOME/.lldbinit: 为了解决这个问题,我不仅要把它放在$ HOME / .lldbinit中:

settings set target.inline-breakpoint-strategy always 设置始终设置target.inline-breakpoint-strategy

I also had to do a clobber (distclean) build and restart Xcode. 我还必须做一个clobber(distclean)构建并重新启动Xcode。

NOTE This is not an answer, however I wanted to document the works for me response fully. 注意这不是一个答案,但我想完整地记录作品

OP: Please follow these steps to see how it differs for you. 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) 

Note: I am using the Xcode 5.0.1 command line utilities. 注意:我使用的是Xcode 5.0.1命令行实用程序。

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

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