added a new formatter for CF(Mutable)BitVector
fixed a few potential NULL-pointer derefs in ValueObject
we have a way to provide docstrings for properties we add to the SWIG layer - a few of these properties have a docstring already, more will come in future commits
added a new bunch of properties to SBData to make it more natural and Python-like to access the data they contain
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@151962 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Core/FormatManager.cpp b/source/Core/FormatManager.cpp
index a13992f..2369514 100644
--- a/source/Core/FormatManager.cpp
+++ b/source/Core/FormatManager.cpp
@@ -885,6 +885,9 @@
AddSummary(appkit_category_sp, "@\"${var.month%d}/${var.day%d}/${var.year%d} ${var.hour%d}:${var.minute%d}:${var.second}\"", ConstString("CFGregorianDate"), appkit_flags);
+ AddScriptSummary(appkit_category_sp, "CFBitVector.CFBitVector_SummaryProvider", ConstString("CFBitVectorRef"), appkit_flags);
+ AddScriptSummary(appkit_category_sp, "CFBitVector.CFBitVector_SummaryProvider", ConstString("CFMutableBitVectorRef"), appkit_flags);
+
TypeCategoryImpl::SharedPointer vectors_category_sp = GetCategory(m_vectortypes_category_name);
TypeSummaryImpl::Flags vector_flags;
diff --git a/source/Core/ValueObject.cpp b/source/Core/ValueObject.cpp
index bb6e390..3d82995 100644
--- a/source/Core/ValueObject.cpp
+++ b/source/Core/ValueObject.cpp
@@ -2221,24 +2221,26 @@
final_task_on_target ? final_task_on_target : &dummy_final_task_on_target);
if (!final_task_on_target || *final_task_on_target == ValueObject::eNothing)
- {
return ret_val;
- }
- if (ret_val.get() && *final_value_type == ePlain) // I can only deref and takeaddress of plain objects
+
+ if (ret_val.get() && ((final_value_type ? *final_value_type : dummy_final_value_type) == ePlain)) // I can only deref and takeaddress of plain objects
{
- if (*final_task_on_target == ValueObject::eDereference)
+ if ( (final_task_on_target ? *final_task_on_target : dummy_final_task_on_target) == ValueObject::eDereference)
{
Error error;
ValueObjectSP final_value = ret_val->Dereference(error);
if (error.Fail() || !final_value.get())
{
- *reason_to_stop = ValueObject::eDereferencingFailed;
- *final_value_type = ValueObject::eInvalid;
+ if (reason_to_stop)
+ *reason_to_stop = ValueObject::eDereferencingFailed;
+ if (final_value_type)
+ *final_value_type = ValueObject::eInvalid;
return ValueObjectSP();
}
else
{
- *final_task_on_target = ValueObject::eNothing;
+ if (final_task_on_target)
+ *final_task_on_target = ValueObject::eNothing;
return final_value;
}
}
@@ -2248,13 +2250,16 @@
ValueObjectSP final_value = ret_val->AddressOf(error);
if (error.Fail() || !final_value.get())
{
- *reason_to_stop = ValueObject::eTakingAddressFailed;
- *final_value_type = ValueObject::eInvalid;
+ if (reason_to_stop)
+ *reason_to_stop = ValueObject::eTakingAddressFailed;
+ if (final_value_type)
+ *final_value_type = ValueObject::eInvalid;
return ValueObjectSP();
}
else
{
- *final_task_on_target = ValueObject::eNothing;
+ if (final_task_on_target)
+ *final_task_on_target = ValueObject::eNothing;
return final_value;
}
}
diff --git a/source/Interpreter/ScriptInterpreterPython.cpp b/source/Interpreter/ScriptInterpreterPython.cpp
index 475378f..87cb97e 100644
--- a/source/Interpreter/ScriptInterpreterPython.cpp
+++ b/source/Interpreter/ScriptInterpreterPython.cpp
@@ -282,7 +282,7 @@
// WARNING: temporary code that loads Cocoa formatters - this should be done on a per-platform basis rather than loading the whole set
// and letting the individual formatter classes exploit APIs to check whether they can/cannot do their task
run_string.Clear();
- run_string.Printf ("run_one_line (%s, 'import CFString, CFArray, CFDictionary, NSData, NSMachPort, NSSet, NSNotification, NSException, CFBag, CFBinaryHeap, NSURL, NSBundle, NSNumber, NSDate, NSIndexSet, Selector')", m_dictionary_name.c_str());
+ run_string.Printf ("run_one_line (%s, 'import CFString, CFArray, CFDictionary, NSData, NSMachPort, NSSet, NSNotification, NSException, CFBag, CFBinaryHeap, NSURL, NSBundle, NSNumber, NSDate, NSIndexSet, Selector, CFBitVector')", m_dictionary_name.c_str());
PyRun_SimpleString (run_string.GetData());
int new_count = Debugger::TestDebuggerRefCount();