summaryrefslogtreecommitdiffstats
path: root/lldb/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
diff options
context:
space:
mode:
authorEnrico Granata <granata.enrico@gmail.com>2011-07-06 02:13:41 +0000
committerEnrico Granata <granata.enrico@gmail.com>2011-07-06 02:13:41 +0000
commit9fc1944ece6e1a668972e80a5e841dc920009899 (patch)
tree1932d140db82c8f6523727341d46af90a11b0690 /lldb/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
parent4d806e28302f48f67ff890c38b7bb55b8f76297d (diff)
downloadbcm5719-llvm-9fc1944ece6e1a668972e80a5e841dc920009899.tar.gz
bcm5719-llvm-9fc1944ece6e1a668972e80a5e841dc920009899.zip
new syntax for summary strings:
- ${*expr} now simply means to dereference expr before actually using it - bitfields, array ranges and pointer ranges now work in a (hopefully) more natural and language-compliant way a new class TypeHierarchyNavigator replicates the behavior of the FormatManager in going through type hierarchies when one-lining summary strings, children's summaries can be used as well as values llvm-svn: 134458
Diffstat (limited to 'lldb/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py')
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py85
1 files changed, 70 insertions, 15 deletions
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py b/lldb/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
index a473435340d..9184b7c45cc 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
@@ -53,13 +53,6 @@ class DataFormatterTestCase(TestBase):
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
- self.runCmd("type summary add -f \"pippo\" -x \"IUseCharStar\"")
-
- self.expect("frame variable iEncapsulateCharStar",
- substrs = ['pippo'])
-
- self.runCmd("type summary clear")
-
self.runCmd("type summary add -f \"pippo\" \"i_am_cool\"")
self.runCmd("type summary add -f \"pluto\" -x \"i_am_cool[a-z]*\"")
@@ -77,12 +70,12 @@ class DataFormatterTestCase(TestBase):
self.runCmd("type summary clear")
- self.runCmd("type summary add -f \"${*var[]}\" -x \"int \\[[0-9]\\]")
+ self.runCmd("type summary add -f \"${var[]}\" -x \"int \\[[0-9]\\]")
self.expect("frame variable int_array",
substrs = ['1,2,3,4,5'])
- self.runCmd("type summary add -f \"${*var[].integer}\" -x \"i_am_cool \\[[0-9]\\]")
+ self.runCmd("type summary add -f \"${var[].integer}\" -x \"i_am_cool \\[[0-9]\\]")
self.expect("frame variable cool_array",
substrs = ['1,1,1,1,6'])
@@ -93,17 +86,79 @@ class DataFormatterTestCase(TestBase):
self.expect("frame variable iAmInt",
substrs = ['01'])
-
- self.runCmd("type summary add -f \"${*var[0-1]%x}\" \"int\"")
-
- self.expect("frame variable iAmInt", matching=False,
- substrs = ['01'])
-
+
self.runCmd("type summary add -f \"${var[0-1]%x}\" \"int\"")
self.expect("frame variable iAmInt",
substrs = ['01'])
+ self.runCmd("type summary clear")
+
+ self.runCmd("type summary add -f \"${var[0-1]%x}\" int")
+ self.runCmd("type summary add -f \"${var[0-31]%x}\" float")
+
+ self.expect("frame variable *pointer",
+ substrs = ['0x',
+ '2'])
+
+ self.expect("frame variable cool_array[3].floating",
+ substrs = ['0x'])
+
+ self.runCmd("type summary add -f \"low bits are ${*var[0-1]} tgt is ${*var}\" \"int *\"")
+
+ self.expect("frame variable pointer",
+ substrs = ['low bits are',
+ 'tgt is 6'])
+
+ self.runCmd("type summary add -f \"${*var[0-1]}\" -x \"int \[[0-9]\]\"")
+
+ self.expect("frame variable int_array",
+ substrs = ['3'])
+
+ self.runCmd("type summary clear")
+
+ self.runCmd("type summary add -f \"${var[0-1]}\" -x \"int \[[0-9]\]\"")
+
+ self.expect("frame variable int_array",
+ substrs = ['1,2'])
+
+ self.runCmd("type summary clear")
+
+ self.runCmd("type summary add -c -x \"i_am_cool \[[0-9]\]\"")
+ self.runCmd("type summary add -c i_am_cool")
+
+ self.expect("frame variable cool_array",
+ substrs = ['[0]',
+ '[1]',
+ '[2]',
+ '[3]',
+ '[4]',
+ 'integer',
+ 'character',
+ 'floating'])
+
+ self.runCmd("type summary add -f \"int = ${*var.int_pointer}, float = ${*var.float_pointer}\" IWrapPointers")
+
+ self.expect("frame variable wrapper",
+ substrs = ['int = 4',
+ 'float = 1.1'])
+
+ self.runCmd("type summary add -f \"low bits = ${*var.int_pointer[2]}\" IWrapPointers -p")
+
+ self.expect("frame variable wrapper",
+ substrs = ['low bits = 1'])
+
+ self.expect("frame variable *wrap_pointer",
+ substrs = ['low bits = 1'])
+
+ self.runCmd("type summary clear")
+
+ self.runCmd("type summary add -f \"${var[0][0-2]%hex}\" -x \"int \[[0-9]\]\"")
+
+ self.expect("frame variable int_array",
+ substrs = ['0x',
+ '7'])
+
if __name__ == '__main__':
import atexit
OpenPOWER on IntegriCloud