I am having trouble debugging Swift Strings
func stringTest() {
let test1:String = \"test1\";
let test2:NSString = \"test2\";
// <-- Break
This is most likely a bug in the debug information output. You can check this by grabbing the PC, for instance from register read pc
, and then doing:
(lldb) image lookup -va <PC VALUE>
That will print a bunch of stuff, but the last entries will be all the variables currently visible to the debugger, and where they live (in registers or memory.) If you don't see the variable there, then the debug information must have told lldb that the variable is not currently live.
If you can reproduce this in some example code you can make available, please file a bug with bug reporter.apple.com.
It is a bug of Beta. Xcode6-Beta5 has still this bug. You can only get debug info for swift's variables, but can't get it for swift's constants. Temporarily you can change let test1 to var test1 and you will got debug info. Hope this will be fixed in release version. Good Luck in debugging ;)
EDIT: Unfortunately, the same issue is still happening in first release of Xcode Version 6.0.1 (6A317)
let test1:String -> debug info is unavailable
var test1:String -> debug info is available
EDIT2: Yes, confirmed. It is fixed also for iOS apps in the latest Xcode 6.1 under OS X Yosemite.