-
Notifications
You must be signed in to change notification settings - Fork 341
[lldb] Initialize a shared, blank SwiftASTContext in Objective-C frames #10851
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
base: swift/release/6.2
Are you sure you want to change the base?
Conversation
I'm presuming someone out there will be affected, but hopefully not many. Do we have a workaround so that they accomplish whatever it is they're doing? |
Why can't lldb call the ObjC description function? Let's assume the following objc code: SwiftThing *thing = ...;
NSLog(@"thing: %@", [thing description]);
// break here Are there cases where the objc call to |
std::string m_description; | ||
{ | ||
StreamString ss; | ||
ss << "SwiftASTContext"; | ||
if (for_expressions) | ||
ss << "ForExpressions"; | ||
ss << "(module: " << '"' << key << "\", " << "cu: " << '"'; | ||
if (cu) | ||
if (cu && swift_context) |
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.
You can remove cu
here since swift_context
checks for it
@@ -1,8 +0,0 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> |
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.
Did you delete all of these files on purpose?
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.
Yes, this test relies on the behavior that no longer works after this patch.
Yes, you can always manually pass Swift compiler flags to the expression evaluator; that code path is still active after the patch. |
3449991
to
db04e90
Compare
I don't know yet, but that is what I would like to try next, after this patch. |
@swift-ci test |
The result of an Objective-C expression can be a Swift ValueObject. This means that `po foo` in Objective-C may run a Swift expression to print the object description of the result of the Objective-C expression `foo`. That expression has very few dependencies: ``` Swift._DebuggerSupport.stringForPrintObject(Swift.unsafeBitCast(0x001234, to: AnyObject.self)) ``` To avoid scanning potentially incompatible compiler flags and/or doing implicit imports in anotherwise explicitly built project, this patch ensures that one SwiftASTContext per triple is created, with no other contextual information. This makes `po` in ObjC much faster and reliable, the downside of this is that ```expr -l Swift -- import ModuleName``` will only work reliably for SDK modules outside of Swift frames. rdar://153332037
@swift-ci test |
The result of an Objective-C expression can be a Swift ValueObject. This means that
po foo
in Objective-C may run a Swift expression to print the object description of the result of the Objective-C expressionfoo
. That expression has very few dependencies:To avoid scanning potentially incompatible compiler flags and/or doing implicit imports in anotherwise explicitly built project, this patch ensures that one SwiftASTContext per triple is created, with no other contextual information. This makes
po
in ObjC much faster and reliable, the downside of this is thatexpr -l Swift -- import ModuleName
will only work reliably for SDK modules outside of Swift frames.
rdar://153332037