From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 20C053858C2D; Sun, 28 Jan 2024 23:43:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 20C053858C2D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1706485389; bh=iNRm4jwKMFxm9z3saJ13bzNR9bLiWZcg3m2Pfpz7Wdc=; h=From:To:Subject:Date:From; b=GiKaoo9m4WUdBKH81oiCC9nz58xAgemPXMGZV0fCG2UT+9QGUuQMzVgFsUgfVEWBq 0n8yXINiI6es513i/R/2Z3Sh/mTMJ0jgws5dOG1fHit99BvcLaIpoolKuQctxbhM2V Ov/9nMOtEG33eog+V8YrpcgXrsmFhdprfqWrpXx0= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Fix bug in cooked index scanner X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 3dfc29463ae08a45adb6f1f7bb2a5232c1a33151 X-Git-Newrev: 48f7f3751eac0bb5a2cf8c4d52cbf477e81bef14 Message-Id: <20240128234309.20C053858C2D@sourceware.org> Date: Sun, 28 Jan 2024 23:43:09 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D48f7f3751eac= 0bb5a2cf8c4d52cbf477e81bef14 commit 48f7f3751eac0bb5a2cf8c4d52cbf477e81bef14 Author: Tom Tromey Date: Thu Mar 30 10:21:59 2023 -0600 Fix bug in cooked index scanner =20 Testing this entire series pointed out that the cooked index scanner disagrees with new_symbol about certain symbols. In particular, new_symbol has this comment: =20 Ada and Fortran subprograms, whether marked external or not, are always stored as a global symbol, because we want =20 This patch updates the scanner to match. =20 I don't know why the current code does not cause failures. =20 It's maybe worth noting that incremental CU expansion -- creating symtabs directly from the index -- would eliminate this sort of bug. Diff: --- gdb/dwarf2/read.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 925a5ea4a5b..55a17358e66 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -16326,6 +16326,12 @@ cooked_indexer::scan_attributes (dwarf2_per_cu_dat= a *scanning_per_cu, || abbrev->tag =3D=3D DW_TAG_enumeration_type || abbrev->tag =3D=3D DW_TAG_enumerator)) *flags &=3D ~IS_STATIC; + + /* Keep in sync with new_symbol. */ + if (abbrev->tag =3D=3D DW_TAG_subprogram + && (m_language =3D=3D language_ada + || m_language =3D=3D language_fortran)) + *flags &=3D ~IS_STATIC; } =20 return info_ptr;