diff options
Diffstat (limited to 'lldb/test/functionalities/data-formatter/data-formatter-cpp')
-rw-r--r-- | lldb/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py | 31 | ||||
-rw-r--r-- | lldb/test/functionalities/data-formatter/data-formatter-cpp/main.cpp | 3 |
2 files changed, 33 insertions, 1 deletions
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py b/lldb/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py index 68eab1897bd..12f6b6d0ba9 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py @@ -73,7 +73,16 @@ class DataFormatterTestCase(TestBase): self.expect("frame variable", patterns = ['\(Speed\) SPILookHex = 0x[0-9a-f]+' # Speed should look hex-ish now. ]); - + + # gcc4.2 on Mac OS X skips typedef chains in the DWARF output + if self.getCompiler() in ['clang', 'llvm-gcc']: + self.expect("frame variable", + patterns = ['\(SignalMask\) SMILookHex = 0x[0-9a-f]+' # SignalMask should look hex-ish now. + ]); + self.expect("frame variable", matching=False, + patterns = ['\(Type4\) T4ILookChar = 0x[0-9a-f]+' # Type4 should NOT look hex-ish now. + ]); + # Now let's delete the 'Speed' custom format. self.runCmd("type format delete Speed") @@ -85,6 +94,26 @@ class DataFormatterTestCase(TestBase): self.expect("type format delete Speed", error=True, substrs = ['no custom format for Speed']) + self.runCmd("type summary add -f \"arr = ${var%s}\" -x \"char \\[[0-9]+\\]\" -v") + + self.expect("frame variable strarr", + substrs = ['arr = "Hello world!\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0"']) + + self.runCmd("type summary clear") + + self.runCmd("type summary add -f \"ptr = ${var%s}\" \"char *\" -v") + + self.expect("frame variable strptr", + substrs = ['ptr = "Hello world!"']) + + self.runCmd("type summary add -f \"arr = ${var%s}\" -x \"char \\[[0-9]+\\]\" -v") + + self.expect("frame variable strarr", + substrs = ['arr = "Hello world!\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0"']) + + self.expect("frame variable strptr", + substrs = ['ptr = "Hello world!"']) + self.runCmd("type summary add -c Point") self.expect("frame variable iAmSomewhere", diff --git a/lldb/test/functionalities/data-formatter/data-formatter-cpp/main.cpp b/lldb/test/functionalities/data-formatter/data-formatter-cpp/main.cpp index 20cdc2c900e..9224cb8a0a0 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-cpp/main.cpp +++ b/lldb/test/functionalities/data-formatter/data-formatter-cpp/main.cpp @@ -107,6 +107,9 @@ int main (int argc, const char * argv[]) int int_array[] = {1,2,3,4,5}; IUseCharStar iEncapsulateCharStar; + + char strarr[32] = "Hello world!"; + char* strptr = "Hello world!"; return 0; // Set break point at this line. } |