-
Notifications
You must be signed in to change notification settings - Fork 804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add basic Swift support (requires Xcode 6) #68
Conversation
By default expressions are evaluated in current frame's language. When stopped inside a Swift function, current language is Swift, and it's invalid to use Objective-C syntax: many Chisel functions break as a result. Explicitly specify Objective-C++ as expression language when evaluating commands. However one problem will still persist: it's still impossible to use Swift objects by name in Chisel functions. One needs to first convert object names to id pointers using evaluateExpressionValueInFrameLanguage(), but the lldb code to enable that was committed very recently and is still unavailable in Xcode 6.1.1.
Thank you @mblsha Would you mind signing Facebook's Contributor License Agreement? If you have any questions I'd be happy to help answer. https://code.facebook.com/cla |
Ok, done ;-) |
# lldb.frame is supposed to contain the right frame, but it doesnt :/ so do the dance | ||
frame = lldb.debugger.GetSelectedTarget().GetProcess().GetSelectedThread().GetSelectedFrame() | ||
value = frame.EvaluateExpression(expression) | ||
expr_options = lldb.SBExpressionOptions() | ||
expr_options.SetLanguage(language) # requires lldb r210874 (2014-06-13) / Xcode 6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @arigrant, what do you think about baseline Xcode support? Should Chisel support anything more than just the current version of Xcode?
@mblsha I've left a couple comments. Thanks for submitting this pull request! The only thing that needs to be figured out Xcode/lldb version support. |
|
It looks like there are still a few problems in Swift. Any commands that are of the form "po EXPRESSION" need to be changed to "expression -O -l objc++ --- EXPRESSION" "pviews" and "pca" are two examples - just grep for:
Would really like to see these changes merged into master, though. It's great to be able to still use Chisel commands when I hit a Swift breakpoint. |
🚢 🚢 🚢 Thanks @mblsha! |
Add basic Swift support (requires Xcode 6)
@moreindirection Can I interest you in opening a pull request to fix the stuff you've seen broken with Swift? 🍰 |
@kastiglione Sure, I just created pull request #73 |
By default expressions are evaluated in current frame's language.
When stopped inside a Swift function, current language is Swift, and it's invalid to use Objective-C syntax: many Chisel functions break as a result.
Explicitly specify Objective-C++ as expression language when evaluating commands.
However one problem will still persist: it's still impossible to use Swift objects by name in Chisel functions. One needs to first convert object names to id pointers using evaluateExpressionValueInFrameLanguage(), but the lldb code to enable that was committed very recently and is still unavailable in Xcode 6.1.1.