[Lldb-commits] [lldb] r265865 - Remove what I believe are the last known instances of formatters that run code
Enrico Granata via lldb-commits
lldb-commits at lists.llvm.org
Fri Apr 8 15:49:31 PDT 2016
Author: enrico
Date: Fri Apr 8 17:49:31 2016
New Revision: 265865
URL: http://llvm.org/viewvc/llvm-project?rev=265865&view=rev
Log:
Remove what I believe are the last known instances of formatters that run code
Modified:
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/main.m
lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp
lldb/trunk/source/Plugins/Language/ObjC/CF.cpp
Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py?rev=265865&r1=265864&r2=265865&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py Fri Apr 8 17:49:31 2016
@@ -214,11 +214,9 @@ class ObjCDataFormatterTestCase(TestBase
self.expect('frame variable iset1 iset2 imset',
substrs = ['4 indexes','512 indexes','10 indexes'])
- self.expect('frame variable mutable_bag_ref cfbag_ref binheap_ref',
- substrs = ['(CFMutableBagRef) mutable_bag_ref = ','@"17 values"',
- '(CFBagRef) cfbag_ref = ','@"15 values"',
- '(CFBinaryHeapRef) binheap_ref = ','@"21 items"'])
-
+ self.expect('frame variable binheap_ref',
+ substrs = ['(CFBinaryHeapRef) binheap_ref = ','@"21 items"'])
+
self.expect('expression -d run -- [NSArray new]', substrs=['@"0 elements"'])
def nsdata_data_formatter_commands(self):
Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m?rev=265865&r1=265864&r2=265865&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m Fri Apr 8 17:49:31 2016
@@ -431,31 +431,6 @@ int main (int argc, const char * argv[])
CFArraySetValueAtIndex(mutable_array_ref, 9, str11);
CFArraySetValueAtIndex(mutable_array_ref, 10, str12);
- CFMutableBagRef mutable_bag_ref = CFBagCreateMutable(NULL, 15, NULL);
-
- CFBagSetValue(mutable_bag_ref, strB10);
- CFBagSetValue(mutable_bag_ref, str1);
- CFBagSetValue(mutable_bag_ref, str2);
- CFBagSetValue(mutable_bag_ref, str3);
- CFBagSetValue(mutable_bag_ref, str4);
- CFBagSetValue(mutable_bag_ref, str5);
- CFBagSetValue(mutable_bag_ref, str6);
- CFBagSetValue(mutable_bag_ref, str7);
- CFBagSetValue(mutable_bag_ref, str8);
- CFBagSetValue(mutable_bag_ref, str9);
- CFBagSetValue(mutable_bag_ref, str10);
- CFBagSetValue(mutable_bag_ref, str11);
- CFBagSetValue(mutable_bag_ref, str12);
- CFBagSetValue(mutable_bag_ref, strA1);
- CFBagSetValue(mutable_bag_ref, strA2);
- CFBagSetValue(mutable_bag_ref, strA3);
-
- CFBagRef cfbag_ref = CFBagCreateCopy(NULL, mutable_bag_ref);
-
- CFBagSetValue(mutable_bag_ref, strB8);
- CFBagSetValue(mutable_bag_ref, strC4);
-
-
CFBinaryHeapRef binheap_ref = CFBinaryHeapCreate(NULL, 15, &kCFStringBinaryHeapCallBacks, NULL);
CFBinaryHeapAddValue(binheap_ref, str1);
CFBinaryHeapAddValue(binheap_ref, str2);
Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py?rev=265865&r1=265864&r2=265865&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py Fri Apr 8 17:49:31 2016
@@ -65,10 +65,6 @@ class DataFormatterOneIsSingularTestCase
substrs = ['1 key/value pair'])
self.expect('frame variable dict', matching=False,
substrs = ['1 key/value pairs'])
- self.expect('frame variable mutable_bag_ref',
- substrs = ['@"1 value"'])
- self.expect('frame variable mutable_bag_ref', matching=False,
- substrs = ['1 values'])
self.expect('frame variable imset',
substrs = ['1 index'])
self.expect('frame variable imset', matching=False,
Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/main.m
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/main.m?rev=265865&r1=265864&r2=265865&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/main.m (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/main.m Fri Apr 8 17:49:31 2016
@@ -11,27 +11,21 @@
int main (int argc, const char * argv[])
{
-
- NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
-
+ NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSArray* key = [NSArray arrayWithObjects:@"foo",nil];
NSArray* value = [NSArray arrayWithObjects:@"key",nil];
NSDictionary *dict = [NSDictionary dictionaryWithObjects:value forKeys:key];
- CFMutableBagRef mutable_bag_ref = CFBagCreateMutable(NULL, 15, NULL);
- CFBagSetValue(mutable_bag_ref, CFSTR("Hello world"));
+ NSMutableIndexSet *imset = [[NSMutableIndexSet alloc] init];
+ [imset addIndex:4];
- NSMutableIndexSet *imset = [[NSMutableIndexSet alloc] init];
- [imset addIndex:4];
+ CFBinaryHeapRef binheap_ref = CFBinaryHeapCreate(NULL, 15, &kCFStringBinaryHeapCallBacks, NULL);
+ CFBinaryHeapAddValue(binheap_ref, CFSTR("Hello world"));
- CFBinaryHeapRef binheap_ref = CFBinaryHeapCreate(NULL, 15, &kCFStringBinaryHeapCallBacks, NULL);
- CFBinaryHeapAddValue(binheap_ref, CFSTR("Hello world"));
+ NSData *immutableData = [[NSData alloc] initWithBytes:"HELLO" length:1];
- NSData *immutableData = [[NSData alloc] initWithBytes:"HELLO" length:1];
-
-
- [pool drain];// Set break point at this line.
- return 0;
+ [pool drain];// Set break point at this line.
+ return 0;
}
Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp?rev=265865&r1=265864&r2=265865&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp (original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp Fri Apr 8 17:49:31 2016
@@ -54,7 +54,6 @@ private:
ExecutionContextRef m_exe_ctx_ref;
lldb::addr_t m_pair_address;
CompilerType m_pair_type;
- EvaluateExpressionOptions m_options;
lldb::ValueObjectSP m_pair_sp;
};
@@ -74,15 +73,10 @@ LibstdcppMapIteratorSyntheticFrontEnd::L
m_exe_ctx_ref(),
m_pair_address(0),
m_pair_type(),
- m_options(),
m_pair_sp()
{
if (valobj_sp)
Update();
- m_options.SetCoerceToId(false);
- m_options.SetUnwindOnError(true);
- m_options.SetKeepInMemory(true);
- m_options.SetUseDynamic(lldb::eDynamicCanRunTarget);
}
bool
Modified: lldb/trunk/source/Plugins/Language/ObjC/CF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ObjC/CF.cpp?rev=265865&r1=265864&r2=265865&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Language/ObjC/CF.cpp (original)
+++ lldb/trunk/source/Plugins/Language/ObjC/CF.cpp Fri Apr 8 17:49:31 2016
@@ -73,37 +73,28 @@ lldb_private::formatters::CFBagSummaryPr
if (descriptor->IsCFType())
{
ConstString type_name(valobj.GetTypeName());
- if (type_name == ConstString("__CFBag") || type_name == ConstString("const struct __CFBag"))
+
+ static ConstString g___CFBag("__CFBag");
+ static ConstString g_conststruct__CFBag("const struct __CFBag");
+
+ if (type_name == g___CFBag ||
+ type_name == g_conststruct__CFBag)
{
if (valobj.IsPointerType())
is_type_ok = true;
}
}
- if (is_type_ok == false)
- {
- StackFrameSP frame_sp(valobj.GetFrameSP());
- if (!frame_sp)
- return false;
- ValueObjectSP count_sp;
- StreamString expr;
- expr.Printf("(int)CFBagGetCount((void*)0x%" PRIx64 ")",valobj.GetPointerValue());
- EvaluateExpressionOptions options;
- options.SetResultIsInternal(true);
- if (process_sp->GetTarget().EvaluateExpression(expr.GetData(), frame_sp.get(), count_sp, options) != eExpressionCompleted)
- return false;
- if (!count_sp)
- return false;
- count = count_sp->GetValueAsUnsigned(0);
- }
- else
+ if (is_type_ok)
{
- uint32_t offset = 2*ptr_size+4 + valobj_addr;
+ lldb::addr_t offset = 2*ptr_size+4 + valobj_addr;
Error error;
count = process_sp->ReadUnsignedIntegerFromMemory(offset, 4, 0, error);
if (error.Fail())
return false;
}
+ else
+ return false;
std::string prefix,suffix;
if (Language* language = Language::FindPlugin(options.GetLanguage()))
@@ -284,37 +275,30 @@ lldb_private::formatters::CFBinaryHeapSu
if (descriptor->IsCFType())
{
ConstString type_name(valobj.GetTypeName());
- if (type_name == ConstString("__CFBinaryHeap") || type_name == ConstString("const struct __CFBinaryHeap"))
+
+ static ConstString g___CFBinaryHeap("__CFBinaryHeap");
+ static ConstString g_conststruct__CFBinaryHeap("const struct __CFBinaryHeap");
+ static ConstString g_CFBinaryHeapRef("CFBinaryHeapRef");
+
+ if (type_name == g___CFBinaryHeap ||
+ type_name == g_conststruct__CFBinaryHeap ||
+ type_name == g_CFBinaryHeapRef)
{
if (valobj.IsPointerType())
is_type_ok = true;
}
}
- if (is_type_ok == false)
+ if (is_type_ok)
{
- StackFrameSP frame_sp(valobj.GetFrameSP());
- if (!frame_sp)
- return false;
- ValueObjectSP count_sp;
- StreamString expr;
- expr.Printf("(int)CFBinaryHeapGetCount((void*)0x%" PRIx64 ")",valobj.GetPointerValue());
- EvaluateExpressionOptions options;
- options.SetResultIsInternal(true);
- if (process_sp->GetTarget().EvaluateExpression(expr.GetData(), frame_sp.get(), count_sp, options) != eExpressionCompleted)
- return false;
- if (!count_sp)
- return false;
- count = count_sp->GetValueAsUnsigned(0);
- }
- else
- {
- uint32_t offset = 2*ptr_size;
+ lldb::addr_t offset = 2*ptr_size + valobj_addr;
Error error;
count = process_sp->ReadUnsignedIntegerFromMemory(offset, 4, 0, error);
if (error.Fail())
return false;
}
+ else
+ return false;
std::string prefix,suffix;
if (Language* language = Language::FindPlugin(options.GetLanguage()))
More information about the lldb-commits
mailing list