diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:50:09 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:50:09 +0000 |
commit | f3fbd1c0586ff6ec7895991e6c28f61a503c36a8 (patch) | |
tree | 48d008fd3df8c0e73271a4b18474e0aac6dbfe33 /packages/Python/lldbsuite/test/functionalities/data-formatter | |
parent | 2fc5d2d1dfaf623ce4e24cd8590565902f8c557c (diff) | |
download | src-vendor/lldb/lldb-release_39-r276489.tar.gz src-vendor/lldb/lldb-release_39-r276489.zip |
Vendor import of lldb release_39 branch r276489:vendor/lldb/lldb-release_39-r276489
Diffstat (limited to 'packages/Python/lldbsuite/test/functionalities/data-formatter')
72 files changed, 994 insertions, 379 deletions
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py index 94cdfdfeb343..fb3511ebd91d 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py @@ -6,11 +6,12 @@ from __future__ import print_function +import datetime import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import datetime -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class DataFormatterBoolRefPtr(TestBase): @@ -56,6 +57,8 @@ class DataFormatterBoolRefPtr(TestBase): substrs = ['YES']) self.expect('frame variable no_ref', substrs = ['NO']) + self.expect('frame variable unset_ref', + substrs = ['12']) # Now check that we use the right summary for BOOL* @@ -63,6 +66,8 @@ class DataFormatterBoolRefPtr(TestBase): substrs = ['YES']) self.expect('frame variable no_ptr', substrs = ['NO']) + self.expect('frame variable unset_ptr', + substrs = ['12']) # Now check that we use the right summary for BOOL @@ -70,3 +75,5 @@ class DataFormatterBoolRefPtr(TestBase): substrs = ['YES']) self.expect('frame variable no', substrs = ['NO']) + self.expect('frame variable unset', + substrs = ['12']) diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/main.mm b/packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/main.mm index a2461fd9da91..22c8790a7541 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/main.mm +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/main.mm @@ -11,17 +11,19 @@ int main (int argc, const char * argv[]) { - NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; BOOL yes = YES; BOOL no = NO; + BOOL unset = 12; BOOL &yes_ref = yes; BOOL &no_ref = no; + BOOL &unset_ref = unset; BOOL* yes_ptr = &yes; BOOL* no_ptr = &no; + BOOL* unset_ptr = &unset; [pool drain];// Set break point at this line. return 0; diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py index 7cd2a49b4717..914c5260ac24 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py @@ -8,8 +8,9 @@ from __future__ import print_function import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class CompactVectorsFormattingTestCase(TestBase): diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py index db426cac6e59..f8209f03d0c2 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py @@ -8,8 +8,9 @@ from __future__ import print_function import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class CategoriesDataFormatterTestCase(TestBase): @@ -154,6 +155,7 @@ class CategoriesDataFormatterTestCase(TestBase): self.runCmd("type category enable Category1") self.runCmd("type summary list -w Category1") + self.expect("type summary list -w NoSuchCategoryHere", substrs=['no matching results found']) self.expect("frame variable r1 r2 r3", substrs = ['r1 = Category1', diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py index 2ca737156a1a..99443a04f672 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py @@ -8,8 +8,9 @@ from __future__ import print_function import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class CppDataFormatterTestCase(TestBase): @@ -21,7 +22,7 @@ class CppDataFormatterTestCase(TestBase): # Find the line number to break at. self.line = line_number('main.cpp', '// Set break point at this line.') - @expectedFailureWindows("llvm.org/pr24462") # Data formatters have problems on Windows + @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24462: Data formatters have problems on Windows") def test_with_run_command(self): """Test that that file and class static variables display correctly.""" self.build() diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py index 0f254a67d5a6..2c2e08431175 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py @@ -8,8 +8,9 @@ from __future__ import print_function import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class DataFormatterDisablingTestCase(TestBase): @@ -21,7 +22,7 @@ class DataFormatterDisablingTestCase(TestBase): # Find the line number to break at. self.line = line_number('main.cpp', '// Set break point at this line.') - @expectedFailureWindows("llvm.org/pr24462") # Data formatters have problems on Windows + @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24462, Data formatters have problems on Windows") def test_with_run_command(self): """Check that we can properly disable all data formatter categories.""" self.build() @@ -61,6 +62,8 @@ class DataFormatterDisablingTestCase(TestBase): self.expect('frame variable string1', matching=False, substrs = ['hello world']) + self.expect('type summary list', substrs=['Category: system (disabled)']) + self.expect('type category list', substrs = ['system','disabled',]) # now enable and check that we are back to normal diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py index 94df520d29b3..e9ac79ad08e2 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py @@ -48,7 +48,9 @@ class NamedSummariesDataFormatterTestCase(TestBase): self.runCmd("type summary add --summary-string \"First: x=${var.x} y=${var.y} dummy=${var.dummy}\" First") self.runCmd("type summary add --summary-string \"Second: x=${var.x} y=${var.y%hex}\" Second") self.runCmd("type summary add --summary-string \"Third: x=${var.x} z=${var.z}\" Third") - + + self.expect('type summary list', substrs=['AllUseIt']) + self.expect("frame variable first", substrs = ['First: x=12']) diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py index e12ddca2eea7..d7d4118d1d6a 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py @@ -7,11 +7,12 @@ from __future__ import print_function +import datetime import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import datetime -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class ObjCDataFormatterTestCase(TestBase): @@ -66,11 +67,6 @@ class ObjCDataFormatterTestCase(TestBase): """Test formatters for NSException.""" self.appkit_tester_impl(self.nsexception_data_formatter_commands) - @skipUnlessDarwin - def test_nsmisc_with_run_command(self): - """Test formatters for misc NS classes.""" - self.appkit_tester_impl(self.nsmisc_data_formatter_commands) - @skipUnlessDarwin def test_nsdate_with_run_command(self): @@ -191,7 +187,7 @@ class ObjCDataFormatterTestCase(TestBase): def nsnumber_data_formatter_commands(self): # Now enable AppKit and check we are displaying Cocoa classes correctly - self.expect('frame variable num1 num2 num3 num4 num5 num6 num7 num8_Y num8_N num9', + self.expect('frame variable num1 num2 num3 num4 num5 num6 num7 num9', substrs = ['(NSNumber *) num1 = ',' (int)5', '(NSNumber *) num2 = ',' (float)3.1', '(NSNumber *) num3 = ',' (double)3.14', @@ -199,13 +195,8 @@ class ObjCDataFormatterTestCase(TestBase): '(NSNumber *) num5 = ',' (char)65', '(NSNumber *) num6 = ',' (long)255', '(NSNumber *) num7 = ','2000000', - '(NSNumber *) num8_Y = ',' @"1"', - '(NSNumber *) num8_N = ',' @"0"', '(NSNumber *) num9 = ',' (short)-31616']) - self.expect('frame variable decimal_one', - substrs = ['(NSDecimalNumber *) decimal_one = 0x','1']) - self.expect('frame variable num_at1 num_at2 num_at3 num_at4', substrs = ['(NSNumber *) num_at1 = ',' (int)12', '(NSNumber *) num_at2 = ',' (int)-12', @@ -213,26 +204,19 @@ 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']) - 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): @@ -258,6 +242,9 @@ class ObjCDataFormatterTestCase(TestBase): self.expect('frame variable nserror', substrs = ['domain: @"Foobar" - code: 12']) + self.expect('frame variable nserrorptr', + substrs = ['domain: @"Foobar" - code: 12']) + self.expect('frame variable nserror->_userInfo', substrs = ['2 key/value pairs']) @@ -272,24 +259,10 @@ class ObjCDataFormatterTestCase(TestBase): def nsexception_data_formatter_commands(self): self.expect('frame variable except0 except1 except2 except3', - substrs = ['(NSException *) except0 = ','name:@"TheGuyWhoHasNoName" reason:@"cuz it\'s funny"', - '(NSException *) except1 = ','name:@"TheGuyWhoHasNoName~1" reason:@"cuz it\'s funny"', - '(NSException *) except2 = ','name:@"TheGuyWhoHasNoName`2" reason:@"cuz it\'s funny"', - '(NSException *) except3 = ','name:@"TheGuyWhoHasNoName/3" reason:@"cuz it\'s funny"']) - - def nsmisc_data_formatter_commands(self): - self.expect('frame variable localhost', - substrs = ['<NSHost ','> localhost ((','"127.0.0.1"']) - - if self.getArchitecture() in ['i386', 'x86_64']: - self.expect('frame variable my_task', - substrs = ['<NS','Task: 0x']) - - self.expect('frame variable range_value', - substrs = ['NSRange: {4, 4}']) - - self.expect('frame variable port', - substrs = ['(NSMachPort *) port = ',' mach port: ']) + substrs = ['(NSException *) except0 = ','name: @"TheGuyWhoHasNoName" - reason: @"cuz it\'s funny"', + '(NSException *) except1 = ','name: @"TheGuyWhoHasNoName~1" - reason: @"cuz it\'s funny"', + '(NSException *) except2 = ','name: @"TheGuyWhoHasNoName`2" - reason: @"cuz it\'s funny"', + '(NSException *) except3 = ','name: @"TheGuyWhoHasNoName/3" - reason: @"cuz it\'s funny"']) def nsdate_data_formatter_commands(self): self.expect('frame variable date1 date2', @@ -298,16 +271,18 @@ class ObjCDataFormatterTestCase(TestBase): # this test might fail if we hit the breakpoint late on December 31st of some given year # and midnight comes between hitting the breakpoint and running this line of code # hopefully the output will be revealing enough in that case :-) - now_year = str(datetime.datetime.now().year) + now_year = '%s-' % str(datetime.datetime.now().year) - self.expect('frame variable date3 date4', - substrs = [now_year,'1970']) + self.expect('frame variable date3', substrs = [now_year]) + self.expect('frame variable date4', substrs = ['1970']) + self.expect('frame variable date5', substrs = [now_year]) self.expect('frame variable date1_abs date2_abs', substrs = ['1985-04','2011-01']) - self.expect('frame variable date3_abs date4_abs', - substrs = [now_year,'1970']) + self.expect('frame variable date3_abs', substrs = [now_year]) + self.expect('frame variable date4_abs', substrs = ['1970']) + self.expect('frame variable date5_abs', substrs = [now_year]) self.expect('frame variable cupertino home europe', substrs = ['@"America/Los_Angeles"', @@ -385,7 +360,6 @@ class ObjCDataFormatterTestCase(TestBase): self.runCmd('type format clear', check=False) self.runCmd('type summary clear', check=False) self.runCmd('type synth clear', check=False) - self.runCmd('log timers disable', check=False) # Execute the cleanup function during test case tear down. @@ -406,7 +380,6 @@ class ObjCDataFormatterTestCase(TestBase): '(Rect *) rect_ptr = (t=4, l=8, b=4, r=7)', '(Point) point = (v=7, h=12)', '(Point *) point_ptr = (v=7, h=12)', - 'name:@"TheGuyWhoHasNoName" reason:@"cuz it\'s funny"', '1985', 'foo_selector_impl']; diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m index 6eb7e021f70b..020e2fc6227a 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m +++ b/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); @@ -466,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); @@ -520,6 +460,7 @@ int main (int argc, const char * argv[]) NSDictionary *error_userInfo = @{@"a": @1, @"b" : @2}; NSError *nserror = [[NSError alloc] initWithDomain:@"Foobar" code:12 userInfo:error_userInfo]; + NSError **nserrorptr = &nserror; NSBundle* bundle_string = [[NSBundle alloc] initWithPath:@"/System/Library/Frameworks/Accelerate.framework"]; NSBundle* bundle_url = [[NSBundle alloc] initWithURL:[[NSURL alloc] initWithString:@"file://localhost/System/Library/Frameworks/Cocoa.framework"]]; @@ -540,8 +481,6 @@ int main (int argc, const char * argv[]) NSException* except2 = [[NSException alloc] initWithName:@"TheGuyWhoHasNoName`2" reason:@"cuz it's funny" userInfo:nil]; NSException* except3 = [[NSException alloc] initWithName:@"TheGuyWhoHasNoName/3" reason:@"cuz it's funny" userInfo:nil]; - NSMachPort *port = [NSMachPort port]; - NSURL *nsurl = [[NSURL alloc] initWithString:@"http://www.foo.bar"]; NSURL *nsurl2 = [NSURL URLWithString:@"page.html" relativeToURL:nsurl]; NSURL *nsurl3 = [NSURL URLWithString:@"?whatever" relativeToURL:nsurl2]; @@ -550,22 +489,14 @@ int main (int argc, const char * argv[]) NSDate *date2 = [NSDate dateWithNaturalLanguageString:@"12am January 1, 2011"]; NSDate *date3 = [NSDate date]; NSDate *date4 = [NSDate dateWithTimeIntervalSince1970:24*60*60]; + NSDate *date5 = [NSDate dateWithTimeIntervalSinceReferenceDate: floor([[NSDate date] timeIntervalSinceReferenceDate])]; CFAbsoluteTime date1_abs = CFDateGetAbsoluteTime(date1); CFAbsoluteTime date2_abs = CFDateGetAbsoluteTime(date2); CFAbsoluteTime date3_abs = CFDateGetAbsoluteTime(date3); CFAbsoluteTime date4_abs = CFDateGetAbsoluteTime(date4); + CFAbsoluteTime date5_abs = CFDateGetAbsoluteTime(date5); - 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)]; @@ -598,21 +529,12 @@ int main (int argc, const char * argv[]) NSTimeZone *home_ns = [NSTimeZone timeZoneWithName:@"Europe/Rome"]; NSTimeZone *europe_ns = [NSTimeZone timeZoneWithAbbreviation:@"CET"]; - NSHost *localhost = [NSHost hostWithAddress:@"127.0.0.1"]; - -#ifndef IOS - NSTask *my_task = [[NSTask alloc] init]; -#endif - - CFGregorianUnits cf_greg_units = {1,3,5,12,5,7}; CFGregorianDate cf_greg_date = CFAbsoluteTimeGetGregorianDate(CFDateGetAbsoluteTime(date1), NULL); CFRange cf_range = {4,4}; NSPoint ns_point = {4,4}; NSRange ns_range = {4,4}; - - NSValue *range_value = [NSValue valueWithRange:ns_range]; - + NSRect ns_rect = {{1,1},{5,5}}; NSRect* ns_rect_ptr = &ns_rect; NSRectArray ns_rect_arr = &ns_rect; diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py index e11c45e9038e..f5c792593772 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py @@ -8,10 +8,11 @@ from __future__ import print_function import os, time +import datetime import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import datetime -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class NSStringDataFormatterTestCase(TestBase): diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py index 1281f17ab58a..3c9be04a2f6c 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py @@ -6,11 +6,12 @@ from __future__ import print_function +import datetime import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import datetime -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class DataFormatterOneIsSingularTestCase(TestBase): @@ -64,14 +65,6 @@ class DataFormatterOneIsSingularTestCase(TestBase): 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 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, @@ -80,10 +73,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/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/main.m b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/main.m index 7204d3c7b202..71ab8a746bb6 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/main.m +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/main.m @@ -11,32 +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]; - NSCountedSet *nscounted_set = [[NSCountedSet alloc] initWithCapacity:5]; - [nscounted_set addObject:@"foo"]; + CFBinaryHeapRef binheap_ref = CFBinaryHeapCreate(NULL, 15, &kCFStringBinaryHeapCallBacks, NULL); + CFBinaryHeapAddValue(binheap_ref, CFSTR("Hello world")); - NSMutableIndexSet *imset = [[NSMutableIndexSet alloc] init]; - [imset addIndex:4]; + NSData *immutableData = [[NSData alloc] initWithBytes:"HELLO" length:1]; - 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]; - - - [pool drain];// Set break point at this line. - return 0; + [pool drain];// Set break point at this line. + return 0; } diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py index d202ff5d64e1..c7ff28874c5a 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py @@ -8,8 +8,9 @@ from __future__ import print_function import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class PythonSynthDataFormatterTestCase(TestBase): @@ -43,6 +44,8 @@ class PythonSynthDataFormatterTestCase(TestBase): self.runCmd("run", RUN_SUCCEEDED) + process = self.dbg.GetSelectedTarget().GetProcess() + # The stop reason of the thread should be breakpoint. self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, substrs = ['stopped', @@ -61,39 +64,46 @@ class PythonSynthDataFormatterTestCase(TestBase): # print the f00_1 variable without a synth self.expect("frame variable f00_1", - substrs = ['a = 0', - 'b = 1', - 'r = 33']); + substrs = ['a = 1', + 'b = 2', + 'r = 34']); # now set up the synth self.runCmd("script from fooSynthProvider import *") self.runCmd("type synth add -l fooSynthProvider foo") + self.expect("type synthetic list foo", substrs=['fooSynthProvider']) + + # note that the value of fake_a depends on target byte order + if process.GetByteOrder() == lldb.eByteOrderLittle: + fake_a_val = 0x02000000 + else: + fake_a_val = 0x00000100 # check that we get the two real vars and the fake_a variables self.expect("frame variable f00_1", - substrs = ['r = 33', - 'fake_a = 16777216', - 'a = 0']); + substrs = ['r = 34', + 'fake_a = %d' % fake_a_val, + 'a = 1']); # check that we do not get the extra vars self.expect("frame variable f00_1", matching=False, - substrs = ['b = 1']); + substrs = ['b = 2']); # check access to members by name self.expect('frame variable f00_1.fake_a', - substrs = ['16777216']) + substrs = ['%d' % fake_a_val]) # check access to members by index self.expect('frame variable f00_1[1]', - substrs = ['16777216']) + substrs = ['%d' % fake_a_val]) # put synthetic children in summary in several combinations self.runCmd("type summary add --summary-string \"fake_a=${svar.fake_a}\" foo") self.expect('frame variable f00_1', - substrs = ['fake_a=16777216']) + substrs = ['fake_a=%d' % fake_a_val]) self.runCmd("type summary add --summary-string \"fake_a=${svar[1]}\" foo") self.expect('frame variable f00_1', - substrs = ['fake_a=16777216']) + substrs = ['fake_a=%d' % fake_a_val]) # clear the summary self.runCmd("type summary delete foo") @@ -101,23 +111,39 @@ class PythonSynthDataFormatterTestCase(TestBase): # check that the caching does not span beyond the stopoint self.runCmd("n") + if process.GetByteOrder() == lldb.eByteOrderLittle: + fake_a_val = 0x02000000 + else: + fake_a_val = 0x00000200 + self.expect("frame variable f00_1", - substrs = ['r = 33', - 'fake_a = 16777216', - 'a = 1']); + substrs = ['r = 34', + 'fake_a = %d' % fake_a_val, + 'a = 2']); # check that altering the object also alters fake_a self.runCmd("expr f00_1.a = 280") + + if process.GetByteOrder() == lldb.eByteOrderLittle: + fake_a_val = 0x02000001 + else: + fake_a_val = 0x00011800 + self.expect("frame variable f00_1", - substrs = ['r = 33', - 'fake_a = 16777217', + substrs = ['r = 34', + 'fake_a = %d' % fake_a_val, 'a = 280']); # check that expanding a pointer does the right thing + if process.GetByteOrder() == lldb.eByteOrderLittle: + fake_a_val = 0x0d000000 + else: + fake_a_val = 0x00000c00 + self.expect("frame variable --ptr-depth 1 f00_ptr", - substrs = ['r = 45', - 'fake_a = 218103808', - 'a = 12']) + substrs = ['r = 45', + 'fake_a = %d' % fake_a_val, + 'a = 12']) # now add a filter.. it should fail self.expect("type filter add foo --child b --child j", error=True, @@ -129,7 +155,7 @@ class PythonSynthDataFormatterTestCase(TestBase): 'j = 17']) self.expect("frame variable --ptr-depth 1 f00_ptr", substrs = ['r = 45', - 'fake_a = 218103808', + 'fake_a = %d' % fake_a_val, 'a = 12']) # now delete the synth and add the filter @@ -137,11 +163,11 @@ class PythonSynthDataFormatterTestCase(TestBase): self.runCmd("type filter add foo --child b --child j") self.expect('frame variable f00_1', - substrs = ['b = 1', - 'j = 17']) + substrs = ['b = 2', + 'j = 18']) self.expect("frame variable --ptr-depth 1 f00_ptr", matching=False, substrs = ['r = 45', - 'fake_a = 218103808', + 'fake_a = %d' % fake_a_val, 'a = 12']) # now add the synth and it should fail @@ -162,11 +188,11 @@ class PythonSynthDataFormatterTestCase(TestBase): self.runCmd("type synth add -l fooSynthProvider foo") self.expect('frame variable f00_1', matching=False, - substrs = ['b = 1', - 'j = 17']) + substrs = ['b = 2', + 'j = 18']) self.expect("frame variable --ptr-depth 1 f00_ptr", substrs = ['r = 45', - 'fake_a = 218103808', + 'fake_a = %d' % fake_a_val, 'a = 12']) # check the listing @@ -183,8 +209,8 @@ class PythonSynthDataFormatterTestCase(TestBase): self.expect("frame variable f00_1", substrs = ['a = 280', - 'b = 1', - 'j = 17']); + 'b = 2', + 'j = 18']); self.expect("frame variable f00_1", matching=False, substrs = ['fake_a = ']) diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/main.cpp index 48b29dcfd6e4..f45a2abfb9f1 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/main.cpp +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/main.cpp @@ -48,7 +48,7 @@ struct wrapint int main() { - foo f00_1(0); + foo f00_1(1); foo *f00_ptr = new foo(12); f00_1.a++; // Set break point at this line. diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py index 324b372cb11e..7ebc1c14ce13 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py @@ -52,6 +52,7 @@ class ScriptDataFormatterTestCase(TestBase): script = 'a = valobj.GetChildMemberWithName(\'integer\'); a_val = a.GetValue(); str = \'Hello from Python, \' + a_val + \' time\'; return str + (\'!\' if a_val == \'1\' else \'s!\');' self.runCmd("type summary add i_am_cool --python-script \"%s\"" % script) + self.expect('type summary list i_am_cool', substrs=[script]) self.expect("frame variable one", substrs = ['Hello from Python', diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/Makefile index b438bbb970f6..a92cffcc319b 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/Makefile +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/Makefile @@ -1,6 +1,7 @@ LEVEL = ../../../make CXX_SOURCES := main.cpp +USE_LIBSTDCPP := 1 # clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD # targets. Other targets do not, which causes this test to fail. @@ -12,8 +13,3 @@ endif include $(LEVEL)/Makefile.rules CXXFLAGS += -O0 - -ifeq (,$(findstring gcc,$(CC))) -CXXFLAGS += -stdlib=libstdc++ -LDFLAGS += -stdlib=libstdc++ -endif diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py index 38e700812d05..c186f1465cf5 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py @@ -8,15 +8,16 @@ from __future__ import print_function import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class SkipSummaryDataFormatterTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - @expectedFailureFreeBSD("llvm.org/pr20548") # fails to build on lab.llvm.org buildbot - @expectedFailureWindows("llvm.org/pr24462") # Data formatters have problems on Windows + @expectedFailureAll(oslist=['freebsd'], bugnumber="llvm.org/pr20548 fails to build on lab.llvm.org buildbot") + @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24462, Data formatters have problems on Windows") def test_with_run_command(self): """Test data formatter commands.""" self.build() diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py index ca8858dbad9b..b3f8ba7d048e 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py @@ -8,14 +8,15 @@ from __future__ import print_function import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class SmartArrayDataFormatterTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - @expectedFailureWindows("llvm.org/pr24462") # Data formatters have problems on Windows + @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24462, Data formatters have problems on Windows") def test_with_run_command(self): """Test data formatter commands.""" self.build() @@ -35,6 +36,8 @@ class SmartArrayDataFormatterTestCase(TestBase): self.runCmd("run", RUN_SUCCEEDED) + process = self.dbg.GetSelectedTarget().GetProcess() + # The stop reason of the thread should be breakpoint. self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, substrs = ['stopped', @@ -310,39 +313,81 @@ class SmartArrayDataFormatterTestCase(TestBase): self.runCmd("type summary add --summary-string \"arr = ${var%y}\" \"float [7]\"") self.runCmd("type summary add --summary-string \"arr = ${var%y}\" \"int [5]\"") - self.expect("frame variable flarr", - substrs = ['flarr = arr =', - '00 00 9d 42,00 80 9a 42,00 00 9c 42,00 40 98 42,00 80 99 42,00 c0 99 42,00 00 9a 42']) - - self.expect("frame variable other.flarr", - substrs = ['flarr = arr =', - '00 00 cc 41,00 00 ca 41,00 00 c9 41,00 00 d6 41,00 00 db 41,00 00 dc 41,00 00 d1 41']) - - self.expect("frame variable intarr", - substrs = ['intarr = arr =', - '01 00 00 00,01 00 00 00,02 00 00 00,03 00 00 00,05 00 00 00']) - - self.expect("frame variable other.intarr", - substrs = ['intarr = arr = ', - '09 00 00 00,08 00 00 00,07 00 00 00,06 00 00 00,05 00 00 00']) + if process.GetByteOrder() == lldb.eByteOrderLittle: + self.expect("frame variable flarr", + substrs = ['flarr = arr =', + '00 00 9d 42,00 80 9a 42,00 00 9c 42,00 40 98 42,00 80 99 42,00 c0 99 42,00 00 9a 42']) + else: + self.expect("frame variable flarr", + substrs = ['flarr = arr =', + '42 9d 00 00,42 9a 80 00,42 9c 00 00,42 98 40 00,42 99 80 00,42 99 c0 00,42 9a 00 00']) + + if process.GetByteOrder() == lldb.eByteOrderLittle: + self.expect("frame variable other.flarr", + substrs = ['flarr = arr =', + '00 00 cc 41,00 00 ca 41,00 00 c9 41,00 00 d6 41,00 00 db 41,00 00 dc 41,00 00 d1 41']) + else: + self.expect("frame variable other.flarr", + substrs = ['flarr = arr =', + '41 cc 00 00,41 ca 00 00,41 c9 00 00,41 d6 00 00,41 db 00 00,41 dc 00 00,41 d1 00 00']) + + if process.GetByteOrder() == lldb.eByteOrderLittle: + self.expect("frame variable intarr", + substrs = ['intarr = arr =', + '01 00 00 00,01 00 00 00,02 00 00 00,03 00 00 00,05 00 00 00']) + else: + self.expect("frame variable intarr", + substrs = ['intarr = arr =', + '00 00 00 01,00 00 00 01,00 00 00 02,00 00 00 03,00 00 00 05']) + + if process.GetByteOrder() == lldb.eByteOrderLittle: + self.expect("frame variable other.intarr", + substrs = ['intarr = arr = ', + '09 00 00 00,08 00 00 00,07 00 00 00,06 00 00 00,05 00 00 00']) + else: + self.expect("frame variable other.intarr", + substrs = ['intarr = arr = ', + '00 00 00 09,00 00 00 08,00 00 00 07,00 00 00 06,00 00 00 05']) self.runCmd("type summary add --summary-string \"arr = ${var%Y}\" \"float [7]\"") self.runCmd("type summary add --summary-string \"arr = ${var%Y}\" \"int [5]\"") - self.expect("frame variable flarr", - substrs = ['flarr = arr =', - '00 00 9d 42 ...B,00 80 9a 42 ...B,00 00 9c 42 ...B,00 40 98 42 .@.B,00 80 99 42 ...B,00 c0 99 42 ...B,00 00 9a 42 ...B']) - - self.expect("frame variable other.flarr", - substrs = ['flarr = arr =', - '00 00 cc 41 ...A,00 00 ca 41 ...A,00 00 c9 41 ...A,00 00 d6 41 ...A,00 00 db 41 ...A,00 00 dc 41 ...A,00 00 d1 41 ...A']) - - self.expect("frame variable intarr", - substrs = ['intarr = arr =', - '....,01 00 00 00', - '....,05 00 00 00']) - - self.expect("frame variable other.intarr", - substrs = ['intarr = arr = ', - '09 00 00 00', - '....,07 00 00 00']) + if process.GetByteOrder() == lldb.eByteOrderLittle: + self.expect("frame variable flarr", + substrs = ['flarr = arr =', + '00 00 9d 42 ...B,00 80 9a 42 ...B,00 00 9c 42 ...B,00 40 98 42 .@.B,00 80 99 42 ...B,00 c0 99 42 ...B,00 00 9a 42 ...B']) + else: + self.expect("frame variable flarr", + substrs = ['flarr = arr =', + '42 9d 00 00 B...,42 9a 80 00 B...,42 9c 00 00 B...,42 98 40 00 B.@.,42 99 80 00 B...,42 99 c0 00 B...,42 9a 00 00 B...']) + + if process.GetByteOrder() == lldb.eByteOrderLittle: + self.expect("frame variable other.flarr", + substrs = ['flarr = arr =', + '00 00 cc 41 ...A,00 00 ca 41 ...A,00 00 c9 41 ...A,00 00 d6 41 ...A,00 00 db 41 ...A,00 00 dc 41 ...A,00 00 d1 41 ...A']) + else: + self.expect("frame variable other.flarr", + substrs = ['flarr = arr =', + '41 cc 00 00 A...,41 ca 00 00 A...,41 c9 00 00 A...,41 d6 00 00 A...,41 db 00 00 A...,41 dc 00 00 A...,41 d1 00 00 A...']) + + if process.GetByteOrder() == lldb.eByteOrderLittle: + self.expect("frame variable intarr", + substrs = ['intarr = arr =', + '....,01 00 00 00', + '....,05 00 00 00']) + else: + self.expect("frame variable intarr", + substrs = ['intarr = arr =', + '....,00 00 00 01', + '....,00 00 00 05']) + + if process.GetByteOrder() == lldb.eByteOrderLittle: + self.expect("frame variable other.intarr", + substrs = ['intarr = arr = ', + '09 00 00 00', + '....,07 00 00 00']) + else: + self.expect("frame variable other.intarr", + substrs = ['intarr = arr = ', + '00 00 00 09', + '....,00 00 00 07']) diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/Makefile new file mode 100644 index 000000000000..fdd717119d95 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/Makefile @@ -0,0 +1,5 @@ +LEVEL = ../../../../../make +CXX_SOURCES := main.cpp +CXXFLAGS += -std=c++11 +USE_LIBCPP := 1 +include $(LEVEL)/Makefile.rules diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py new file mode 100644 index 000000000000..083f713c259d --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py @@ -0,0 +1,52 @@ +""" +Test lldb data formatter subsystem. +""" + +from __future__ import print_function + + + +import os, time +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + +class LibCxxAtomicTestCase(TestBase): + + mydir = TestBase.compute_mydir(__file__) + + def get_variable(self, name): + var = self.frame().FindVariable(name) + var.SetPreferDynamicValue(lldb.eDynamicCanRunTarget) + var.SetPreferSyntheticValue(True) + return var + + @skipIf(compiler="gcc") + @skipIfWindows # libc++ not ported to Windows yet + def test(self): + """Test that std::atomic as defined by libc++ is correctly printed by LLDB""" + self.build() + self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) + + bkpt = self.target().FindBreakpointByID(lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line.")) + + self.runCmd("run", RUN_SUCCEEDED) + + lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+")) + + # The stop reason of the thread should be breakpoint. + self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, + substrs = ['stopped', + 'stop reason = breakpoint']) + + s = self.get_variable('s') + i = self.get_variable('i') + + if self.TraceOn(): print(s) + if self.TraceOn(): print(i) + + self.assertTrue(i.GetValueAsUnsigned(0) == 5, "i == 5") + self.assertTrue(s.GetNumChildren() == 2, "s has two children") + self.assertTrue(s.GetChildAtIndex(0).GetValueAsUnsigned(0) == 1, "s.x == 1") + self.assertTrue(s.GetChildAtIndex(1).GetValueAsUnsigned(0) == 2, "s.y == 2") diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/main.cpp new file mode 100644 index 000000000000..0eb2418c628a --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/main.cpp @@ -0,0 +1,26 @@ +//===-- main.cpp --------------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include <atomic> + +struct S { + int x = 1; + int y = 2; +}; + +int main () +{ + std::atomic<S> s; + s.store(S()); + std::atomic<int> i; + i.store(5); + + return 0; // Set break point at this line. +} + diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py index e01f1b6679fc..d452c1be69bf 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py @@ -8,16 +8,17 @@ from __future__ import print_function import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class InitializerListTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @skipIfWindows # libc++ not ported to Windows yet - @skipIfGcc - @expectedFailureLinux # fails on clang 3.5 and tot + @skipIf(compiler="gcc") + @expectedFailureAll(oslist=["linux"], bugnumber="fails on clang 3.5 and tot") def test(self): """Test that that file and class static variables display correctly.""" self.build() diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py index a87a2ed2d434..23f6956cf3f0 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py @@ -8,8 +8,9 @@ from __future__ import print_function import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class LibcxxIteratorDataFormatterTestCase(TestBase): @@ -21,7 +22,7 @@ class LibcxxIteratorDataFormatterTestCase(TestBase): # Find the line number to break at. self.line = line_number('main.cpp', '// Set break point at this line.') - @skipIfGcc + @skipIf(compiler="gcc") @skipIfWindows # libc++ not ported to Windows yet def test_with_run_command(self): """Test that libc++ iterators format properly.""" diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py index 18ee31a86106..6fcdc37465db 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py @@ -8,8 +8,9 @@ from __future__ import print_function import os, time, re import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class LibcxxListDataFormatterTestCase(TestBase): @@ -24,8 +25,9 @@ class LibcxxListDataFormatterTestCase(TestBase): self.line3 = line_number('main.cpp', '// Set third break point at this line.') self.line4 = line_number('main.cpp', '// Set fourth break point at this line.') - @skipIfGcc + @skipIf(compiler="gcc") @skipIfWindows # libc++ not ported to Windows yet + @expectedFailureAll(oslist=["macosx"], bugnumber="rdar://25499635") def test_with_run_command(self): """Test that that file and class static variables display correctly.""" self.build() diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py index 167cb2b887af..9e68e1dbc004 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py @@ -9,16 +9,18 @@ from __future__ import print_function import os, time, re import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class LibcxxListDataFormatterTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - @skipIfGcc + @skipIf(compiler="gcc") @skipIfWindows # libc++ not ported to Windows yet @add_test_categories(["pyapi"]) + @skipIfDarwin # rdar://25499635 def test_with_run_command(self): self.build() exe = os.path.join(os.getcwd(), "a.out") diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py index 70a98f9c2cae..cecc3178b318 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py @@ -8,14 +8,15 @@ from __future__ import print_function import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class LibcxxMapDataFormatterTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - @skipIfGcc + @skipIf(compiler="gcc") @skipIfWindows # libc++ not ported to Windows yet def test_with_run_command(self): """Test that that file and class static variables display correctly.""" diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py index d0ca73d3251d..eb74818c91f5 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py @@ -9,14 +9,16 @@ from __future__ import print_function import os, time import lldb from lldbsuite.test.lldbtest import * -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil class LibcxxMultiMapDataFormatterTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @skipIfWindows # libc++ not ported to Windows yet - @skipIfGcc + @skipIf(compiler="gcc") def test_with_run_command(self): """Test that that file and class static variables display correctly.""" self.build() diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py index 384f6130d0c0..cfdfd07ddec1 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py @@ -8,14 +8,15 @@ from __future__ import print_function import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class LibcxxMultiSetDataFormatterTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - @skipIfGcc + @skipIf(compiler="gcc") @skipIfWindows # libc++ not ported to Windows yet def test_with_run_command(self): """Test that that file and class static variables display correctly.""" diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py index fcbfb0a8f0ed..00c1e548cf6b 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py @@ -8,62 +8,63 @@ from __future__ import print_function import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class LibcxxSetDataFormatterTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - @skipIfGcc + @skipIf(compiler="gcc") @skipIfWindows # libc++ not ported to Windows yet def test_with_run_command(self): """Test that that file and class static variables display correctly.""" self.build() self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) - bkpt = self.target().FindBreakpointByID(lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line.")) +# bkpt = self.target().FindBreakpointByID(lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line.")) self.runCmd("run", RUN_SUCCEEDED) - lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+")) - - # The stop reason of the thread should be breakpoint. - self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, - substrs = ['stopped', - 'stop reason = breakpoint']) - - # This is the function to remove the custom formats in order to have a - # clean slate for the next test case. - def cleanup(): - self.runCmd('type format clear', check=False) - self.runCmd('type summary clear', check=False) - self.runCmd('type filter clear', check=False) - self.runCmd('type synth clear', check=False) - self.runCmd("settings set target.max-children-count 256", check=False) - - # Execute the cleanup function during test case tear down. - self.addTearDownHook(cleanup) - - self.expect('image list', substrs = self.getLibcPlusPlusLibs()) - - self.expect("frame variable ii",substrs = ["size=0","{}"]) - lldbutil.continue_to_breakpoint(self.process(), bkpt) - self.expect("frame variable ii",substrs = ["size=6","[0] = 0","[1] = 1", "[2] = 2", "[3] = 3", "[4] = 4", "[5] = 5"]) - lldbutil.continue_to_breakpoint(self.process(), bkpt) - self.expect("frame variable ii",substrs = ["size=7","[2] = 2", "[3] = 3", "[6] = 6"]) - self.expect("frame variable ii[2]",substrs = [" = 2"]) - self.expect("p ii",substrs = ["size=7","[2] = 2", "[3] = 3", "[6] = 6"]) - lldbutil.continue_to_breakpoint(self.process(), bkpt) - self.expect("frame variable ii",substrs = ["size=0","{}"]) - lldbutil.continue_to_breakpoint(self.process(), bkpt) - self.expect("frame variable ii",substrs = ["size=0","{}"]) - self.expect("frame variable ss",substrs = ["size=0","{}"]) - lldbutil.continue_to_breakpoint(self.process(), bkpt) - self.expect("frame variable ss",substrs = ["size=2",'[0] = "a"','[1] = "a very long string is right here"']) - lldbutil.continue_to_breakpoint(self.process(), bkpt) - self.expect("frame variable ss",substrs = ["size=4",'[2] = "b"','[3] = "c"','[0] = "a"','[1] = "a very long string is right here"']) - self.expect("p ss",substrs = ["size=4",'[2] = "b"','[3] = "c"','[0] = "a"','[1] = "a very long string is right here"']) - self.expect("frame variable ss[2]",substrs = [' = "b"']) - lldbutil.continue_to_breakpoint(self.process(), bkpt) - self.expect("frame variable ss",substrs = ["size=3",'[0] = "a"','[1] = "a very long string is right here"','[2] = "c"']) +# lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+")) +# +# # The stop reason of the thread should be breakpoint. +# self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, +# substrs = ['stopped', +# 'stop reason = breakpoint']) +# +# # This is the function to remove the custom formats in order to have a +# # clean slate for the next test case. +# def cleanup(): +# self.runCmd('type format clear', check=False) +# self.runCmd('type summary clear', check=False) +# self.runCmd('type filter clear', check=False) +# self.runCmd('type synth clear', check=False) +# self.runCmd("settings set target.max-children-count 256", check=False) +# +# # Execute the cleanup function during test case tear down. +# self.addTearDownHook(cleanup) +# +# self.expect('image list', substrs = self.getLibcPlusPlusLibs()) +# +# self.expect("frame variable ii",substrs = ["size=0","{}"]) +# lldbutil.continue_to_breakpoint(self.process(), bkpt) +# self.expect("frame variable ii",substrs = ["size=6","[0] = 0","[1] = 1", "[2] = 2", "[3] = 3", "[4] = 4", "[5] = 5"]) +# lldbutil.continue_to_breakpoint(self.process(), bkpt) +# self.expect("frame variable ii",substrs = ["size=7","[2] = 2", "[3] = 3", "[6] = 6"]) +# self.expect("frame variable ii[2]",substrs = [" = 2"]) +# self.expect("p ii",substrs = ["size=7","[2] = 2", "[3] = 3", "[6] = 6"]) +# lldbutil.continue_to_breakpoint(self.process(), bkpt) +# self.expect("frame variable ii",substrs = ["size=0","{}"]) +# lldbutil.continue_to_breakpoint(self.process(), bkpt) +# self.expect("frame variable ii",substrs = ["size=0","{}"]) +# self.expect("frame variable ss",substrs = ["size=0","{}"]) +# lldbutil.continue_to_breakpoint(self.process(), bkpt) +# self.expect("frame variable ss",substrs = ["size=2",'[0] = "a"','[1] = "a very long string is right here"']) +# lldbutil.continue_to_breakpoint(self.process(), bkpt) +# self.expect("frame variable ss",substrs = ["size=4",'[2] = "b"','[3] = "c"','[0] = "a"','[1] = "a very long string is right here"']) +# self.expect("p ss",substrs = ["size=4",'[2] = "b"','[3] = "c"','[0] = "a"','[1] = "a very long string is right here"']) +# self.expect("frame variable ss[2]",substrs = [' = "b"']) +# lldbutil.continue_to_breakpoint(self.process(), bkpt) +# self.expect("frame variable ss",substrs = ["size=3",'[0] = "a"','[1] = "a very long string is right here"','[2] = "c"']) diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py index 942124255f55..76eedb8c8919 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py @@ -9,8 +9,9 @@ from __future__ import print_function import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class LibcxxStringDataFormatterTestCase(TestBase): @@ -22,7 +23,7 @@ class LibcxxStringDataFormatterTestCase(TestBase): # Find the line number to break at. self.line = line_number('main.cpp', '// Set break point at this line.') - @skipIfGcc + @skipIf(compiler="gcc") @skipIfWindows # libc++ not ported to Windows yet def test_with_run_command(self): """Test that that file and class static variables display correctly.""" diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py index 5e6ec2519323..4765cd70f67c 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py @@ -8,15 +8,16 @@ from __future__ import print_function import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class LibcxxUnorderedDataFormatterTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @skipIfWindows # libc++ not ported to Windows yet - @skipIfGcc + @skipIf(compiler="gcc") def test_with_run_command(self): """Test that that file and class static variables display correctly.""" self.build() @@ -72,4 +73,5 @@ class LibcxxUnorderedDataFormatterTestCase(TestBase): def look_for_content_and_continue(self, var_name, patterns): self.expect( ("frame variable %s" % var_name), patterns=patterns) + self.expect( ("frame variable %s" % var_name), patterns=patterns) self.runCmd("continue") diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py index 9771a819aa6b..fe3b6c115e31 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py @@ -8,8 +8,9 @@ from __future__ import print_function import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class LibcxxVBoolDataFormatterTestCase(TestBase): @@ -21,7 +22,7 @@ class LibcxxVBoolDataFormatterTestCase(TestBase): # Find the line number to break at. self.line = line_number('main.cpp', '// Set break point at this line.') - @skipIfGcc + @skipIf(compiler="gcc") @skipIfWindows # libc++ not ported to Windows. def test_with_run_command(self): """Test that that file and class static variables display correctly.""" diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py index f8cd65be0931..9a145fba73e8 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py @@ -8,14 +8,15 @@ from __future__ import print_function import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class LibcxxVectorDataFormatterTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - @skipIfGcc + @skipIf(compiler="gcc") @skipIfWindows # libc++ not ported to Windows yet def test_with_run_command(self): """Test that that file and class static variables display correctly.""" diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py index 6742c9e71701..dbaa37daa2d1 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py @@ -8,8 +8,9 @@ from __future__ import print_function import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class StdIteratorDataFormatterTestCase(TestBase): @@ -22,7 +23,7 @@ class StdIteratorDataFormatterTestCase(TestBase): self.line = line_number('main.cpp', '// Set break point at this line.') @skipIfWindows # libstdcpp not ported to Windows - @expectedFailureIcc # llvm.org/pr15301 LLDB prints incorrect sizes of STL containers + @expectedFailureAll(compiler="icc", bugnumber="llvm.org/pr15301 LLDB prints incorrect sizes of STL containers") def test_with_run_command(self): """Test that libstdcpp iterators format properly.""" self.build() diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py index 5147d18da0fe..55658af1f2a3 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py @@ -8,8 +8,9 @@ from __future__ import print_function import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class StdListDataFormatterTestCase(TestBase): diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py index e21c4e94c2c4..ff99255aec0c 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py @@ -8,8 +8,9 @@ from __future__ import print_function import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class StdMapDataFormatterTestCase(TestBase): @@ -21,7 +22,7 @@ class StdMapDataFormatterTestCase(TestBase): # Find the line number to break at. self.line = line_number('main.cpp', '// Set break point at this line.') - @expectedFailureIcc # llvm.org/pr15301: LLDB prints incorrect size of libstdc++ containers + @expectedFailureAll(compiler="icc", bugnumber="llvm.org/pr15301 LLDB prints incorrect sizes of STL containers") @skipIfWindows # libstdcpp not ported to Windows @skipIfFreeBSD def test_with_run_command(self): diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/Makefile new file mode 100644 index 000000000000..88cb026aba1c --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/Makefile @@ -0,0 +1,15 @@ +LEVEL = ../../../../../make + +CXX_SOURCES := main.cpp + +CXXFLAGS := -O0 +USE_LIBSTDCPP := 1 + +# clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD +# targets. Other targets do not, which causes this test to fail. +# This flag enables FullDebugInfo for all targets. +ifneq (,$(findstring clang,$(CC))) + CFLAGS_EXTRAS += -fno-limit-debug-info +endif + +include $(LEVEL)/Makefile.rules diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py new file mode 100644 index 000000000000..20b1a3d21156 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py @@ -0,0 +1,46 @@ +""" +Test lldb data formatter subsystem. +""" + +from __future__ import print_function + +import os, time +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + +class StdSmartPtrDataFormatterTestCase(TestBase): + mydir = TestBase.compute_mydir(__file__) + + @skipIfFreeBSD + @skipIfWindows # libstdcpp not ported to Windows + @skipIfDarwin # doesn't compile on Darwin + def test_with_run_command(self): + self.build() + self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) + + lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line.") + self.runCmd("run", RUN_SUCCEEDED) + + # The stop reason of the thread should be breakpoint. + self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, + substrs = ['stopped', 'stop reason = breakpoint']) + + self.expect("frame variable nsp", substrs = ['nsp = nullptr']) + self.expect("frame variable isp", substrs = ['isp = 123']) + self.expect("frame variable ssp", substrs = ['ssp = "foobar"']) + + self.expect("frame variable nwp", substrs = ['nwp = nullptr']) + self.expect("frame variable iwp", substrs = ['iwp = 123']) + self.expect("frame variable swp", substrs = ['swp = "foobar"']) + + self.runCmd("continue") + + self.expect("frame variable nsp", substrs = ['nsp = nullptr']) + self.expect("frame variable isp", substrs = ['isp = nullptr']) + self.expect("frame variable ssp", substrs = ['ssp = nullptr']) + + self.expect("frame variable nwp", substrs = ['nwp = nullptr']) + self.expect("frame variable iwp", substrs = ['iwp = nullptr']) + self.expect("frame variable swp", substrs = ['swp = nullptr']) diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/main.cpp new file mode 100644 index 000000000000..7ba50875a6db --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/main.cpp @@ -0,0 +1,20 @@ +#include <memory> +#include <string> + +int +main() +{ + std::shared_ptr<char> nsp; + std::shared_ptr<int> isp(new int{123}); + std::shared_ptr<std::string> ssp = std::make_shared<std::string>("foobar"); + + std::weak_ptr<char> nwp; + std::weak_ptr<int> iwp = isp; + std::weak_ptr<std::string> swp = ssp; + + nsp.reset(); // Set break point at this line. + isp.reset(); + ssp.reset(); + + return 0; // Set break point at this line. +} diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py index 2d6af24c6afc..fde2f791183a 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py @@ -9,8 +9,9 @@ from __future__ import print_function import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class StdStringDataFormatterTestCase(TestBase): diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py index 9e73009aba83..f5cf7c04c3a7 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py @@ -8,8 +8,9 @@ from __future__ import print_function import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class StdVBoolDataFormatterTestCase(TestBase): @@ -21,8 +22,8 @@ class StdVBoolDataFormatterTestCase(TestBase): # Find the line number to break at. self.line = line_number('main.cpp', '// Set break point at this line.') - @expectedFailureFreeBSD("llvm.org/pr20548") # fails to build on lab.llvm.org buildbot - @expectedFailureIcc # llvm.org/pr15301: lldb does not print the correct sizes of STL containers when building with ICC + @expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr20548 fails to build on lab.llvm.org buildbot') + @expectedFailureAll(compiler="icc", bugnumber="llvm.org/pr15301 LLDB prints incorrect sizes of STL containers") @skipIfWindows # libstdcpp not ported to Windows. @skipIfDarwin def test_with_run_command(self): diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py index ed4313657e93..4a352ef41c17 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py @@ -8,8 +8,9 @@ from __future__ import print_function import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class StdVectorDataFormatterTestCase(TestBase): @@ -22,7 +23,7 @@ class StdVectorDataFormatterTestCase(TestBase): self.line = line_number('main.cpp', '// Set break point at this line.') @skipIfFreeBSD - @expectedFailureIcc # llvm.org/pr15301 LLDB prints incorrect sizes of STL containers + @expectedFailureAll(compiler="icc", bugnumber="llvm.org/pr15301 LLDB prints incorrect sizes of STL containers") @skipIfWindows # libstdcpp not ported to Windows def test_with_run_command(self): """Test that that file and class static variables display correctly.""" diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/Makefile new file mode 100644 index 000000000000..314f1cb2f077 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/Makefile @@ -0,0 +1,5 @@ +LEVEL = ../../../make + +CXX_SOURCES := main.cpp + +include $(LEVEL)/Makefile.rules diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/TestDataFormatterSynthType.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/TestDataFormatterSynthType.py new file mode 100644 index 000000000000..6a03456e5c32 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/TestDataFormatterSynthType.py @@ -0,0 +1,56 @@ +""" +Test lldb data formatter subsystem. +""" + +from __future__ import print_function + + + +import os, time +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + +class DataFormatterSynthTypeTestCase(TestBase): + + mydir = TestBase.compute_mydir(__file__) + + def setUp(self): + # Call super's setUp(). + TestBase.setUp(self) + # Find the line number to break at. + self.line = line_number('main.cpp', 'break here') + + @skipIfFreeBSD # llvm.org/pr20545 bogus output confuses buildbot parser + def test_with_run_command(self): + """Test using Python synthetic children provider to provide a typename.""" + self.build() + self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) + + lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True) + + self.runCmd("run", RUN_SUCCEEDED) + + # The stop reason of the thread should be breakpoint. + self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, + substrs = ['stopped', + 'stop reason = breakpoint']) + + # This is the function to remove the custom formats in order to have a + # clean slate for the next test case. + def cleanup(): + self.runCmd('type format clear', check=False) + self.runCmd('type summary clear', check=False) + self.runCmd('type filter clear', check=False) + self.runCmd('type synth clear', check=False) + + # Execute the cleanup function during test case tear down. + self.addTearDownHook(cleanup) + + self.runCmd("script from myIntSynthProvider import *") + self.runCmd("type synth add -l myIntSynthProvider myInt") + + self.expect('frame variable x', substrs=['ThisTestPasses']) + self.expect('frame variable y', substrs=['ThisTestPasses']) + self.expect('frame variable z', substrs=['ThisTestPasses']) diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/main.cpp new file mode 100644 index 000000000000..accbf0a5a578 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/main.cpp @@ -0,0 +1,29 @@ +class myInt { + private: int theValue; + public: myInt() : theValue(0) {} + public: myInt(int _x) : theValue(_x) {} + int val() { return theValue; } +}; + +class myArray { +public: + int array[16]; +}; + +class hasAnInt { + public: + myInt theInt; + hasAnInt() : theInt(42) {} +}; + +myInt operator + (myInt x, myInt y) { return myInt(x.val() + y.val()); } + +int main() { + myInt x{3}; + myInt y{4}; + myInt z {x+y}; + hasAnInt hi; + myArray ma; + + return z.val(); // break here +} diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/myIntSynthProvider.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/myIntSynthProvider.py new file mode 100644 index 000000000000..42737140b112 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/myIntSynthProvider.py @@ -0,0 +1,36 @@ +class myIntSynthProvider(object): + def __init__(self, valobj, dict): + self.valobj = valobj; + self.val = self.valobj.GetChildMemberWithName("theValue") + def num_children(self): + return 0; + def get_child_at_index(self, index): + return None + def get_child_index(self, name): + return None + def update(self): + return False + def has_children(self): + return False + def get_type_name(self): + return "ThisTestPasses" + + +class myArraySynthProvider(object): + def __init__(self, valobj, dict): + self.valobj = valobj + self.array = self.valobj.GetChildMemberWithName("array") + + def num_children(self, max_count): + if 16 < max_count: + return 16 + return max_count + + def get_child_at_index(self, index): + return None # Keep it simple when this is not tested here. + + def get_child_index(self, name): + return None # Keep it simple when this is not tested here. + + def has_children(self): + return True diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py index 8d6e5df37a5c..e7a34647a6de 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py @@ -8,8 +8,9 @@ from __future__ import print_function import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class DataFormatterSynthValueTestCase(TestBase): @@ -22,7 +23,7 @@ class DataFormatterSynthValueTestCase(TestBase): self.line = line_number('main.cpp', 'break here') @skipIfFreeBSD # llvm.org/pr20545 bogus output confuses buildbot parser - @expectedFailureWindows("llvm.org/pr24462") # Data formatters have problems on Windows + @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24462, Data formatters have problems on Windows") def test_with_run_command(self): """Test using Python synthetic children provider to provide a value.""" self.build() diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/dump_dynamic/TestDumpDynamic.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/dump_dynamic/TestDumpDynamic.py index 8ae09d691940..886d09fda456 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/dump_dynamic/TestDumpDynamic.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/dump_dynamic/TestDumpDynamic.py @@ -2,4 +2,4 @@ from __future__ import absolute_import from lldbsuite.test import lldbinline -lldbinline.MakeInlineTest(__file__, globals(), [lldbinline.expectedFailureWindows("llvm.org/pr24663")]) +lldbinline.MakeInlineTest(__file__, globals(), [lldbinline.expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24663")]) diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py index a12f9c841a7f..871cc19373a4 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py @@ -6,11 +6,12 @@ from __future__ import print_function +import datetime import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import datetime -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class NSArraySyntheticTestCase(TestBase): diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py index 13d493ecbdcc..5ee54c3a2952 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py @@ -6,11 +6,12 @@ from __future__ import print_function +import datetime import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import datetime -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class NSDictionarySyntheticTestCase(TestBase): diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py index 6c558001bb04..d1680434d3b9 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py @@ -6,11 +6,12 @@ from __future__ import print_function +import datetime import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import datetime -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class NSSetSyntheticTestCase(TestBase): diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py index 4fb6176e9e4f..4158ec8a661c 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py @@ -6,11 +6,12 @@ from __future__ import print_function +import datetime import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import datetime -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class DataFormatterOSTypeTestCase(TestBase): diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/parray/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/parray/Makefile new file mode 100644 index 000000000000..314f1cb2f077 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/parray/Makefile @@ -0,0 +1,5 @@ +LEVEL = ../../../make + +CXX_SOURCES := main.cpp + +include $(LEVEL)/Makefile.rules diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/parray/TestPrintArray.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/parray/TestPrintArray.py new file mode 100644 index 000000000000..700b7418118a --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/parray/TestPrintArray.py @@ -0,0 +1,70 @@ +""" +Test lldb data formatter subsystem. +""" + +from __future__ import print_function + + + +import datetime +import os, time +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + +class PrintArrayTestCase(TestBase): + + mydir = TestBase.compute_mydir(__file__) + + def test_print_array(self): + """Test that expr -Z works""" + self.build() + self.printarray_data_formatter_commands() + + def setUp(self): + # Call super's setUp(). + TestBase.setUp(self) + # Find the line number to break at. + self.line = line_number('main.cpp', 'break here') + + def printarray_data_formatter_commands(self): + """Test that expr -Z works""" + self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) + + lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True) + + self.runCmd("run", RUN_SUCCEEDED) + + # The stop reason of the thread should be breakpoint. + self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, + substrs = ['stopped', + 'stop reason = breakpoint']) + + # This is the function to remove the custom formats in order to have a + # clean slate for the next test case. + def cleanup(): + self.runCmd('type format clear', check=False) + self.runCmd('type summary clear', check=False) + self.runCmd('type synth clear', check=False) + + # Execute the cleanup function during test case tear down. + self.addTearDownHook(cleanup) + + self.expect('expr --element-count 3 -- data', substrs=['[0] = 1', '[1] = 3', '[2] = 5']) + self.expect('expr data', substrs=['int *', '$', '0x']) + self.expect('expr -f binary --element-count 0 -- data', substrs=['int *', '$', '0b']) + self.expect('expr -f hex --element-count 3 -- data', substrs=['[0] = 0x', '1', '[1] = 0x', '3', '[2] = 0x', '5']) + self.expect('expr -f binary --element-count 2 -- data', substrs=['int *', '$', '0x', '[0] = 0b', '1', '[1] = 0b', '11']) + self.expect('parray 3 data', substrs=['[0] = 1', '[1] = 3', '[2] = 5']) + self.expect('parray `1 + 1 + 1` data', substrs=['[0] = 1', '[1] = 3', '[2] = 5']) + self.expect('parray `data[1]` data', substrs=['[0] = 1', '[1] = 3', '[2] = 5']) + self.expect('parray/x 3 data', substrs=['[0] = 0x', '1', '[1] = 0x', '3', '[2] = 0x', '5']) + self.expect('parray/x `data[1]` data', substrs=['[0] = 0x', '1', '[1] = 0x', '3', '[2] = 0x', '5']) + + # check error conditions + self.expect('expr --element-count 10 -- 123', error=True, substrs=['expression cannot be used with --element-count as it does not refer to a pointer']) + self.expect('expr --element-count 10 -- (void*)123', error=True, substrs=['expression cannot be used with --element-count as it refers to a pointer to void']) + self.expect('parray data', error=True, substrs=["invalid element count 'data'"]) + self.expect('parray data data', error=True, substrs=["invalid element count 'data'"]) + self.expect('parray', error=True, substrs=['Not enough arguments provided']) diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/parray/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/parray/main.cpp new file mode 100644 index 000000000000..b2d6309947ad --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/parray/main.cpp @@ -0,0 +1,29 @@ +//===-- main.cpp -------------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include <functional> +#include <stdlib.h> + +template<typename ElemType> +ElemType* alloc(size_t count, std::function<ElemType(size_t)> get) +{ + ElemType *elems = new ElemType[count]; + for(size_t i = 0; i < count; i++) + elems[i] = get(i); + return elems; +} + +int main (int argc, const char * argv[]) +{ + int* data = alloc<int>(5, [] (size_t idx) -> int { + return 2 * idx + 1; + }); + return 0; // break here +} + diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/Makefile new file mode 100644 index 000000000000..261658b10ae8 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/Makefile @@ -0,0 +1,9 @@ +LEVEL = ../../../make + +OBJCXX_SOURCES := main.mm + +CFLAGS_EXTRAS += -w + +include $(LEVEL)/Makefile.rules + +LDFLAGS += -framework Foundation diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/TestPrintObjectArray.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/TestPrintObjectArray.py new file mode 100644 index 000000000000..7eb26a569867 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/TestPrintObjectArray.py @@ -0,0 +1,60 @@ +""" +Test lldb data formatter subsystem. +""" + +from __future__ import print_function + + + +import datetime +import os, time +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + +class PrintObjectArrayTestCase(TestBase): + + mydir = TestBase.compute_mydir(__file__) + + @skipUnlessDarwin + def test_print_array(self): + """Test that expr -O -Z works""" + self.build() + self.printarray_data_formatter_commands() + + def setUp(self): + # Call super's setUp(). + TestBase.setUp(self) + # Find the line number to break at. + self.line = line_number('main.mm', 'break here') + + def printarray_data_formatter_commands(self): + """Test that expr -O -Z works""" + self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) + + lldbutil.run_break_set_by_file_and_line (self, "main.mm", self.line, num_expected_locations=1, loc_exact=True) + + self.runCmd("run", RUN_SUCCEEDED) + + # The stop reason of the thread should be breakpoint. + self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, + substrs = ['stopped', + 'stop reason = breakpoint']) + + # This is the function to remove the custom formats in order to have a + # clean slate for the next test case. + def cleanup(): + self.runCmd('type format clear', check=False) + self.runCmd('type summary clear', check=False) + self.runCmd('type synth clear', check=False) + + # Execute the cleanup function during test case tear down. + self.addTearDownHook(cleanup) + + self.expect('expr --element-count 3 --object-description -- objects', substrs=['3735928559', '4276993775', '3203398366', 'Hello', 'World', 'Two =', '1 =']) + self.expect('poarray 3 objects', substrs=['3735928559', '4276993775', '3203398366', 'Hello', 'World', 'Two =', '1 =']) + self.expect('expr --element-count 3 --object-description --description-verbosity=full -- objects', substrs=['[0] =', '3735928559', '4276993775', '3203398366', '[1] =', 'Hello', 'World', '[2] =', 'Two =', '1 =']) + self.expect('parray 3 objects', substrs=['[0] = 0x', '[1] = 0x', '[2] = 0x']) + self.expect('expr --element-count 3 -d run -- objects', substrs=['3 elements', '2 elements', '2 key/value pairs']) + self.expect('expr --element-count 3 -d run --ptr-depth=1 -- objects', substrs=['3 elements', '2 elements', '2 key/value pairs', '3735928559', '4276993775', '3203398366', '"Hello"', '"World"']) diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/main.mm b/packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/main.mm new file mode 100644 index 000000000000..9ef61e6a73f2 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/main.mm @@ -0,0 +1,30 @@ +//===-- main.cpp -------------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#import <Foundation/Foundation.h> + +struct ThreeObjects +{ + id one; + id two; + id three; +}; + +int main() +{ + NSArray *array1 = @[@0xDEADBEEF, @0xFEEDBEEF, @0xBEEFFADE]; + NSArray *array2 = @[@"Hello", @"World"]; + NSDictionary *dictionary = @{@1: array2, @"Two": array2}; + ThreeObjects *tobjects = new ThreeObjects(); + tobjects->one = array1; + tobjects->two = array2; + tobjects->three = dictionary; + id* objects = (id*)tobjects; + return 0; // break here +} diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/setvaluefromcstring/TestSetValueFromCString.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/setvaluefromcstring/TestSetValueFromCString.py index 80305e303d03..791ce27dad00 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/setvaluefromcstring/TestSetValueFromCString.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/setvaluefromcstring/TestSetValueFromCString.py @@ -1,4 +1,4 @@ -import lldbsuite.test.lldbinline as lldbinline -import lldbsuite.test.lldbtest as lldbtest +from lldbsuite.test import lldbinline +from lldbsuite.test import decorators -lldbinline.MakeInlineTest(__file__, globals(), [lldbtest.skipIfFreeBSD,lldbtest.skipIfLinux,lldbtest.skipIfWindows]) +lldbinline.MakeInlineTest(__file__, globals(), [decorators.skipIfFreeBSD,decorators.skipIfLinux,decorators.skipIfWindows]) diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/stringprinter/TestStringPrinter.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/stringprinter/TestStringPrinter.py index 69f7d48c8b6c..e26344f2711a 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/stringprinter/TestStringPrinter.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/stringprinter/TestStringPrinter.py @@ -1,4 +1,4 @@ -import lldbsuite.test.lldbinline as lldbinline -import lldbsuite.test.lldbtest as lldbtest +from lldbsuite.test import lldbinline +from lldbsuite.test import decorators -lldbinline.MakeInlineTest(__file__, globals(), [lldbtest.expectedFailureWindows("llvm.org/pr24772")]) +lldbinline.MakeInlineTest(__file__, globals(), [decorators.expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24772")]) diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py index 0550f57ae62a..e8b6c1ad95f5 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py @@ -8,8 +8,9 @@ from __future__ import print_function import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class SyntheticCappingTestCase(TestBase): @@ -30,6 +31,8 @@ class SyntheticCappingTestCase(TestBase): self.runCmd("run", RUN_SUCCEEDED) + process = self.dbg.GetSelectedTarget().GetProcess() + # The stop reason of the thread should be breakpoint. self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, substrs = ['stopped', @@ -51,25 +54,31 @@ class SyntheticCappingTestCase(TestBase): self.runCmd("script from fooSynthProvider import *") self.runCmd("type synth add -l fooSynthProvider foo") + # note that the value of fake_a depends on target byte order + if process.GetByteOrder() == lldb.eByteOrderLittle: + fake_a_val = 0x02000000 + else: + fake_a_val = 0x00000100 + # check that the synthetic children work, so we know we are doing the right thing self.expect("frame variable f00_1", - substrs = ['r = 33', - 'fake_a = 16777216', - 'a = 0']); + substrs = ['r = 34', + 'fake_a = %d' % fake_a_val, + 'a = 1']); # check that capping works self.runCmd("settings set target.max-children-count 2", check=False) self.expect("frame variable f00_1", substrs = ['...', - 'fake_a = 16777216', - 'a = 0']); + 'fake_a = %d' % fake_a_val, + 'a = 1']); self.expect("frame variable f00_1", matching=False, - substrs = ['r = 33']); + substrs = ['r = 34']); self.runCmd("settings set target.max-children-count 256", check=False) self.expect("frame variable f00_1", matching=True, - substrs = ['r = 33']); + substrs = ['r = 34']); diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/fooSynthProvider.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/fooSynthProvider.py index fb95ac2b54d0..1a7e5679c0b8 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/fooSynthProvider.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/fooSynthProvider.py @@ -1,21 +1,21 @@ import lldb class fooSynthProvider: - def __init__(self, valobj, dict): - self.valobj = valobj; - self.int_type = valobj.GetType().GetBasicType(lldb.eBasicTypeInt) - def num_children(self): - return 3; - def get_child_at_index(self, index): - if index == 0: - child = self.valobj.GetChildMemberWithName('a'); - if index == 1: - child = self.valobj.CreateChildAtOffset ('fake_a', 1, self.int_type); - if index == 2: - child = self.valobj.GetChildMemberWithName('r'); - return child; - def get_child_index(self, name): - if name == 'a': - return 0; - if name == 'fake_a': - return 1; - return 2; + def __init__(self, valobj, dict): + self.valobj = valobj; + self.int_type = valobj.GetType().GetBasicType(lldb.eBasicTypeInt) + def num_children(self): + return 3; + def get_child_at_index(self, index): + if index == 0: + child = self.valobj.GetChildMemberWithName('a'); + if index == 1: + child = self.valobj.CreateChildAtOffset ('fake_a', 1, self.int_type); + if index == 2: + child = self.valobj.GetChildMemberWithName('r'); + return child; + def get_child_index(self, name): + if name == 'a': + return 0; + if name == 'fake_a': + return 1; + return 2; diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/main.cpp index b921915b91c5..fec7907e0031 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/main.cpp +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/main.cpp @@ -48,7 +48,7 @@ struct wrapint int main() { - foo f00_1(0); + foo f00_1(1); foo *f00_ptr = new foo(12); f00_1.a++; // Set break point at this line. diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py index 6b70a88b9f2c..23a31da685de 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py @@ -6,11 +6,12 @@ from __future__ import print_function +import datetime import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import datetime -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class SyntheticFilterRecomputingTestCase(TestBase): diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_arg/TestTypeSummaryListArg.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_arg/TestTypeSummaryListArg.py new file mode 100644 index 000000000000..6568056f761b --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_arg/TestTypeSummaryListArg.py @@ -0,0 +1,31 @@ +""" +Test lldb data formatter subsystem. +""" + +from __future__ import print_function + + + +import os, time +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + +class TypeSummaryListArgumentTestCase(TestBase): + + mydir = TestBase.compute_mydir(__file__) + + def setUp(self): + # Call super's setUp(). + TestBase.setUp(self) + + @no_debug_info_test + def test_type_summary_list_with_arg(self): + """Test that the 'type summary list' command handles command line arguments properly""" + self.expect('type summary list Foo', substrs=['Category: default', 'Category: system']) + self.expect('type summary list char', substrs=['char *', 'unsigned char']) + + self.expect('type summary list -w default', substrs=['system'], matching=False) + self.expect('type summary list -w system unsigned', substrs=['default', '0-9'], matching=False) + self.expect('type summary list -w system char', substrs=['unsigned char *'], matching=True) diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/Makefile new file mode 100644 index 000000000000..314f1cb2f077 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/Makefile @@ -0,0 +1,5 @@ +LEVEL = ../../../make + +CXX_SOURCES := main.cpp + +include $(LEVEL)/Makefile.rules diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/TestTypeSummaryListScript.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/TestTypeSummaryListScript.py new file mode 100644 index 000000000000..63a4a3a4ba8c --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/TestTypeSummaryListScript.py @@ -0,0 +1,61 @@ +""" +Test lldb data formatter subsystem. +""" + +from __future__ import print_function + + + +import os, time +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + +class TypeSummaryListScriptTestCase(TestBase): + + mydir = TestBase.compute_mydir(__file__) + + def test_typesummarylist_script(self): + """Test data formatter commands.""" + self.build() + self.data_formatter_commands() + + def setUp(self): + # Call super's setUp(). + TestBase.setUp(self) + # Find the line number to break at. + self.line = line_number('main.cpp', 'Break here') + + def data_formatter_commands(self): + """Test printing out Python summary formatters.""" + self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) + + lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True) + + self.runCmd("run", RUN_SUCCEEDED) + + # The stop reason of the thread should be breakpoint. + self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, + substrs = ['stopped', + 'stop reason = breakpoint']) + + # This is the function to remove the custom formats in order to have a + # clean slate for the next test case. + def cleanup(): + self.runCmd('type category delete TSLSFormatters', check=False) + self.runCmd('type format clear', check=False) + self.runCmd('type summary clear', check=False) + self.runCmd('type filter clear', check=False) + self.runCmd('type synth clear', check=False) + + self.addTearDownHook(cleanup) + + self.runCmd("command script import tslsformatters.py") + + self.expect("frame variable myStruct", substrs=['A data formatter at work']) + + self.expect('type summary list', substrs=['Struct_SummaryFormatter']) + self.expect('type summary list Struct', substrs=['Struct_SummaryFormatter']) + + diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/main.cpp new file mode 100644 index 000000000000..2de37041f263 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/main.cpp @@ -0,0 +1,15 @@ +#include <stdio.h> + +typedef struct Struct +{ + int one; + int two; +} Struct; + +int +main() +{ + Struct myStruct = {10, 20}; + printf ("Break here: %d\n.", myStruct.one); + return 0; +} diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/tslsformatters.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/tslsformatters.py new file mode 100644 index 000000000000..d1ce8b7db17a --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/tslsformatters.py @@ -0,0 +1,10 @@ +import lldb + +def Struct_SummaryFormatter(valobj, internal_dict): + return 'A data formatter at work' + +category = lldb.debugger.CreateCategory("TSLSFormatters") +category.SetEnabled(True) +summary = lldb.SBTypeSummary.CreateWithFunctionName("tslsformatters.Struct_SummaryFormatter", lldb.eTypeOptionCascade) +spec = lldb.SBTypeNameSpecifier("Struct", False) +category.AddTypeSummary(spec, summary) diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/typedef_array/TestTypedefArray.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/typedef_array/TestTypedefArray.py index 30b66e062827..41b8c3499ccd 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/typedef_array/TestTypedefArray.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/typedef_array/TestTypedefArray.py @@ -1,4 +1,4 @@ -import lldbsuite.test.lldbinline as lldbinline -import lldbsuite.test.lldbtest as lldbtest +from lldbsuite.test import lldbinline +from lldbsuite.test import decorators -lldbinline.MakeInlineTest(__file__, globals(), [lldbtest.expectedFailureGcc]) +lldbinline.MakeInlineTest(__file__, globals(), [decorators.expectedFailureAll(compiler="gcc")]) diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py index 4d060c332f93..f3eced625898 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py @@ -7,10 +7,11 @@ from __future__ import print_function import os, time +import os.path import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import lldbsuite.test.lldbutil as lldbutil -import os.path +from lldbsuite.test import lldbutil class PythonSynthDataFormatterTestCase(TestBase): diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py index 05899a24ad22..365ddff3c7e8 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py @@ -8,8 +8,9 @@ from __future__ import print_function import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class VectorTypesFormattingTestCase(TestBase): |