簡體   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