From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CDCD23959E4B; Wed, 24 Feb 2021 22:58:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CDCD23959E4B From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug symtab/27336] [dwarf-5] abort on info addr in gdb.cp/temargs.exp Date: Wed, 24 Feb 2021 22:58:46 +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: cvs-commit 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: Wed, 24 Feb 2021 22:58:46 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27336 --- Comment #6 from cvs-commit at gcc dot gnu.org --- The master branch has been updated by Tom de Vries : https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Daa659cfad638= 376ab535bc5a7b65c164327e9e21 commit aa659cfad638376ab535bc5a7b65c164327e9e21 Author: Tom de Vries Date: Wed Feb 24 23:58:42 2021 +0100 [gdb/symtab] Handle DW_AT_decl_file with form DW_FORM_implicit_const With test-case gdb.cp/temargs.exp on target board \ unix/gdb:debug_flags=3D-gdwarf-5 I run into: ... (gdb) info addr I^M ERROR: GDB process no longer exists GDB process exited with wait status 32286 exp19 0 0 CHILDKILLED SIGABRT SIGABRT UNRESOLVED: gdb.cp/temargs.exp: test address of I in templ_m ... This is a regression since commit 529908cbd0a "Remove DW_UNSND". The problem is that this DW_AT_decl_file: ... <1><221>: Abbrev Number: 4 (DW_TAG_structure_type) <222> DW_AT_name : Base <226> DW_AT_byte_size : 1 <226> DW_AT_decl_file : 1 <226> DW_AT_decl_line : 30 <227> DW_AT_sibling : <0x299> ... is not read by this code in new_symbol: .... attr =3D dwarf2_attr (die, inlined_func ? DW_AT_call_file : DW_AT_decl_f= ile, cu); if (attr !=3D nullptr && attr->form_is_unsigned ()) ... because DW_AT_decl_file has form DW_FORM_implicit_const: ... 4 DW_TAG_structure_type [has children] DW_AT_name DW_FORM_strp DW_AT_byte_size DW_FORM_implicit_const: 1 DW_AT_decl_file DW_FORM_implicit_const: 1 DW_AT_decl_line DW_FORM_data1 DW_AT_sibling DW_FORM_ref4 DW_AT value: 0 DW_FORM value: 0 ... which is a signed LEB128, so attr->form_is_unsigned () returns false. Fix this by introducing new functions is_nonnegative and as_nonnegative, and use these instead of form_is_unsigned and as_unsigned. Tested on x86_64-linux. gdb/ChangeLog: 2021-02-24 Tom de Vries PR symtab/27336 * dwarf2/attribute.c (attribute::form_is_signed): New function factored out of ... * dwarf2/attribute.h (attribute::as_signed): ... here. (attribute::is_nonnegative, attribute::as_nonnegative): New function. (attribute::form_is_signed): Declare. * dwarf2/read.c (new_symbol): Use is_nonnegative and as_nonnega= tive for DW_AT_decl_file. --=20 You are receiving this mail because: You are on the CC list for the bug.=