[Lldb-commits] [lldb] r232114 - Fix a bug in the data formatters where summary strings would not look into the non-synthetic value for child members if the ValueObject being formatted happened to have a synthetic value
Enrico Granata
egranata at apple.com
Thu Mar 12 15:17:08 PDT 2015
Author: enrico
Date: Thu Mar 12 17:17:07 2015
New Revision: 232114
URL: http://llvm.org/viewvc/llvm-project?rev=232114&view=rev
Log:
Fix a bug in the data formatters where summary strings would not look into the non-synthetic value for child members if the ValueObject being formatted happened to have a synthetic value
rdar://15630776
Modified:
lldb/trunk/include/lldb/Core/ValueObject.h
lldb/trunk/source/Core/FormatEntity.cpp
lldb/trunk/source/DataFormatters/LibCxx.cpp
lldb/trunk/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py
Modified: lldb/trunk/include/lldb/Core/ValueObject.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=232114&r1=232113&r2=232114&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ValueObject.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObject.h Thu Mar 12 17:17:07 2015
@@ -141,19 +141,27 @@ public:
struct GetValueForExpressionPathOptions
{
+ enum class SyntheticChildrenTraversal
+ {
+ None,
+ ToSynthetic,
+ FromSynthetic,
+ Both
+ };
+
bool m_check_dot_vs_arrow_syntax;
bool m_no_fragile_ivar;
bool m_allow_bitfields_syntax;
- bool m_no_synthetic_children;
+ SyntheticChildrenTraversal m_synthetic_children_traversal;
GetValueForExpressionPathOptions(bool dot = false,
bool no_ivar = false,
bool bitfield = true,
- bool no_synth = false) :
+ SyntheticChildrenTraversal synth_traverse = SyntheticChildrenTraversal::ToSynthetic) :
m_check_dot_vs_arrow_syntax(dot),
m_no_fragile_ivar(no_ivar),
m_allow_bitfields_syntax(bitfield),
- m_no_synthetic_children(no_synth)
+ m_synthetic_children_traversal(synth_traverse)
{
}
@@ -200,16 +208,9 @@ public:
}
GetValueForExpressionPathOptions&
- DoAllowSyntheticChildren()
- {
- m_no_synthetic_children = false;
- return *this;
- }
-
- GetValueForExpressionPathOptions&
- DontAllowSyntheticChildren()
+ SetSyntheticChildrenTraversal(SyntheticChildrenTraversal traverse)
{
- m_no_synthetic_children = true;
+ m_synthetic_children_traversal = traverse;
return *this;
}
Modified: lldb/trunk/source/Core/FormatEntity.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FormatEntity.cpp?rev=232114&r1=232113&r2=232114&view=diff
==============================================================================
--- lldb/trunk/source/Core/FormatEntity.cpp (original)
+++ lldb/trunk/source/Core/FormatEntity.cpp Thu Mar 12 17:17:07 2015
@@ -766,7 +766,7 @@ DumpValue (Stream &s,
ValueObject::ExpressionPathAftermath what_next = (do_deref_pointer ?
ValueObject::eExpressionPathAftermathDereference : ValueObject::eExpressionPathAftermathNothing);
ValueObject::GetValueForExpressionPathOptions options;
- options.DontCheckDotVsArrowSyntax().DoAllowBitfieldSyntax().DoAllowFragileIVar().DoAllowSyntheticChildren();
+ options.DontCheckDotVsArrowSyntax().DoAllowBitfieldSyntax().DoAllowFragileIVar().SetSyntheticChildrenTraversal(ValueObject::GetValueForExpressionPathOptions::SyntheticChildrenTraversal::Both);
ValueObject* target = NULL;
const char* var_name_final_if_array_range = NULL;
size_t close_bracket_index = llvm::StringRef::npos;
Modified: lldb/trunk/source/DataFormatters/LibCxx.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/LibCxx.cpp?rev=232114&r1=232113&r2=232114&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/LibCxx.cpp (original)
+++ lldb/trunk/source/DataFormatters/LibCxx.cpp Thu Mar 12 17:17:07 2015
@@ -266,7 +266,7 @@ lldb_private::formatters::LibCxxMapItera
NULL,
NULL,
NULL,
- ValueObject::GetValueForExpressionPathOptions().DontCheckDotVsArrowSyntax().DontAllowSyntheticChildren(),
+ ValueObject::GetValueForExpressionPathOptions().DontCheckDotVsArrowSyntax().SetSyntheticChildrenTraversal(ValueObject::GetValueForExpressionPathOptions::SyntheticChildrenTraversal::None),
NULL).get();
return false;
Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py?rev=232114&r1=232113&r2=232114&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py Thu Mar 12 17:17:07 2015
@@ -14,14 +14,12 @@ class SynthDataFormatterTestCase(TestBas
@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()
More information about the lldb-commits
mailing list