public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-jankratochvil-vla: Print Fortran unbound arrays as empty instead of as a garbaged single element.
@ 2009-01-18 21:59 jkratoch
  0 siblings, 0 replies; only message in thread
From: jkratoch @ 2009-01-18 21:59 UTC (permalink / raw)
  To: archer-commits

The branch, archer-jankratochvil-vla has been updated
       via  7a3432cb57021fbc9aba591bb5db9a26df190bba (commit)
       via  5eeba0ab12f0dafb05843d624b061fcca113cd47 (commit)
      from  bbbc382d7765225720a24212110e33be51d1d1e7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 7a3432cb57021fbc9aba591bb5db9a26df190bba
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Sun Jan 18 22:58:28 2009 +0100

    Print Fortran unbound arrays as empty instead of as a garbaged single element.
    New testcase.

commit 5eeba0ab12f0dafb05843d624b061fcca113cd47
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Sun Jan 18 15:20:02 2009 +0100

    Remove an unused autovariable `length'.

-----------------------------------------------------------------------

Summary of changes:
 gdb/f-valprint.c                      |   11 ++++++-----
 gdb/testsuite/gdb.fortran/dynamic.exp |    2 ++
 gdb/valops.c                          |    4 +---
 3 files changed, 9 insertions(+), 8 deletions(-)

First 500 lines of diff:
diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
index 8e81b2e..a4d69fb 100644
--- a/gdb/f-valprint.c
+++ b/gdb/f-valprint.c
@@ -78,12 +78,13 @@ f77_get_upperbound (struct type *type)
 
   if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type))
     {
-      /* We have an assumed size array on our hands.  Assume that
-	 upper_bound == lower_bound so that we show at least 1 element.
-	 If the user wants to see more elements, let him manually ask for 'em
-	 and we'll subscript the array and show him.  */
+      /* We have an assumed size array on our hands.  As type_length_get
+	 already assumes a length zero of arrays with underfined bounds VALADDR
+	 passed to the Fortran functions does not contained the real inferior
+	 memory content.  User should request printing of specific array
+	 elements instead.  */
 
-      return f77_get_lowerbound (type);
+      return f77_get_lowerbound (type) - 1;
     }
 
   return TYPE_ARRAY_UPPER_BOUND_VALUE (type);
diff --git a/gdb/testsuite/gdb.fortran/dynamic.exp b/gdb/testsuite/gdb.fortran/dynamic.exp
index 673b686..77a1203 100644
--- a/gdb/testsuite/gdb.fortran/dynamic.exp
+++ b/gdb/testsuite/gdb.fortran/dynamic.exp
@@ -132,6 +132,8 @@ gdb_test "ptype varz" "type = (PTR TO -> \\( )?real(\\(kind=4\\)|\\*4) \\(\\*\\)
 # Intel Fortran Compiler 10.1.008 has a bug here - (2:11,7:7)
 # as it produces DW_AT_lower_bound == DW_AT_upper_bound == 7.
 gdb_test "ptype vart" "type = (PTR TO -> \\( )?real(\\(kind=4\\)|\\*4) \\(2:11,7:\\*\\)\\)?"
+gdb_test "p varz" "\\$\[0-9\]* = \\(\\)"
+gdb_test "p vart" "\\$\[0-9\]* = \\(\\)"
 gdb_test "p varz(3)" "\\$\[0-9\]* = 4"
 # maps to foo::vary(1,1)
 gdb_test "p vart(2,7)" "\\$\[0-9\]* = 8"
diff --git a/gdb/valops.c b/gdb/valops.c
index 50d479d..da78353 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -694,10 +694,8 @@ value_fetch_lazy (struct value *val)
   allocate_value_contents (val);
   if (VALUE_LVAL (val) == lval_memory)
     {
-      CORE_ADDR addr;
-      int length;
+      CORE_ADDR addr = VALUE_ADDRESS (val);
 
-      addr = VALUE_ADDRESS (val);
       if (object_address_get_data (value_type (val), &addr))
 	{
 	  struct type *type = value_enclosing_type (val);


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-01-18 21:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-18 21:59 [SCM] archer-jankratochvil-vla: Print Fortran unbound arrays as empty instead of as a garbaged single element jkratoch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).