Posts

Post marked as solved
5 Replies
4.3k Views
similiar to Error when debugging: Cannot creat… | Apple Developer Forums - https://developer.apple.com/forums/thread/651375 Xcode 12 beta 1 po command in de… | Apple Developer Forums - https://developer.apple.com/forums/thread/651157 which do not resolve this issue that I am encountering Description of problem I am seeing an error which prevents using lldb debugger on Swift code/projects. It is seen on any Swift or SwiftUI project that I've tried. This is the error displayed in lldb console when first breakpoint is encountered: Cannot create Swift scratch context (couldn't create a ClangImporter)(lldb)  Xcode Version 12.3 (12C33) macOS Big Sur Intel M1 Troubleshooting I originally thought this was also working on an Intel Mac running Big Sur/Xcode 12.3, but was mistaken. Using my customized shell environment on the following setups, I encounter the same couldn't create a ClangImporter. M1 Mac mini, main account (an "Admin" account) same M1 Mac mini, new "dev" account (an "Admin" account) Intel MBP, main account They are all using an Intel Homebrew install, and my customized shell environment if that provides a clue? I captured some lldb debugging info by putting expr types in ~/.lldbinit but the outputs were basically identical (when discounting scratch file paaths and memory addresses) compared to the "working clean" account log (described below) log enable -f /tmp/lldb-log.txt lldb expr types works in a "clean" user account I created a new, uncustomized "Standard" testuser account on the M1 Mac mini, and launched the same system Xcode.app. There was no longer this error message, and was able to inspect variables at a swift program breakpoint in Swift context, including po symbol. Impact Effectively this makes the debugger in Swift on Xcode projects on my systems essentially unable to inspect Swift contexts' state.
Posted
by idcrook.
Last updated
.
Post marked as solved
1 Replies
1.5k Views
I downloaded the example playground using "Download Playground" from A Swift Tour — The Swift Programming Language (Swift 5.3) - https://docs.swift.org/swift-book/GuidedTour/GuidedTour.html (from docs.swift.org - there was no tag for this Forum that I could find to reference Docs or swift.org) On my Mac (macOS 11.0 beta 2, Xcode 12 beta 2) none of the chapters will run in the downloaded GuidedTour.playground. Each chapter compiles and builds, but then when trying to run it never gets past: &lt;<Spinner&gt;> Running Simple Values and no results are printed. If I copy sections into a "Blank" .playground created using File > New > Playground... in Xcode, things work as expected. This seems to not work "out of the box", even though the page where it was downloaded from has this NOTE For the best experience, open this chapter as a playground in Xcode.  Debugging attempt broken version In the Report navigator in the "broken" playground, the Build entry for each (successful) build had this: Workspace GuidedTour | Scheme GuidedTour (Playground) | Destination iPad Pro (9.7 inch) and when building a package Destination iPad Pro (9.7 inch) | SDK Simulator - iOS 14.0 working version In the Report navigator in the "working" from-"Blank" playground, the Build entry for each (successful) build had: Destination My Mac and for the Package Destination My Mac | SDK macOS 10.16 which would seem to be a big hint. But I Do not know why the downloaded playground shows up with that non-Mac target destination I do not know how to change this Destination I do not know how to get an iPad simulator to appear alongside the playground, if that is what is intended
Posted
by idcrook.
Last updated
.