-
Notifications
You must be signed in to change notification settings - Fork 801
Add basic Swift support (requires Xcode 6) #68
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,14 +36,27 @@ def run(self, arguments, option): | |
| pass | ||
|
|
||
|
|
||
| def evaluateExpressionValue(expression, printErrors=True): | ||
| def evaluateExpressionValueWithLanguage(expression, language, printErrors): | ||
| # 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 | ||
| value = frame.EvaluateExpression(expression, expr_options) | ||
| if printErrors and value.GetError() is not None and str(value.GetError()) != 'success': | ||
| print value.GetError() | ||
| return value | ||
|
|
||
| def evaluateExpressionValueInFrameLanguage(expression, printErrors=True): | ||
| # lldb.frame is supposed to contain the right frame, but it doesnt :/ so do the dance | ||
| frame = lldb.debugger.GetSelectedTarget().GetProcess().GetSelectedThread().GetSelectedFrame() | ||
| language = frame.GetCompileUnit().GetLanguage() # requires lldb r222189 (2014-11-17) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mblsha Which version of Xcode includes
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure, it's not yet in 6.1.1, so I'll try it once it becomes final.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
👍 |
||
| return evaluateExpressionValueWithLanguage(expression, language, printErrors) | ||
|
|
||
| # evaluates expression in Objective-C++ context, so it will work even for | ||
| # Swift projects | ||
| def evaluateExpressionValue(expression, printErrors=True): | ||
| return evaluateExpressionValueWithLanguage(expression, lldb.eLanguageTypeObjC_plus_plus, printErrors) | ||
|
|
||
| def evaluateIntegerExpression(expression, printErrors=True): | ||
| output = evaluateExpression('(int)(' + expression + ')', printErrors).replace('\'', '') | ||
| if output.startswith('\\x'): # Booleans may display as \x01 (Hex) | ||
|
|
||
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?