【发布时间】:2016-10-10 15:04:41
【问题描述】:
我使用 clang 用调试符号编译了我的应用程序。当使用 lldb 附加到应用程序并进入例如 __cxa_throw 时,我看不到 libc++abi.dylib 的源代码。我做错了什么?
【问题讨论】:
我使用 clang 用调试符号编译了我的应用程序。当使用 lldb 附加到应用程序并进入例如 __cxa_throw 时,我看不到 libc++abi.dylib 的源代码。我做错了什么?
【问题讨论】:
您确实获得了一些 STL 的调试信息,因为很多 STL 代码都在编译到您的应用程序中的头文件中。但是您没有实际编译到 libc++abi.dylib 中的代码的调试信息,因为 Apple 不为系统库分发 dSYM。 __cxa_throw 实际上是库中的一个函数。
作为一个单独的问题,因为大多数人实际上并不想步入 STL 代码,所以 lldb 有一个设置:
(lldb) set show target.process.thread.step-avoid-regexp
target.process.thread.step-avoid-regexp (regex) = ^[^ ]+ std::|^std::
这将导致单步执行人为地跨过 STL 中的代码。您可以通过将该值设置为“”来撤消此操作。这将使您在单步执行时进入内联代码。
【讨论】:
set set target.process.thread.step-avoid-regexp ""