diff options
author | Enrico Granata <granata.enrico@gmail.com> | 2011-07-22 00:16:08 +0000 |
---|---|---|
committer | Enrico Granata <granata.enrico@gmail.com> | 2011-07-22 00:16:08 +0000 |
commit | d55546b27a90ecc088316a706446c2a293ad94b0 (patch) | |
tree | ecf0e9d8c2f243dae418cc779c708a62958b56b3 /lldb/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py | |
parent | 1872173841e85dd061b99b85ad2f1fb24cb23609 (diff) | |
download | bcm5719-llvm-d55546b27a90ecc088316a706446c2a293ad94b0.tar.gz bcm5719-llvm-d55546b27a90ecc088316a706446c2a293ad94b0.zip |
when typing a summary string you can use the %S symbol to explicitly indicate that you want the summary to be used to print the target object
(e.g. ${var%S}). this might already be the default if your variable is of an aggregate type
new feature: synthetic filters. you can restrict the number of children for your variables to only a meaningful subset
- the restricted list of children obeys the typical rules (e.g. summaries prevail over children)
- one-line summaries show only the filtered (synthetic) children, if you type an expanded summary string, or you use Python scripts, all the real children are accessible
- to provide a synthetic children list use the "type synth add" command, as in:
type synth add foo_type --child varA --child varB[0] --child varC->packet->flags[1-4]
(you can use ., ->, single-item array operator [N] and bitfield operator [N-M]; array slice access is not supported, giving simplified names to expression paths is not supported)
- a new -S option to frame variable and target variable lets you override synthetic children and instead show real ones
llvm-svn: 135731
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.py | 18 |
1 files changed, 18 insertions, 0 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 f5a206b39f4..97aae5c8e1c 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py @@ -182,7 +182,25 @@ class DataFormatterTestCase(TestBase): self.expect("frame variable cool_pointer", substrs = ['3,0,0']) + # test special symbols for formatting variables into summaries + self.runCmd("type summary add -f \"cool object @ ${var%L}\" i_am_cool") + self.runCmd("type summary delete \"i_am_cool [5]\"") + # this test might fail if the compiler tries to store + # these values into registers.. hopefully this is not + # going to be the case + self.expect("frame variable cool_array", + substrs = ['[0] = cool object @ 0x', + '[1] = cool object @ 0x', + '[2] = cool object @ 0x', + '[3] = cool object @ 0x', + '[4] = cool object @ 0x']) + + self.runCmd("type summary add -f \"goofy\" i_am_cool") + self.runCmd("type summary add -f \"${var.second_cool%S}\" i_am_cooler") + + self.expect("frame variable the_coolest_guy", + substrs = ['(i_am_cooler) the_coolest_guy = goofy']) if __name__ == '__main__': import atexit |