【问题标题】:How can I step into libc++ code on Mac OSX using lldb?如何使用 lldb 在 Mac OSX 上进入 libc++ 代码?
【发布时间】:2016-10-10 15:04:41
【问题描述】:

我使用 clang 用调试符号编译了我的应用程序。当使用 lldb 附加到应用程序并进入例如 __cxa_throw 时,我看不到 libc++abi.dylib 的源代码。我做错了什么?

【问题讨论】:

    标签: macos lldb


    【解决方案1】:

    您确实获得了一些 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 ""
    猜你喜欢
    • 2020-12-25
    • 1970-01-01
    • 2023-03-28
    • 2010-11-10
    • 1970-01-01
    • 2020-04-22
    • 2019-11-04
    • 2016-04-13
    • 1970-01-01
    相关资源
    最近更新 更多