public inbox for archer-commits@sourceware.org help / color / mirror / Atom feed
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. Date: Sun, 18 Jan 2009 21:59:00 -0000 [thread overview] Message-ID: <20090118215940.31692.qmail@sourceware.org> (raw) 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.
reply other threads:[~2009-01-18 21:59 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20090118215940.31692.qmail@sourceware.org \ --to=jkratoch@sourceware.org \ --cc=archer-commits@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).