Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swift po causes error 'Failed to load linked library Metal'

Tags:

swift

xcode6

lldb

How can I print out a Swift variable's value in XCode 6 GM with LLDB? It seems to be broken since early betas. But at the same time po works perfectly fine in Objective-C code

I've previously tried all XCode 6 betas and got the same result. Even when I start a new project from scratch it's all the same. For example, I put a breakpoint in func application(application, didFinishLaunchingWithOptions)

(lldb) po application
error: Error in auto-import:
Failed to load linked library Metal of module sandbox - errors:
Looking for "@rpath/Metal.framework/Metal", error: not a string object

I've never imported or linked against Metal.framework in any of my projects. Does there exist any way to solve this?

like image 370
Laevand Avatar asked Sep 17 '14 10:09

Laevand


2 Answers

Don't know the reason that po is broken in xCode 6, but I am able to print an object by

  • Right clicking an object in the Debug Area

  • and clicking -> Print Description of "OBJECT_NAME"

Hope this will help someone else, until the xCode bug is fixed

like image 161
Bassam Mehanni Avatar answered Oct 18 '22 01:10

Bassam Mehanni


The bug was fixed in XCode 6.1

Resolved Issues - Debugging

Swift expressions like 'expr', 'p', and 'print' that are evaluated from the LLDB prompt in the debugger console will now work on 32-bit iOS devices. (18249931)

https://developer.apple.com/library/ios/releasenotes/DeveloperTools/RN-Xcode/Chapters/xc6_release_notes.html

like image 35
Laevand Avatar answered Oct 18 '22 01:10

Laevand