Skip to content
Snippets Groups Projects
Commit 7b3d205e authored by Enrico Granata's avatar Enrico Granata
Browse files

Changing the NSDate data formatter to use GetData().uint64[] instead of...

Changing the NSDate data formatter to use GetData().uint64[] instead of relying on SBValue.GetValueAsUnsigned() to reinterpret a double as a uint64_t

llvm-svn: 166610
parent f4d5a790
No related branches found
No related tags found
No related merge requests found
......@@ -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'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment