From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 817A5385ED4D; Wed, 15 Jul 2020 14:36:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 817A5385ED4D From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug symtab/26243] Handle line number 0 in line table produced by clang Date: Wed, 15 Jul 2020 14:36:05 +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: Wed, 15 Jul 2020 14:36:05 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26243 --- Comment #2 from Tom de Vries --- This behaviour appears to be a recent regression by commit d8cc8af6a1 "[gdb/symtab] Fix line-table end-of-sequence sorting", caused by the part of the patch that reverts this bit that was introduced by commit 3d92a3e313 "g= db: Don't reorder line table entries too much when sorting": ... diff --git a/gdb/symtab.c b/gdb/symtab.c index d5ba249ced..f456f4d852 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -3222,7 +3222,12 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, i nt notcurrent) struct linetable_entry *last =3D item + len; item =3D std::upper_bound (first, last, pc, pc_compare); if (item !=3D first) - prev =3D item - 1; /* Found a matching item. */ + { + /* Found a matching item. Skip backwards over any end of + sequence markers. */ + for (prev =3D item - 1; prev->line =3D=3D 0 && prev !=3D first; p= rev--) + /* Nothing. */; + } /* At this point, prev points at the line whose start addr is <=3D p= c, and item points at the next line. If we ran off the end of the linet= able ... But the root cause is that clang/llvm style line number zero entries are ju= st not handled by gdb. --=20 You are receiving this mail because: You are on the CC list for the bug.=