summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2016-02-12 07:50:15 +0000
committerEnrico Granata <egranata@apple.com>2016-02-12 07:50:15 +0000
commit2543d2904853a5b80a83504c140601df45e91bcf (patch)
treec7af02e7dec0449f898f2f9b3f724b932af600ac /lldb/packages/Python/lldbsuite/test
parent47134196fca455789fd04730efbfe36612537411 (diff)
downloadbcm5719-llvm-2543d2904853a5b80a83504c140601df45e91bcf.tar.gz
bcm5719-llvm-2543d2904853a5b80a83504c140601df45e91bcf.zip
The data formatters for NSArray, NSDictionary and (only partially) NSSet contain logic to inspect the objects without running code.
However, they also contain fallback logic that - in cases where LLDB can't recognize the specific subclass - actually does run code in order to inspect those objects. The argument for this logic was that these data types are critical enough that the risk of getting it wrong is outweighed by the advantage of always providing accurate child information. Practical experience however shows that "po" - a code running data-inspection command - is quite frequently used, and not considered burdensome by users. As such, this makes the code-running fallback in the data formatters a risk that carries very little actual reward. Also, unlike the time this code was originally written, we now have accurate class information for Objective-C, and thus we are less likely to improperly identify classes. This commit removes support for the code-running fallback, and aligns the data formatters for NSArray, NSDictionary and NSSet to the general no-code-running behavior of other data formatters. While it is possible for us to add support for some subclasses that are now no longer covered by static inspection alone, this is beyond the scope of this commit. llvm-svn: 260664
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py7
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m45
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py8
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/main.m5
4 files changed, 1 insertions, 64 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
index 59a4daef3b5..2ecb2d7f300 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
@@ -214,18 +214,13 @@ class ObjCDataFormatterTestCase(TestBase):
'(NSNumber *) num_at4 = ',' (double)-12.5'])
def nscontainers_data_formatter_commands(self):
- self.expect('frame variable newArray newDictionary newMutableDictionary cfdict_ref mutable_dict_ref cfarray_ref mutable_array_ref',
+ self.expect('frame variable newArray newDictionary newMutableDictionary cfarray_ref mutable_array_ref',
substrs = ['(NSArray *) newArray = ','@"50 elements"',
'(NSDictionary *) newDictionary = ',' 12 key/value pairs',
'(NSDictionary *) newMutableDictionary = ',' 21 key/value pairs',
- '(CFDictionaryRef) cfdict_ref = ','3 key/value pairs',
- '(CFMutableDictionaryRef) mutable_dict_ref = ','12 key/value pairs',
'(CFArrayRef) cfarray_ref = ','@"3 elements"',
'(CFMutableArrayRef) mutable_array_ref = ','@"11 elements"'])
- self.expect('frame variable nscounted_set',
- substrs = ['(NSCountedSet *) nscounted_set = ','5 elements'])
-
self.expect('frame variable iset1 iset2 imset',
substrs = ['4 indexes','512 indexes','10 indexes'])
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m
index 6eb7e021f70..3d4a8da5051 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m
@@ -415,41 +415,6 @@ int main (int argc, const char * argv[])
CFStringRef cfstring_ref = CFSTR("HELLO WORLD");
-
- CFSetRef set_ref = CFSetCreate(NULL, data_set, 3, NULL);
-
- CFMutableSetRef mutable_set_ref = CFSetCreateMutable(NULL, 5, NULL);
-
- CFSetAddValue(mutable_set_ref, str1);
- CFSetAddValue(mutable_set_ref, str2);
- CFSetAddValue(mutable_set_ref, str3);
- CFSetAddValue(mutable_set_ref, str4);
- CFSetAddValue(mutable_set_ref, str5);
- CFSetAddValue(mutable_set_ref, str6);
- CFSetAddValue(mutable_set_ref, str7);
- CFSetAddValue(mutable_set_ref, str8);
- CFSetAddValue(mutable_set_ref, str9);
- CFSetAddValue(mutable_set_ref, str10);
- CFSetAddValue(mutable_set_ref, str11);
- CFSetAddValue(mutable_set_ref, str12);
-
-
- CFDictionaryRef cfdict_ref = CFDictionaryCreate(NULL, data_set, data_set, 3, NULL, NULL);
- CFMutableDictionaryRef mutable_dict_ref = CFDictionaryCreateMutable(NULL, 16, NULL, NULL);
-
- CFDictionarySetValue(mutable_dict_ref, str1, str1);
- CFDictionarySetValue(mutable_dict_ref, str2, str2);
- CFDictionarySetValue(mutable_dict_ref, str3, str3);
- CFDictionarySetValue(mutable_dict_ref, str4, str1);
- CFDictionarySetValue(mutable_dict_ref, str5, str2);
- CFDictionarySetValue(mutable_dict_ref, str6, str3);
- CFDictionarySetValue(mutable_dict_ref, str7, str1);
- CFDictionarySetValue(mutable_dict_ref, str8, str2);
- CFDictionarySetValue(mutable_dict_ref, str9, str3);
- CFDictionarySetValue(mutable_dict_ref, str10, str1);
- CFDictionarySetValue(mutable_dict_ref, str11, str2);
- CFDictionarySetValue(mutable_dict_ref, str12, str3);
-
CFArrayRef cfarray_ref = CFArrayCreate(NULL, data_set, 3, NULL);
CFMutableArrayRef mutable_array_ref = CFArrayCreateMutable(NULL, 16, NULL);
@@ -556,16 +521,6 @@ int main (int argc, const char * argv[])
CFAbsoluteTime date3_abs = CFDateGetAbsoluteTime(date3);
CFAbsoluteTime date4_abs = CFDateGetAbsoluteTime(date4);
- NSCountedSet *nscounted_set = [[NSCountedSet alloc] initWithCapacity:5];
-
- [nscounted_set addObject:str0];
- [nscounted_set addObject:str1];
- [nscounted_set addObject:str0];
- [nscounted_set addObject:str0];
- [nscounted_set addObject:@"foo1"];
- [nscounted_set addObject:@"foo2"];
- [nscounted_set addObject:@"foo3"];
-
NSIndexSet *iset1 = [[NSIndexSet alloc] initWithIndexesInRange:NSMakeRange(1, 4)];
NSIndexSet *iset2 = [[NSIndexSet alloc] initWithIndexesInRange:NSMakeRange(1, 512)];
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py
index e069bb46a3c..743878d5c4c 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py
@@ -69,10 +69,6 @@ class DataFormatterOneIsSingularTestCase(TestBase):
substrs = ['@"1 value"'])
self.expect('frame variable mutable_bag_ref', matching=False,
substrs = ['1 values'])
- self.expect('frame variable nscounted_set',
- substrs = ['1 element'])
- self.expect('frame variable nscounted_set', matching=False,
- substrs = ['1 elements'])
self.expect('frame variable imset',
substrs = ['1 index'])
self.expect('frame variable imset', matching=False,
@@ -81,10 +77,6 @@ class DataFormatterOneIsSingularTestCase(TestBase):
substrs = ['@"1 item"'])
self.expect('frame variable binheap_ref', matching=False,
substrs = ['1 items'])
- self.expect('frame variable nsset',
- substrs = ['1 element'])
- self.expect('frame variable nsset', matching=False,
- substrs = ['1 elements'])
self.expect('frame variable immutableData',
substrs = ['1 byte'])
self.expect('frame variable immutableData', matching=False,
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/main.m b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/main.m
index 7204d3c7b20..ad2a3c0f87f 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/main.m
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/main.m
@@ -22,17 +22,12 @@ int main (int argc, const char * argv[])
CFMutableBagRef mutable_bag_ref = CFBagCreateMutable(NULL, 15, NULL);
CFBagSetValue(mutable_bag_ref, CFSTR("Hello world"));
- NSCountedSet *nscounted_set = [[NSCountedSet alloc] initWithCapacity:5];
- [nscounted_set addObject:@"foo"];
-
NSMutableIndexSet *imset = [[NSMutableIndexSet alloc] init];
[imset addIndex:4];
CFBinaryHeapRef binheap_ref = CFBinaryHeapCreate(NULL, 15, &kCFStringBinaryHeapCallBacks, NULL);
CFBinaryHeapAddValue(binheap_ref, CFSTR("Hello world"));
- NSSet* nsset = [[NSSet alloc] initWithObjects:@"foo",nil];
-
NSData *immutableData = [[NSData alloc] initWithBytes:"HELLO" length:1];
OpenPOWER on IntegriCloud