This commit:
a) adds a Python summary provider for NSDate
b) changes the initialization for ScriptInterpreter so that we are not passing a bulk of Python-specific function pointers around
c) provides a new ScriptInterpreterObject class that allows for ref-count safe wrapping of scripting objects on the C++ side
d) contains much needed performance improvements:
1) the pointer to the Python function generating a scripted summary is now cached instead of looked up every time
2) redundant memory reads in the Python ObjC runtime wrapper are eliminated
3) summaries now use the m_summary_str in ValueObject to store their data instead of passing around ( == copying) an std::string object
e) contains other minor fixes, such as adding descriptive error messages for some cases of summary generation failure
llvm-svn: 151703
diff --git a/lldb/examples/summaries/cocoa/NSData.py b/lldb/examples/summaries/cocoa/NSData.py
index 362bc81..9acb2fe 100644
--- a/lldb/examples/summaries/cocoa/NSData.py
+++ b/lldb/examples/summaries/cocoa/NSData.py
@@ -15,7 +15,7 @@
# obey the interface specification for synthetic children providers
class NSConcreteData_SummaryProvider:
def adjust_for_architecture(self):
- self.lp64 = (self.valobj.GetTarget().GetProcess().GetAddressByteSize() == 8)
+ self.is_64_bit = (self.valobj.GetTarget().GetProcess().GetAddressByteSize() == 8)
self.is_little = (self.valobj.GetTarget().GetProcess().GetByteOrder() == lldb.eByteOrderLittle)
self.pointer_size = self.valobj.GetTarget().GetProcess().GetAddressByteSize()
@@ -26,7 +26,7 @@
def update(self):
self.adjust_for_architecture();
self.id_type = self.valobj.GetType().GetBasicType(lldb.eBasicTypeObjCID)
- if self.lp64:
+ if self.is_64_bit:
self.NSUInteger = self.valobj.GetType().GetBasicType(lldb.eBasicTypeUnsignedLong)
else:
self.NSUInteger = self.valobj.GetType().GetBasicType(lldb.eBasicTypeUnsignedInt)
@@ -37,7 +37,7 @@
# machine word long, which means we actually have two pointers
# worth of data to skip
def offset(self):
- if self.lp64:
+ if self.is_64_bit:
return 16
else:
return 8
@@ -51,7 +51,7 @@
class NSDataUnknown_SummaryProvider:
def adjust_for_architecture(self):
- self.lp64 = (self.valobj.GetTarget().GetProcess().GetAddressByteSize() == 8)
+ self.is_64_bit = (self.valobj.GetTarget().GetProcess().GetAddressByteSize() == 8)
self.is_little = (self.valobj.GetTarget().GetProcess().GetByteOrder() == lldb.eByteOrderLittle)
self.pointer_size = self.valobj.GetTarget().GetProcess().GetAddressByteSize()