3

デバッガー 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
}

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

トロイの木馬へ: Xcode 4.6.3 コマンド ライン ユーティリティでこれらの手順を試しましたが、結果はあなたのものと同じですが、私の問題は GUI にあります。

マウスを使用して "ac" にブレーク ポイントを設定すると、動作しません。

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) 

コマンドラインユーティリティを使用してログが必要な場合は、教えてください、ありがとう〜

4

2 に答える 2

1

注これは回答ではありませんが、私は回答のために作品を完全に文書化したかったのです。

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 コマンド ライン ユーティリティを使用しています。

于 2013-10-31T11:00:01.763 に答える