From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id A6M3DD7wMmMf0gAAWB0awg (envelope-from ) for ; Tue, 27 Sep 2022 08:44:46 -0400 Received: by simark.ca (Postfix, from userid 112) id 238C01E112; Tue, 27 Sep 2022 08:44:46 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=dZZ8iIA5; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_DYNAMIC, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id A65461E0D3 for ; Tue, 27 Sep 2022 08:44:45 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DDF793858012 for ; Tue, 27 Sep 2022 12:44:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DDF793858012 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1664282684; bh=z3eBkog69dnznDzbvi/Ia87HQam05etqYYuNoeYnw4k=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=dZZ8iIA5ZngoYpfYPrlm7tpW01DML1eoqpdXoFBfLIy8PLBjnR2B1cVHMZsFpJpna +D/LAIvx1xkHDqxbq5unvCbmWDc6sw06vvGL8SgBoqejlP3vskyiz+Tyg1cqkM674c Uf7VZI9IfjJOOT6o1VRlLWkveCijnKOSAQOlEthY= Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id E45F13858C2D for ; Tue, 27 Sep 2022 12:44:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E45F13858C2D Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id AD8A421E00; Tue, 27 Sep 2022 12:44:24 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 959EA139B3; Tue, 27 Sep 2022 12:44:24 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 8TYqIyjwMmOTEAAAMHmgww (envelope-from ); Tue, 27 Sep 2022 12:44:24 +0000 Message-ID: <2a17bb80-019d-83f1-3d36-f3073ce6a765@suse.de> Date: Tue, 27 Sep 2022 14:44:24 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH][gdb/symtab] Redo "Fix assert in set_length" Content-Language: en-US To: Tom Tromey , Tom de Vries via Gdb-patches References: <20220922130015.GA25067@delia.home> <87sfki19y5.fsf@tromey.com> In-Reply-To: <87sfki19y5.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 9/23/22 15:45, Tom Tromey wrote: >>>>>> "Tom" == Tom de Vries via Gdb-patches writes: > > Tom> The fix is to not use the CU table in a .debug_names section to construct > Tom> all_comp_units, but instead use create_all_comp_units, and then verify the CU > Tom> table from .debug_names. This also fixes PR25969, so remove the KFAIL. > > Note that create_all_comp_units was apparently renamed, so this text > should be changed. > Ack. > Part of the point of the indices is to avoid reading .debug_info until > needed -- so scanning it should not be necessary. Right. But the benefit of scanning the CU headers is a way to reduce complexity of implementation. And if we do the same for .gdb_index, we can drop the atomic on the length field. > I assume this change > would cause a performance drop. > > Checking whether performance suffers would be interesting. > If it doesn't, I'd be more inclined to do this. > I did the following experiment: I build gdb with -O2 at current master. I loaded a "usual suspect" using a cooked index: ... $ time.sh gdb -q -batch -iex "set language c" libxul.so-93.0-1.1.x86_64.debug maxmem: 2817504 real: 4.21 user: 13.01 system: 0.83 ... Then using .debug_names: ... $ time.sh gdb -q -batch -iex "set language c" libxul.so-93.0-1.1.x86_64.debug-with-debug-names maxmem: 267204 real: 0.86 user: 1.55 system: 0.13 ... Then I rebuild with the patch applied and tried again .debug_names: ... $ time.sh gdb -q -batch -iex "set language c" libxul.so-93.0-1.1.x86_64.debug-with-debug-names maxmem: 373516 real: 0.89 user: 1.57 system: 0.13 ... Doesn't look like a noticeable performance drop to me. > Tom> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29572 > > In this one I see the comment: > > This happens fine for CUs, but in this case it's a PU. > > Does .debug_names even work with partial units? I thought there was > some hole in this area. Maybe it is just "dwz -m" that can't work with > .debug_names? I don't recall any more. > Sorry, I don't recall such a problem. > Tom> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=25969 > > I'm not sure I understand this one, but it says: > > AFAIU, to fix this, we'll have to do a top-level scan of the CUs, > and build partial symbols for CUs are not contained in any index. > > I think if the index is incomplete, and gdb can detect that, then it > should simply be discarded and a full scan done. Trying to use both > .debug_names and a partial cooked index is going to make everything more > complicated for, IMO, very little gain. I guess that's a reasonable approach for an incomplete per-module index. But is it also for an incomplete per-CU index (that is, per-CU index is present for some CUs, but missing for other CUs) ? If so, I guess that's ok. But on openSUSE, the linked-in glibc object always contain some dwarf, so these will then always add a CU without per-CU index, causing incompleteness, and gdb will end up ignoring any clang-added per-CU index (unless we build a -nostdlib exec). Thanks, - Tom