From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BF7CE385482E; Thu, 29 Oct 2020 17:30:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BF7CE385482E From: "zoran.zaric at amd dot com" To: gdb-prs@sourceware.org Subject: [Bug symtab/26813] New: DW_FORM_rnglistx and DW_FORM_loclistx not fully supported Date: Thu, 29 Oct 2020 17:30:03 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new 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: zoran.zaric at amd dot com X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: 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: Thu, 29 Oct 2020 17:30:03 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26813 Bug ID: 26813 Summary: DW_FORM_rnglistx and DW_FORM_loclistx not fully supported Product: gdb Version: HEAD Status: UNCONFIRMED Severity: normal Priority: P2 Component: symtab Assignee: unassigned at sourceware dot org Reporter: zoran.zaric at amd dot com Target Milestone: --- Created attachment 12929 --> https://sourceware.org/bugzilla/attachment.cgi?id=3D12929&action=3Ded= it Test application and gdb patch Gdb seems to be reporting an internal error when attributes of either DW_FORM_rnglistx or DW_FORM_loclistx form are found in DWARF. Both of these forms are part of the newest DWARF 5 standard, which support = was only recently added to the gdb. Original problem was found on a application written in HIP language and com= pile using a Clang based compiler (version 11 or newer).=20 Considering that HIP language and runtime is not everybody's cup of tea, I tried to find a C++ application that can reproduce an issue.=20 I was lucky, and it seems that my old application, written to solving some logical problem from years ago, exposes the same bug. The bug will only show up if a compiler used is Clang 11 (or newer) and it doesn't seem to show up under gcc. To reproduce the issue, one just need to build the application using a simp= le make command. After that it needs to be run under the debugger without any arguments: $ tar -xf MagicPurse.tar.xz $ make $ gdb ./MagicPurse The reason I've have not tried to reduce the application is because it expo= ses multiple levels of bugs, and it seems useful to have the whole thing to make sure that we don't miss any unknown issues. I have debugged the reason behind the internal error and found that both of these forms are not properly processed when read. The attached archive also contains a small patch (dwarf-5-fix-WIP.patch) that deals with that problem. After applying the patch, another issue comes up where the DW_FORM_rnglistx form is not resolved properly. The problem seems to be in read_rnglist_index function. These new forms can have multiple headers inside of .debug_rnglist where the read_rnglist_index function only ever reads the first one. This results in = an error message: DW_FORM_rnglistx index pointing outside of .debug_rnglists offset array= ... My patch is based on 006811bc02fe28060a8557b1f17a129440c975d4 commit and it makes sense to me, but I am not that familiar with the mechanism behind rea= ding the dwarf sections. --=20 You are receiving this mail because: You are on the CC list for the bug.=