summaryrefslogtreecommitdiffstats
path: root/lldb/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
diff options
context:
space:
mode:
authorEnrico Granata <granata.enrico@gmail.com>2011-07-12 00:18:11 +0000
committerEnrico Granata <granata.enrico@gmail.com>2011-07-12 00:18:11 +0000
commitf9fa6ee5e37a32b73ee74c7e7c2fbe8201d13769 (patch)
treedfdcdcefeee47681937d3608f5a03a3439b25a03 /lldb/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
parent5fcf8da33dfb9a54f047718223ddba16a263f6c1 (diff)
downloadbcm5719-llvm-f9fa6ee5e37a32b73ee74c7e7c2fbe8201d13769.tar.gz
bcm5719-llvm-f9fa6ee5e37a32b73ee74c7e7c2fbe8201d13769.zip
named summaries:
- a new --name option for "type summary add" lets you give a name to a summary - a new --summary option for "frame variable" lets you bind a named summary to one or more variables ${var%s} now works for printing the value of 0-terminated CStrings type format test case now tests for cascading - this is disabled on GCC because GCC may end up stripping typedef chains, basically breaking cascading new design for the FormatNavigator class new template class CleanUp2 meant to support cleanup routines with 1 additional parameter beyond resource handle llvm-svn: 134943
Diffstat (limited to 'lldb/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py')
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py31
1 files changed, 30 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",
OpenPOWER on IntegriCloud