From d07cfd3ae4c6a99d06c67549d7a946a870ce228a Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Wed, 8 Oct 2014 18:27:36 +0000 Subject: Extend synthetic children to produce synthetic values (as in, those that GetValueAsUnsigned(), GetValueAsCString() would return) The way to do this is to write a synthetic child provider for your type, and have it vend the (optional) get_value function. If get_value is defined, and it returns a valid SBValue, that SBValue's value (as in lldb_private::Value) will be used as the synthetic ValueObject's Value The rationale for doing things this way is twofold: - there are many possible ways to define a "value" (SBData, a Python number, ...) but SBValue seems general enough as a thing that stores a "value", so we just trade values that way and that keeps our currency trivial - we could introduce a new level of layering (ValueObjectSyntheticValue), a new kind of formatter (synthetic value producer), but that would complicate the model (can I have a dynamic with no synthetic children but synthetic value? synthetic value with synthetic children but no dynamic?), and I really couldn't see much benefit to be reaped from this added complexity in the matrix On the other hand, just defining a synthetic child provider with a get_value but returning no actual children is easy enough that it's not a significant road-block to adoption of this feature Comes with a test case llvm-svn: 219330 --- .../data-formatter/data-formatter-synth/TestDataFormatterSynth.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lldb/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py') diff --git a/lldb/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py b/lldb/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py index 9c3bed1828a..36ff60babdb 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py @@ -14,12 +14,14 @@ class SynthDataFormatterTestCase(TestBase): @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") @dsym_test + @unittest2.expectedFailure("rdar://15630776 - Summary cannot reference non-synthetic children if synthetic children exist") def test_with_dsym_and_run_command(self): """Test data formatter commands.""" self.buildDsym() self.data_formatter_commands() @dwarf_test + @unittest2.expectedFailure("rdar://15630776 - Summary cannot reference non-synthetic children if synthetic children exist") def test_with_dwarf_and_run_command(self): """Test data formatter commands.""" self.buildDwarf() -- cgit v1.2.3