[Lldb-commits] [lldb] r263166 - Fixed ValueObject::GetExpressionPath() for paths including anonymous struct/union
Marianne Mailhot-Sarrasin via lldb-commits
lldb-commits at lists.llvm.org
Thu Mar 10 14:10:59 PST 2016
Author: mamai
Date: Thu Mar 10 16:10:59 2016
New Revision: 263166
URL: http://llvm.org/viewvc/llvm-project?rev=263166&view=rev
Log:
Fixed ValueObject::GetExpressionPath() for paths including anonymous struct/union
When the parent of an expression is anonymous, skip adding '.' or '->' before the expression name.
Differential Revision: http://reviews.llvm.org/D18005
Modified:
lldb/trunk/packages/Python/lldbsuite/test/lang/c/anonymous/TestAnonymous.py
lldb/trunk/source/Core/ValueObject.cpp
Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/c/anonymous/TestAnonymous.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/anonymous/TestAnonymous.py?rev=263166&r1=263165&r2=263166&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/lang/c/anonymous/TestAnonymous.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/c/anonymous/TestAnonymous.py Thu Mar 10 16:10:59 2016
@@ -112,6 +112,17 @@ class AnonymousTestCase(TestBase):
if not error.Success() or value != 0:
self.fail ("failed to get the correct value for element a in n")
+ def test_nest_flat(self):
+ self.build()
+ self.common_setup(self.line2)
+
+ # These should display correctly.
+ self.expect('frame variable n --flat',
+ substrs = ['n.a = 0',
+ 'n.b = 2',
+ 'n.foo.c = 0',
+ 'n.foo.d = 4'])
+
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=263166&r1=263165&r2=263166&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Thu Mar 10 16:10:59 2016
@@ -2536,7 +2536,7 @@ ValueObject::GetExpressionPath (Stream &
if (!is_deref_of_parent)
{
ValueObject *non_base_class_parent = GetNonBaseClassParent();
- if (non_base_class_parent)
+ if (non_base_class_parent && !non_base_class_parent->GetName().IsEmpty())
{
CompilerType non_base_class_parent_compiler_type = non_base_class_parent->GetCompilerType();
if (non_base_class_parent_compiler_type)
More information about the lldb-commits
mailing list