* dwarf2read.c (read_array_type): When building the type for an
authorJim Blandy <jimb@codesourcery.com>
Tue, 23 Sep 2003 16:25:13 +0000 (16:25 +0000)
committerJim Blandy <jimb@codesourcery.com>
Tue, 23 Sep 2003 16:25:13 +0000 (16:25 +0000)
array of unspecified length, make sure to choose the upper bound
so that the array's total length comes out to be zero --- that's
how we represent such arrays.

gdb/ChangeLog
gdb/dwarf2read.c

index c2d979769ef542bd2ae6d2b282aded0bce345454..1cefe8bc1c7e8762a14a0acd33a577f736d9ada7 100644 (file)
@@ -1,3 +1,10 @@
+2003-09-22  Jim Blandy  <jimb@redhat.com>
+
+       * dwarf2read.c (read_array_type): When building the type for an
+       array of unspecified length, make sure to choose the upper bound
+       so that the array's total length comes out to be zero --- that's
+       how we represent such arrays.
+
 2003-09-22  Michael Chastain  <mec@shout.net>
 
        * MAINTAINERS: Rename gdb.c++ to gdb.cp.
index 468151f6af8dbe69a78e13f3df1ce2118e9c2876..bb614e5ef9ad347a4df7b29cfca315a00228bcd3 100644 (file)
@@ -3237,8 +3237,14 @@ read_array_type (struct die_info *die, struct objfile *objfile,
                     with a DW_FORM_block1 attribute.
                     FIXME: GDB does not yet know how to handle dynamic
                     arrays properly, treat them as arrays with unspecified
-                    length for now.  */
-                 high = -1;
+                    length for now.
+
+                     FIXME: jimb/2003-09-22: GDB does not really know
+                     how to handle arrays of unspecified length
+                     either; we just represent them as zero-length
+                     arrays.  Choose an appropriate upper bound given
+                     the lower bound we've computed above.  */
+                 high = low - 1;
                }
              else
                {