From 9fc1944ece6e1a668972e80a5e841dc920009899 Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Wed, 6 Jul 2011 02:13:41 +0000 Subject: 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 --- .../TestDataFormatterAdv.py | 85 ++++++++++++++++++---- 1 file changed, 70 insertions(+), 15 deletions(-) (limited to 'lldb/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py') 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 -- cgit v1.2.3