【发布时间】:2016-07-13 00:28:51
【问题描述】:
我通过外部构建系统使用 Xcode 进行 C++ 开发。如果我使用 Xcode 6.2 (lldb 320.4.160) 一切正常,我可以设置断点,它们被击中 - 一切都很好。但是,如果我想升级到更新版本的 Xcode,例如7.3 (lldb 350.0.21.3) 我的断点不再被击中。到目前为止,我的研究告诉我,新的 lldb 出于某种原因无法设置断点。
一旦我停止执行程序并输入(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) 表示无法正确设置bp。如果我现在通过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版本正确设置断点?
谢谢!
【问题讨论】: