From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 82E103856DE3; Fri, 20 May 2022 15:36:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 82E103856DE3 From: "simon.marchi at polymtl dot ca" To: gdb-prs@sourceware.org Subject: [Bug symtab/29105] new DWARF reader still slow Date: Fri, 20 May 2022 15:36:44 +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: simon.marchi at polymtl dot ca X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: tromey 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, 20 May 2022 15:36:44 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D29105 --- Comment #7 from Simon Marchi --- I'm currently debugging objfile::lookup_symbol, and it seems the intention = to stop expanding when the symbol is found. What I see is that we are looking= for the "signed int" type: (top-gdb) frame #6 0x0000555555c5dd69 in objfile::lookup_symbol (this=3D0x555556807040, kind=3DSTATIC_BLOCK, name=3D0x7fffffffaca0 "signed int", domain=3DVAR_DOMAI= N) at symfile-debug.c:276 276 if (!iter->expand_symtabs_matching (this, But in cooked_index_functions::expand_symtabs_matching, we decided to match index entries with "int" instead of "signed int" (see the name_vec vector): (top-gdb) frame #5 0x00005555558e1d07 in cooked_index_functions::expand_symtabs_matching(objfile*, gdb::function_view, lookup_name_info const*, gdb::function_view, gdb::function_view, enum_flags, domain_enum_tag, search_domain) (this=3D0x555556809360, objfile=3D0x555556807040, file_match= er=3D..., lookup_name=3D0x7fffffffa760, symbol_matcher=3D..., expansion_notify=3D..., search_flags=3D..., domain=3DVAR_DOMAIN, kind=3DALL_DOMAIN) at dwarf2/read.= c:20288 20288 if (!dw2_expand_symtabs_matching_one (entry->per_cu, per_objfile, (top-gdb) p name_vec $13 =3D std::vector of length 1, capacity 1 =3D {"int"} Most CUs have a type called "int", so that matches a lot of them. Back in the expansion notifier in objfile::lookup_symbol, we search the just expanded CUs for the "signed int" type, and we don't find it, so we return false, meaning "not found, please expand the next CU". I'm not too familiar with this code, but the discrepancy between the criter= ia on which we choose the CUs to expand (those that have the "int" type) and t= hen the type we actually look for ("signed int") is odd. In the previous psymtabs code, I think we looked for partial symbols named "signed int", and didn't find any, so it didn't cause expansion of these CU= s. --=20 You are receiving this mail because: You are on the CC list for the bug.=