From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8023F383581F; Fri, 28 May 2021 07:44:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8023F383581F From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug symtab/27922] [gdb/symtab] Don't create two dwarf2_cu's for the same CU Date: Fri, 28 May 2021 07:44:20 +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: 10.1 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, 28 May 2021 07:44:20 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27922 --- Comment #1 from Tom de Vries --- Let's try to investigate the size of the problem. There are 17292 CUs: ... $ readelf -wi --dwarf-depth 0 libLLVM.so.10-10.0.1-lp152.30.4.x86_64.debug | grep -c "Compilation Unit @" 17292 ... Now let's instrument the partial DIE reader with some tracing: ... diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 4cc5b4f32d7..40531b7b804 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -18823,6 +18823,10 @@ load_partial_dies (const struct die_reader_specs *reader, if (cu->load_all_dies) load_all =3D 1; + fprintf (stderr, "Loading%spartial DIEs for CU@%s\n", + load_all ? " all " : " ", + sect_offset_str (cu->header.sect_off)); + cu->partial_dies =3D htab_create_alloc_ex (cu->header.length / 12, partial_die_hash, ... Now do a run and set the max-cache-age such that nothing is evicted from the cache (also double checked this with assert): ... $ ./gdb.sh -q -batch -ex "maint set dwarf max-cache-age 100000" -ex "symbol-file libLLVM.so.10-10.0.1-lp152.30.4.x86_64.debug" 2>&1 | tee LOG ... So, we end up reading 50% more that the total number of CUs: ... $ grep -c "Loading partial DIEs" LOG 26178 ... and as for loading all partial DIEs we have: ... $ grep -c "Loading all partial DIEs" LOG=20 781 ... For contrast, with "maint set dwarf max-cache-age 0" we have: ... $ grep -c "Loading partial DIEs" LOG 37977 $ grep -c "Loading all partial DIEs" LOG 781 ... --=20 You are receiving this mail because: You are on the CC list for the bug.=