From d64d0bc0ea6864eb209b55d5a5faae988dea296b Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Fri, 19 Aug 2011 21:13:46 +0000 Subject: - Now using ${var} as the summary for an aggregate type will produce "name-of-type @ object-location" instead of giving an error e.g. you may get "foo_class @ 0x123456" when typing "type summary add -f ${var} foo_class" - Added a new special formatting token %T for summaries. This shows the type of the object. Using it, the new "type @ location" summary could be manually generated by writing ${var%T} @ ${var%L} - Bits and pieces required to support "frame variable array[n-m]" The feature is not enabled yet because some additional design and support code is required, but the basics are getting there - Fixed a potential issue where a ValueObjectSyntheticFilter was not holding on to its SyntheticChildrenSP Because of the way VOSF are being built now, this has never been an actual issue, but it is still sensible for a VOSF to hold on to the SyntheticChildrenSP as well as to its FrontEnd llvm-svn: 138080 --- .../data-formatter-cpp/TestDataFormatterCpp.py | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'lldb/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py') 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 a5862ac1e87..1667aeb25ef 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py @@ -195,7 +195,34 @@ class DataFormatterTestCase(TestBase): '[2] = cool object @ 0x', '[3] = cool object @ 0x', '[4] = cool object @ 0x']) + + # test getting similar output by exploiting ${var} = 'type @ location' for aggregates + self.runCmd("type summary add -f \"${var}\" i_am_cool") + + # 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] = i_am_cool @ 0x', + '[1] = i_am_cool @ 0x', + '[2] = i_am_cool @ 0x', + '[3] = i_am_cool @ 0x', + '[4] = i_am_cool @ 0x']) + + # test getting same output by exploiting %T and %L together for aggregates + self.runCmd("type summary add -f \"${var%T} @ ${var%L}\" i_am_cool") + + # 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] = i_am_cool @ 0x', + '[1] = i_am_cool @ 0x', + '[2] = i_am_cool @ 0x', + '[3] = i_am_cool @ 0x', + '[4] = i_am_cool @ 0x']) + self.runCmd("type summary add -f \"goofy\" i_am_cool") self.runCmd("type summary add -f \"${var.second_cool%S}\" i_am_cooler") -- cgit v1.2.3