通過外部構建系統使用Xcode進行C++開發。如果我使用Xcode 6.2(lldb 320.4.160)一切正常,我可以設置斷點,他們正在被擊中 - 一切都很好。但是,如果我想升級到較新版本的Xcode,例如7.3(lldb 350.0.21.3)我的斷點不再受到攻擊。到目前爲止,我的研究告訴我,由於某種原因,新的lldb無法設置斷點。爲什麼lldb> v320.4.160找不到我的源文件?
一旦我停止程序的執行,並鍵入(lldb) breakpoint list
我的輸出是這樣的:
Current breakpoints:
1: file = '/full/path/to/src/main.cpp', line = 842, exact_match = 0, locations = 0 (pending)
2: file = '/full/path/to/src/class.cpp', line = 383, exact_match = 0, locations = 0 (pending)
3: file = '/full/path/to/src/Homie.cpp', line = 12, exact_match = 0, locations = 0 (pending)
的(pending)
末顯示,英國石油公司可能無法正確設置。如果我現在通過breakpoint set --file main.cpp --line 842
設置在LLDB斷點我得到一個斷點,其中(lldb) breakpoint list
是給下面的輸出:
4: file = 'main.cpp', line = 12, exact_match = 0, locations = 1, resolved = 1, hit count = 0
4.1: where = TEST`::__cxx_global_array_dtor() + 29 at main.cpp:842, address = 0x000000010027130d, resolved, hit count = 0
這個斷點程序執行過程中被擊中 - 一切美好的事物
如果我嘗試使用Xcode在同一個可執行文件上設置斷點6.2即使使用完整的文件路徑,調試器也可以成功找到源文件。
如何使新的lldb版本正確設置斷點?
謝謝!
是的,這是真正的問題。感謝提示如何找出實際構建到二進制文件中的路徑。調試器尋找'full/path/to /./ src/main.cpp',這顯然不能被調試器解決。我改變了makefile的src路徑,現在它工作正常。 – p0fi