-
Notifications
You must be signed in to change notification settings - Fork 354
[lldb][windows] add NSDate and FoundationEssentials.Date dataformatters #11948
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
[lldb][windows] add NSDate and FoundationEssentials.Date dataformatters #11948
Conversation
|
@swift-ci please test |
b5c7671 to
3a44d26
Compare
|
@swift-ci please test |
1 similar comment
|
@swift-ci please test |
|
@swift-ci please test linux |
|
@swift-ci please test windows |
3a44d26 to
1950598
Compare
|
@swift-ci please test |
1950598 to
03c590b
Compare
|
@swift-ci please test |
03c590b to
d84204e
Compare
|
@swift-ci please test |
| if (!time_sp) | ||
| time_sp = valobj.GetChildAtNamePath( | ||
| {g__timeIntervalSinceReferenceDate, "_value"}); | ||
| #endif |
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.
This is probably not correct. The #idef checks of a property of the platform lldb is running on, but you probably want to do something different based on the target triple. I.e., this should not trigger if you debug a macOS process over the network with lldb.exe.
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.
I fixed this by removing the #ifdef check. The GetChildAtNamePath call will only succeed on Windows anyways.
| tm_epoch.tm_sec = 0; | ||
| tm_epoch.tm_hour = 0; | ||
| tm_epoch.tm_min = 0; | ||
| tm_epoch.tm_mon = 0; |
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.
nit: is this diff relevant for the pr?
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.
No really, I reverted it 👍
0e4153a to
4c57eed
Compare
|
@swift-ci please test |
4c57eed to
0eb0338
Compare
| "Foundation.Date summary provider", ConstString("Foundation.Date"), | ||
| TypeSummaryImpl::Flags(summary_flags).SetDontShowChildren(true)); | ||
| "Foundation.Date summary provider", | ||
| ConstString("Foundation(Essentials)?\\.(NS)?Date"), |
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.
This will match:
Foundation.DateFoundationEssentials.DateFoundation.NSDate
This should not clash with the other Foundation.NSDate formatter. The tests should confirm this.
|
@swift-ci please test |
|
@swift-ci please test macos |
| ) | ||
|
|
||
| self.expect( | ||
| "v date", |
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.
Nit (for the future): I think it's better to spell out "frame variable" instead of "v". We've changed aliases in the past so it could happen again, it's also easier to grep
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.
Thanks! I opened #12005 as a follow up.
| @@ -0,0 +1,16 @@ | |||
| import Foundation | |||
|
|
|||
| let paris = TimeZone(identifier: "Europe/Paris")! | |||
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.
Nit: it would be better to put this code in a main() (or whatever name you want) function and immediately call it. These variables are actually static, not local variables. I think this works now because of DIL but we might want to go back to enforcing frame var works only for local variables in the future.
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.
Thanks! I opened #12005 as a follow up.
This patch adds a dataformatter for FoundationEssentials.Date and NSDate on Windows.
Before
After
rdar://155901731