From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5C3B83858026; Tue, 17 Nov 2020 13:40:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5C3B83858026 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:40:36 +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:40:36 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26910 --- Comment #1 from Tom de Vries --- The parameter s in function f: ... <2><1ed>: Abbrev Number: 13 (DW_TAG_formal_parameter) <1ee> DW_AT_name : s <1f2> DW_AT_type : <0x25a> ... has type: ... <1><25a>: Abbrev Number: 17 (DW_TAG_string_type) <25b> DW_AT_string_length: 0xbf (location list) <25f> DW_AT_byte_size : 4 <260> DW_AT_sibling : <0x26e> ... matching with location list: ... 000000bf 0000000000400730 0000000000400764 (DW_OP_reg4 (rsi)) 000000d2 0000000000400764 0000000000400783 (DW_OP_reg6 (rbp)) 000000e5 0000000000400783 0000000000400784 (DW_OP_GNU_entry_value: (DW_OP_reg4 (rsi)); DW_OP_stack_value) ... Doing a print of pc at the breakpoint: ... 4 print *, s (gdb) info registers pc pc 0x400734 0x400734 ... tells us that the string length can be found in register rsi, which contain= s: ... (gdb) info registers rsi rsi 0x3 3 ... So, the information seems to be there. Why doesn't gdb use it? We find the answer by stepping through read_tag_string_type. We hit: ... (gdb)=20 17837 if (!attr_to_dynamic_prop (attr, die, cu, &prop, prop_type)) (gdb)=20 17838 length =3D 1; ... and that's the reason why the length is one. So, why don't we manage to convert the attribute to a dynamic prop? Stepping through attr_to_dynamic_prop shows why: ... (gdb)=20 18590 if (attr->form_is_block ()) (gdb)=20 18613 else if (attr->form_is_ref ()) (gdb)=20 18676 else if (attr->form_is_constant ()) (gdb)=20 18680 dwarf2_invalid_attrib_class_complaint (dwarf_form_name (attr->form), (gdb)=20 18682 return 0; ... The actual form is: ... (gdb) p attr.form $2 =3D DW_FORM_sec_offset ... and that's not handled in attr_to_dynamic_prop. --=20 You are receiving this mail because: You are on the CC list for the bug.=