Changing the NSDate data formatter to use GetData().uint64[] instead of relying on...
authorEnrico Granata <egranata@apple.com>
Wed, 24 Oct 2012 19:05:32 +0000 (19:05 +0000)
committerEnrico Granata <egranata@apple.com>
Wed, 24 Oct 2012 19:05:32 +0000 (19:05 +0000)
llvm-svn: 166610

lldb/examples/summaries/cocoa/NSDate.py

index aa97356..ae1ff6b 100644 (file)
@@ -108,7 +108,7 @@ class NSUntaggedDate_SummaryProvider:
                value = self.valobj.CreateChildAtOffset("value",
                                                        self.offset(),
                                                        self.sys_params.types_cache.double)
-               value_double = struct.unpack('d', struct.pack('Q', value.GetValueAsUnsigned(0)))[0]
+               value_double = struct.unpack('d', struct.pack('Q', value.GetData().uint64[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))
@@ -138,7 +138,7 @@ class NSCalendarDate_SummaryProvider:
                value = self.valobj.CreateChildAtOffset("value",
                                                        self.offset(),
                                                        self.sys_params.types_cache.double)
-               value_double = struct.unpack('d', struct.pack('Q', value.GetValueAsUnsigned(0)))[0]
+               value_double = struct.unpack('d', struct.pack('Q', value.GetData().uint64[0]))[0]
                return xcode_format_count(osx_to_python_time(value_double))
 
 class NSTimeZoneClass_SummaryProvider:
@@ -255,7 +255,7 @@ def NSTimeZone_SummaryProvider (valobj,dict):
 def CFAbsoluteTime_SummaryProvider (valobj,dict):
        logger = lldb.formatters.Logger.Logger()
        try:
-               value_double = struct.unpack('d', struct.pack('Q', valobj.GetValueAsUnsigned(0)))[0]
+               value_double = struct.unpack('d', struct.pack('Q', valobj.GetData().uint64[0]))[0]
                return xcode_format_count(osx_to_python_time(value_double))
        except:
                return 'Summary Unavailable'