DerekSelander / LLDB

A collection of LLDB aliases/regexes and Python scripts to aid in your debugging sessions
GNU General Public License v2.0
1.77k stars 198 forks source link

error when `ex -l swift -- import Foundation` #21

Closed TomKaminski closed 4 years ago

TomKaminski commented 4 years ago

Hey,

I've just started this book and got an error while trying to import Foundation into lldb.

(lldb) ex -l swift -- import Foundation

Cannot create Swift scratch context (couldn't load the Swift stdlib)Cannot create Swift scratch context (couldn't load the Swift stdlib)Shared Swift state for Xcode could not be initialized. The REPL and expressions are unavailable.

What is going on here?

Command line tools are set in Xcode preferences: Screenshot 2019-10-26 at 13 49 58

Regards, Tom

IHEARTCOOKIES commented 4 years ago

Hi Tom!

If your goal is simply to import foundation, I'd recommend running e @import Foundation, assuming you've stopped in Obj-C land.

Hope that helps!

DerekSelander commented 4 years ago

This seems to be a known bug. See this Twitter thread: https://twitter.com/davidecci/status/1190028084508012549

Fortunately, Apple developers are aware and are on it.