diff options
author | Enrico Granata <egranata@apple.com> | 2012-09-04 20:02:39 +0000 |
---|---|---|
committer | Enrico Granata <egranata@apple.com> | 2012-09-04 20:02:39 +0000 |
commit | 39cf67e573b476c58809d27e3974d19cca8e9aee (patch) | |
tree | 260fbfa413a949b99b880441a443e3d8b8a04200 | |
parent | 7ea9ce7e64505469e3304c2dad869ac49ad79dad (diff) | |
download | bcm5719-llvm-39cf67e573b476c58809d27e3974d19cca8e9aee.tar.gz bcm5719-llvm-39cf67e573b476c58809d27e3974d19cca8e9aee.zip |
<rdar://problem/12068655> Make sure [NSDate distantPast] is formatted correctly
llvm-svn: 163162
-rw-r--r-- | lldb/examples/summaries/cocoa/NSDate.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lldb/examples/summaries/cocoa/NSDate.py b/lldb/examples/summaries/cocoa/NSDate.py index df1318244eb..aa97356bc74 100644 --- a/lldb/examples/summaries/cocoa/NSDate.py +++ b/lldb/examples/summaries/cocoa/NSDate.py @@ -78,6 +78,8 @@ class NSTaggedDate_SummaryProvider: # while all Python knows about is the "epoch", which is a platform-dependent # year (1970 of *nix) whose Jan 1 at midnight is taken as reference value_double = struct.unpack('d', struct.pack('Q', self.data))[0] + if value_double == -63114076800.0: + return '0001-12-30 00:00:00 +0000' return xcode_format_count(osx_to_python_time(value_double)) @@ -107,6 +109,8 @@ class NSUntaggedDate_SummaryProvider: self.offset(), self.sys_params.types_cache.double) value_double = struct.unpack('d', struct.pack('Q', value.GetValueAsUnsigned(0)))[0] + if value_double == -63114076800.0: + return '0001-12-30 00:00:00 +0000' return xcode_format_count(osx_to_python_time(value_double)) class NSCalendarDate_SummaryProvider: |