[Lldb-commits] [lldb] r166610 - /lldb/trunk/examples/summaries/cocoa/NSDate.py
Enrico Granata
egranata at apple.com
Wed Oct 24 12:05:32 PDT 2012
Author: enrico
Date: Wed Oct 24 14:05:32 2012
New Revision: 166610
URL: http://llvm.org/viewvc/llvm-project?rev=166610&view=rev
Log:
Changing the NSDate data formatter to use GetData().uint64[] instead of relying on SBValue.GetValueAsUnsigned() to reinterpret a double as a uint64_t
Modified:
lldb/trunk/examples/summaries/cocoa/NSDate.py
Modified: lldb/trunk/examples/summaries/cocoa/NSDate.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/summaries/cocoa/NSDate.py?rev=166610&r1=166609&r2=166610&view=diff
==============================================================================
--- lldb/trunk/examples/summaries/cocoa/NSDate.py (original)
+++ lldb/trunk/examples/summaries/cocoa/NSDate.py Wed Oct 24 14:05:32 2012
@@ -108,7 +108,7 @@
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 @@
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 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'
More information about the lldb-commits
mailing list