From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31732 invoked by alias); 18 Jan 2009 21:59:41 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 31707 invoked by uid 9674); 18 Jan 2009 21:59:40 -0000 Date: Sun, 18 Jan 2009 21:59:00 -0000 Message-ID: <20090118215940.31692.qmail@sourceware.org> From: jkratoch@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] archer-jankratochvil-vla: Print Fortran unbound arrays as empty instead of as a garbaged single element. X-Git-Refname: refs/heads/archer-jankratochvil-vla X-Git-Reftype: branch X-Git-Oldrev: bbbc382d7765225720a24212110e33be51d1d1e7 X-Git-Newrev: 7a3432cb57021fbc9aba591bb5db9a26df190bba X-SW-Source: 2009-q1/txt/msg00056.txt.bz2 List-Id: 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 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 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.