public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug fortran/26870] [fortran] Printing dynamic array fails
Date: Wed, 13 Oct 2021 12:22:18 +0000	[thread overview]
Message-ID: <bug-26870-4717-ygZkd87zIw@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-26870-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=26870

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
With gdb-11.1 we have:
...
(gdb) PASS: gdb.fortran/dynamic.exp: ptype vart
p varz^M
$26 = <error reading variable>^M
(gdb) FAIL: gdb.fortran/dynamic.exp: p varz
p vart^M
$27 = <error reading variable>^M
(gdb) FAIL: gdb.fortran/dynamic.exp: p vart
...
which means we no longer get the "warning: array or string index out of range"
which is good.

The error message is a bit uninformative, and could be improved using:
...
diff --git a/gdb/valprint.c b/gdb/valprint.c
index 324055da93f..05740c838ad 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -1050,7 +1050,7 @@ do_val_print (struct value *value, struct ui_file
*stream, int recurs
e,
   catch (const gdb_exception_error &except)
     {
       fprintf_styled (stream, metadata_style.style (),
-                     _("<error reading variable>"));
+                     _("<error reading variable: %s>"), except.what ());
     }
 }

...
to:
...
(gdb) PASS: gdb.fortran/dynamic.exp: ptype vart
p varz^M
$26 = <error reading variable: failed to get range bounds>^M
(gdb) FAIL: gdb.fortran/dynamic.exp: p varz
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2021-10-13 12:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-12 12:50 [Bug fortran/26870] New: " vries at gcc dot gnu.org
2020-11-12 12:56 ` [Bug fortran/26870] " vries at gcc dot gnu.org
2021-10-13 12:22 ` vries at gcc dot gnu.org [this message]
2021-10-13 14:06 ` [Bug symtab/26870] " vries at gcc dot gnu.org
2021-10-13 14:07 ` vries at gcc dot gnu.org
2021-10-13 14:07 ` vries at gcc dot gnu.org
2021-10-13 14:08 ` vries at gcc dot gnu.org

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=bug-26870-4717-ygZkd87zIw@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@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: link
Be 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).