From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DC4D7384BC14; Tue, 24 Nov 2020 12:32:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DC4D7384BC14 From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug mi/26935] [gdb/testsuite] Using gold in gdb.base/morestack.exp causes incorrect debug info Date: Tue, 24 Nov 2020 12:32:48 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: mi 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, 24 Nov 2020 12:32:49 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26935 --- Comment #3 from Tom de Vries --- (In reply to Tom de Vries from comment #2) > But with ld, we have: > ... > linetable: ((struct linetable *) 0x2f18420): > INDEX LINE ADDRESS IS-STMT > 0 END 0x56555004 Y > 1 109 0x56555b8b Y > ... > If we're dropping lines 636 and 637 because the addresses are out of rang= e, > I'd say it makes sense to drop the corresponding END as well. This seems to work: ... diff --git a/gdb/buildsym.c b/gdb/buildsym.c index 9525962d966..f2560dd7fe7 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -714,6 +714,14 @@ buildsym_compunit::record_line (struct subfile *subfil= e, int line , break; subfile->line_vector->nitems--; } + + /* Ignore an end-of-sequence marker marking an empty sequence. */ + struct linetable_entry *last + =3D (subfile->line_vector->nitems =3D=3D 0 + ? nullptr + : &subfile->line_vector->item[subfile->line_vector->nitems - 1]); + if (last =3D=3D nullptr || last->line =3D=3D 0) + return; } e =3D subfile->line_vector->item + subfile->line_vector->nitems++; ... --=20 You are receiving this mail because: You are on the CC list for the bug.=