[Lldb-commits] [PATCH] D18005: Fixed ValueObject::GetExpressionPath() for paths including anonymous struct/union

Marianne Mailhot-Sarrasin via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 9 13:55:00 PST 2016


mamai updated this revision to Diff 50192.
mamai added a comment.

Replaced the test by a new case in lang/c/anonymous test, as suggested by Jim. Is this correct?


Repository:
  rL LLVM

http://reviews.llvm.org/D18005

Files:
  packages/Python/lldbsuite/test/lang/c/anonymous/TestAnonymous.py
  source/Core/ValueObject.cpp

Index: source/Core/ValueObject.cpp
===================================================================
--- source/Core/ValueObject.cpp
+++ source/Core/ValueObject.cpp
@@ -2536,7 +2536,7 @@
         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)
Index: packages/Python/lldbsuite/test/lang/c/anonymous/TestAnonymous.py
===================================================================
--- packages/Python/lldbsuite/test/lang/c/anonymous/TestAnonymous.py
+++ packages/Python/lldbsuite/test/lang/c/anonymous/TestAnonymous.py
@@ -112,6 +112,17 @@
         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)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18005.50192.patch
Type: text/x-patch
Size: 1498 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160309/ed809754/attachment.bin>


More information about the lldb-commits mailing list