[Lldb-commits] [lldb] r160449 - in /lldb/trunk: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp test/lang/c/struct_types/main.c

Sean Callanan scallanan at apple.com
Wed Jul 18 13:39:27 PDT 2012


Author: spyffe
Date: Wed Jul 18 15:39:26 2012
New Revision: 160449

URL: http://llvm.org/viewvc/llvm-project?rev=160449&view=rev
Log:
Removed a hack that gives zero-length arrays a
single element.  Also modified our struct test
case to test this.

Modified:
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
    lldb/trunk/test/lang/c/struct_types/main.c

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=160449&r1=160448&r2=160449&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Wed Jul 18 15:39:26 2012
@@ -6162,9 +6162,6 @@
                         {
                             std::vector<uint64_t> element_orders;
                             ParseChildArrayInfo(sc, dwarf_cu, die, first_index, element_orders, byte_stride, bit_stride);
-                            // We have an array that claims to have no members, lets give it at least one member...
-                            if (element_orders.empty())
-                                element_orders.push_back (1);
                             if (byte_stride == 0 && bit_stride == 0)
                                 byte_stride = element_type->GetByteSize();
                             clang_type_t array_element_type = element_type->GetClangForwardType();

Modified: lldb/trunk/test/lang/c/struct_types/main.c
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/struct_types/main.c?rev=160449&r1=160448&r2=160449&view=diff
==============================================================================
--- lldb/trunk/test/lang/c/struct_types/main.c (original)
+++ lldb/trunk/test/lang/c/struct_types/main.c Wed Jul 18 15:39:26 2012
@@ -10,6 +10,7 @@
 {
     struct point_tag {
         int x;
+        char padding[0];
         int y;
     }; // Set break point at this line.
 
@@ -17,7 +18,7 @@
         struct point_tag bottom_left;
         struct point_tag top_right;
     };
-    struct point_tag pt = { 2, 3 }; // This is the first executable statement.
-    struct rect_tag rect = {{1,2}, {3,4}};
+    struct point_tag pt = { 2, {}, 3 }; // This is the first executable statement.
+    struct rect_tag rect = {{1, {}, 2}, {3, {}, 4}};
     return 0;
 }





More information about the lldb-commits mailing list