Is my copy of lldb up-to-date?

In WWDC 2015 session 402 (titled "What's new in lldb") the presenter describes a number of improvements in lldb but none of them seem to work in my Xcode 7. The presenter shows several examples in which he says "here's what used to happen..." (and shows an error message), "but we've fixed that and here's what you get now ..." (and shows that you now get the result you expected). So I tried a few of those examples, copying exactly from his slide, and in every example I tried my lldb still gives the old error message. IOW it's acting as if it didn't get updated.

For example the lldb command:

    
(lldb) p NSMakeRect(0, 0, 10, 10)


while debugging an Objective-C class formerly gave no response because NSMakeRect wasn't recognized. But now (he says) it gives:


(NSRect) $0 = (origin = (x = 0, y = 0), size = (width = 10, height = 10))


However when I try it, I get the old error:


(lldb) p NSMakeRect(0, 0, 10, 10)
error: use of undeclared identifier 'NSMakeRect'
error: 1 errors parsing expression


I have OSX 10.11.2, Xcode 7.2, and lldb version lldb-340.4.119 (give the 'version' or 'v' command in lldb to see the version). I downloaded my current Xcode just like any other version and installed it in the normal default way. I don't remember any anomaly or error. I didn't update lldb separately. I assumed it got updated automatically along with Xcode. Is that assumption correct?


Do I have the current lldb? Does anyone know why my lldb seems to be not updated?

Latest release version appears to be: lldb-340.4.119


OSX 10.11.2, Xcode 7.2 release

This was submitted as bug # 24018005.

I don’t have time to review all the context from that talk but I believe there are two issues in play. First, the formatter for NSRect, which should just work. For example, if

r
is an NSRect local variable:
(lldb) p r
(NSRect) $0 = (origin = (x = 0, y = 0), size = (width = 0, height = 0))

Next, calling

NSMakeRect
itself, which is tricky because it’s typically inlined. For that you need to import the Cocoa frameworks:
(lldb) expr
Enter expressions, then terminate with an empty line to evaluate:
1 @import Cocoa;
2
(lldb) p NSMakeRect(0, 0, 10, 10)
(NSRect) $0 = (origin = (x = 0, y = 0), size = (width = 10, height = 10))

Both of the above were done using Xcode 7.2 or OS X 10.11.2.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
Is my copy of lldb up-to-date?
 
 
Q