This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
gdb can't print array element for fortran
- From: Chandru <chandru at in dot ibm dot com>
- To: gdb-patches at sourceware dot org
- Date: Fri, 12 Mar 2010 18:36:24 +0530
- Subject: gdb can't print array element for fortran
This mail pertains to the discussion had on gdb mailing list sometime
back here http://sourceware.org/ml/gdb-patches/2009-01/msg00251.html.
After a small discussion with Jan I made the following changes and
these didn't seem to work. Any inputs or thoughts would be helpful.
thanks
Chandru
--- src/gdb/gdbtypes.c.orig 2010-02-25 00:00:19.000000000 +0530
+++ src/gdb/gdbtypes.c 2010-02-25 00:03:16.000000000 +0530
@@ -727,6 +727,14 @@ create_range_type (struct type *result_t
if (low_bound >= 0)
TYPE_UNSIGNED (result_type) = 1;
+ if (high_bound < low_bound)
+ {
+ if (high_bound == -1)
+ TYPE_HIGH_BOUND_UNDEFINED(result_type) = 1;
+ else
+ TYPE_HIGH_BOUND_UNDEFINED(result_type) = 0;
+ }
+
return result_type;
}
--- src/gdb/valarith.c.orig 2010-02-25 00:00:26.000000000 +0530
+++ src/gdb/valarith.c 2010-02-25 00:04:37.000000000 +0530
@@ -198,7 +198,7 @@ value_subscripted_rvalue (struct value *
unsigned int elt_offs = elt_size * longest_to_int (index - lowerbound);
struct value *v;
- if (index < lowerbound || elt_offs >= TYPE_LENGTH (array_type))
+ if (index < lowerbound || ((elt_offs >= TYPE_LENGTH (array_type)) && !TYPE_HIGH_BOUND_UNDEFINED(array_type)))
error (_("no such vector element"));
v = allocate_value (elt_type);