From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0E1E939A0079; Fri, 6 Aug 2021 11:18:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0E1E939A0079 From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug symtab/28200] DW_AT_ranges handling in partial_die_info::read does not handle discontinuous ranges Date: Fri, 06 Aug 2021 11:18:09 +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: 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: Fri, 06 Aug 2021 11:18:10 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28200 --- Comment #1 from Tom de Vries --- Using this hack: ... diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index bac02b5a1bd..394e69b79d3 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -19327,7 +19327,10 @@ partial_die_info::read (const struct die_reader_sp= ecs *reader, if (dwarf2_ranges_read (ranges_offset, &lowpc, &highpc, cu, nullptr, tag)) - has_pc_info =3D 1; + { + highpc =3D lowpc + 1; + has_pc_info =3D 1; + } } break; ... gets rid of the warning: ... (gdb) bt^M #0 0x00000000004004bb in baz ()^M #1 0x00000000004004c7 in foo_low ()^M #2 0x00000000004004e9 in someothername ()^M #3 0x00000000004004b0 in main ()^M (gdb) PASS: gdb.dwarf2/dw2-ranges-psym.exp: bt ... while allowing the original test-case (so without the patch applied) still = to pass. But it basically inverts the problem: instead of claiming too much addresse= s in the partial symtab, it claims to few, so I guess this is really a hack rath= er than a fix. With this hack, I expect problems of the sort of: - trying to find an address in full symtabs fails (because the corresponding partial symtab is not expanded yet) - trying to find address in partial symtabs fails (because of the hack) - we conclude we can't find any debug info corresponding to the address, wh= ich is incorrect. --=20 You are receiving this mail because: You are on the CC list for the bug.=