Content/Chapter Requests Here

Hey all,

I am starting a post for any content you want in upcoming versions of the dbg book. For example, @tomn has requested a chapter on Instruments as well as how to best utilize ASL. I can’t guarantee I’ll get to all of them, but I’ll definitely consider each one.

Cheers!

~Derek

@lolgrep Thanks! :slight_smile: Maybe not ASL, as it is somehow deprecated right now, but more like: “What are the best ways to use Apple Unified Logging and Activity Tracing”. Here is an unfortunately very general article: https://artandlogic.com/2016/07/smarter-debugging-unified-logging-activity-tracing/

ahhh dang it, thanks for the correction @tomn; muscle memory :smiley:

Not so much a content request, but a note you may want to add to the book. In chapter 1, right as we try to evaluate our first Swift expression I got the following baffling response to trying to import Foundation.

(lldb) ex -l swift -- import Foundation
warning: Swift error in module Xcode.
Debug info from this module will be unavailable in the debugger.

warning: Swift error in module dyld.
Debug info from this module will be unavailable in the debugger.

warning: Swift error in module Cocoa.
Debug info from this module will be unavailable in the debugger.

warning: Swift error in module DVTFoundation.
Debug info from this module will be unavailable in the debugger.

warning: Swift error in module DVTKit.
Debug info from this module will be unavailable in the debugger.

warning: Swift error in module IDEFoundation.
Debug info from this module will be unavailable in the debugger.

warning: Swift error in module IDEKit.
Debug info from this module will be unavailable in the debugger.

warning: Swift error in module Foundation.
Debug info from this module will be unavailable in the debugger.

warning: Swift error in module libobjc.A.dylib.
Debug info from this module will be unavailable in the debugger.

warning: Swift error in module libSystem.B.dylib.
Debug info from this module will be unavailable in the debugger.

warning: Swift error in module AppKit.
Debug info from this module will be unavailable in the debugger.

…

It does this for a total of 1146 modules before finishing with:

Shared Swift state for Xcode could not be initialized.
The REPL and expressions are unavailable.

Any further attempts at evaluating swift expressions fail with the bit about shared Swift state not being initialized and the REPL being unavailable.

After some hair pulling and Google massaging, I finally found out that the culprit behind this was that I installed the command line tools before installing Xcode (it was a fresh install of High Sierra in a VM and I installed Homebrew before I installed Xcode). Because of this Xcode had no location set for the command-line tools. I had to go into Xcode > Preferences > Locations to set it.

This probably won’t be an issue for most people, but it may still be worth a footnote in the book.

This topic was automatically closed after 166 days. New replies are no longer allowed.