From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D37703858408; Wed, 13 Oct 2021 14:06:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D37703858408 From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug symtab/26870] [fortran] Printing dynamic array fails Date: Wed, 13 Oct 2021 14:06:02 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: symtab X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: component Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2021 14:06:02 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26870 Tom de Vries changed: What |Removed |Added ---------------------------------------------------------------------------- Component|fortran |symtab --- Comment #3 from Tom de Vries --- (In reply to Tom de Vries from comment #1) > Tentative patch: > ... > diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c > index 33ac761f85d..737d7bd0f6e 100644 > --- a/gdb/f-valprint.c > +++ b/gdb/f-valprint.c > @@ -117,7 +117,8 @@ f77_print_array_1 (int nss, int ndimensions, struct t= ype > *type, > LONGEST lowerbound, upperbound; > LONGEST i; >=20=20 > - get_discrete_bounds (range_type, &lowerbound, &upperbound); > + if (get_discrete_bounds (range_type, &lowerbound, &upperbound) < 0) > + lowerbound =3D 0, upperbound =3D -1; >=20=20 > if (nss !=3D ndimensions) > { > ... >=20 > With the patch, we have instead the expected: > ... > Breakpoint 1, bar (varz=3D..., vart=3D...) at dynamic.f90:68 > 68 varz(2) =3D 5 ! varz-almostfi= lled^M > $1 =3D () > ... Reading this back, I don't think this is the right solution. This suggests that the dimension is 0, and the error may give the idea of using an explic= it dimension for printing the variable. --=20 You are receiving this mail because: You are on the CC list for the bug.=