Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* gdb can't print array element for fortran
@ 2010-03-12 13:06 Chandru
  2010-03-15 17:13 ` Joel Brobecker
  0 siblings, 1 reply; 7+ messages in thread
From: Chandru @ 2010-03-12 13:06 UTC (permalink / raw)
  To: gdb-patches

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);


^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: gdb can't print array element for fortran
@ 2010-03-18 11:24 Nick Roberts
  0 siblings, 0 replies; 7+ messages in thread
From: Nick Roberts @ 2010-03-18 11:24 UTC (permalink / raw)
  To: Chandru; +Cc: gdb-patches


> 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. 

Hmm, the example given in January works with GDB 6.8.  It looks like a
regression due to this change:


2008-04-22  Markus Deuling  <deuling@de.ibm.com>

	* eval.c (evaluate_subexp_standard): Use value_subscripted_rvalue for
	multi_f77_subscript to support values from registers.
	* valarith.c (value_subscripted_rvalue): Remove prototype and static.
	* value.h (value_subscripted_rvalue): Add prototype.

	* f-typeprint.c (f_type_print_base): Add support for TYPE_CODE_UNION.
	Fix output.
	* f-valprint.c (f_val_print): Likewise.

-- 
Nick                                           http://users.snap.net.nz/~nickrob


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-03-18 11:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-12 13:06 gdb can't print array element for fortran Chandru
2010-03-15 17:13 ` Joel Brobecker
2010-03-15 20:52   ` Tom Tromey
2010-03-15 23:46     ` Jan Kratochvil
2010-03-16 15:16       ` Joel Brobecker
2010-03-16 21:04         ` Jan Kratochvil
2010-03-18 11:24 Nick Roberts

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox