Home iOS & Swift Books Advanced Apple Debugging & Reverse Engineering

C
Appendix C: LLDB Bug Written by Derek Selander

Heads up... You're reading this book for free, with parts of this chapter shown beyond this point as scrambled text.

You can unlock the rest of this book, and our entire catalogue of books and videos, with a raywenderlich.com Professional subscription.

In LLDB version 1000.11.37.1 (the version that’s packaged with Xcode 10.0), there’s a bug in LLDB that incorrectly imports the wrong headers when debugging an iOS Simulator or iOS target. Fortunately, this bug only appears when running in a Terminal session.

To see if you’re affected, open up a Terminal window and check your LLDB version:

(lldb) version
lldb-1000.11.37.1
  Swift-4.2

If you have the same version (or maybe one coming from Xcode 10.1/10.2) this will happen when debugging any iOS Simulator application:

(lldb) po @import UIKit
error: while importing modules:
error: Header search couldn't locate module UIKit

This is because LLDB is looking in the MacOS SDK directory for the UIKit headers. This also means many LLDB scripts which rely on this feature will also fail.

Fortunately, a solution to this problem can be found here: https://github.com/DerekSelander/lldb_fix

Have a technical question? Want to report a bug? You can ask questions and report bugs to the book authors in our official book forum here.

Have feedback to share about the online reading experience? If you have feedback about the UI, UX, highlighting, or other features of our online readers, you can send them to the design team with the form below:

© 2021 Razeware LLC

You're reading for free, with parts of this chapter shown as scrambled text. Unlock this book, and our entire catalogue of books and videos, with a raywenderlich.com Professional subscription.

Unlock Now

To highlight or take notes, you’ll need to own this book in a subscription or purchased by itself.