From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4AC31384C007; Tue, 17 Nov 2020 13:43:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4AC31384C007 From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug fortran/26910] [fortran] Printing dynamic string with DW_AT_string_length of class loclistpr fails Date: Tue, 17 Nov 2020 13:43:34 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: fortran 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: 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: Tue, 17 Nov 2020 13:43:34 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26910 --- Comment #2 from Tom de Vries --- Tentative patch: ... diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 3c598262913..151ba1faae2 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -18675,14 +18675,30 @@ attr_to_dynamic_prop (const struct attribute *att= r, struct die_in fo *die, } else if (attr->form_is_constant ()) prop->set_const_val (attr->constant_value (0)); - else + else if (attr->form_is_section_offset ()) { - dwarf2_invalid_attrib_class_complaint (dwarf_form_name (attr->form), - dwarf2_name (die, cu)); - return 0; + switch (attr->name) + { + case DW_AT_string_length: + baton =3D XOBNEW (obstack, struct dwarf2_property_baton); + baton->property_type =3D default_type; + fill_in_loclist_baton (cu, &baton->loclist, attr); + prop->set_loclist (baton); + gdb_assert (prop->baton () !=3D NULL); + break; + default: + goto invalid; + } } + else + goto invalid; return 1; + + invalid: + dwarf2_invalid_attrib_class_complaint (dwarf_form_name (attr->form), + dwarf2_name (die, cu)); + return 0; } /* See read.h. */ ... and we have: ... $ gdb -batch ./outputs/gdb.opt/fortran-string/fortran-string \ -ex "b 4" \ -ex r \ -ex "ptype s" Breakpoint 1 at 0x400734: file fortran-string.f90, line 4. Breakpoint 1, f (s=3D..., _s=3D_s@entry=3D3) at fortran-string.f90:4 4 print *, s type =3D character (3) ... --=20 You are receiving this mail because: You are on the CC list for the bug.=