From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Ua/ROKEL8Wm5hAEAWB0awg (envelope-from ) for ; Tue, 28 Apr 2026 15:33:53 -0400 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=yQIgGzzR; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id E4A661E0BA; Tue, 28 Apr 2026 15:33:53 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=no autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 5553F1E093 for ; Tue, 28 Apr 2026 15:33:53 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 25D2F4BB8F6C for ; Tue, 28 Apr 2026 19:33:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 25D2F4BB8F6C Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=yQIgGzzR Received: from omta34.uswest2.a.cloudfilter.net (omta34.uswest2.a.cloudfilter.net [35.89.44.33]) by sourceware.org (Postfix) with ESMTPS id B447E4B920BE for ; Tue, 28 Apr 2026 19:33:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B447E4B920BE Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B447E4B920BE Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777404806; cv=none; b=Ycb+Sic3OgDRA8ykMEE06oosLpqWcNXkGaDWLhH+n6/QSG1T+v9nhM2jqISdsqfmQY+cGez0jvI6gpKjSoUGLnGisJ91sWvKbG1GnYU5p1m5IDihA2IfVhYce5fxrE1Xie163QKcD084z5wLP8POf/UtU6n4TNOWUS/6FQJpplg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777404806; c=relaxed/simple; bh=0bX45Aqx712GRZL4HB70QT/4Ulk8DV3BYyGi8oevcvE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=QwVo2DYjIBsjh8H3z4A39CLJaM3PiJNdtfqcGJndCxnKfGi/4lsvN/6pVnfhsFS1KUM6ppUuLhakyriEIQzwIgxKY+gZMrO07Ctentu1FXmdYdy+bywt5iVhsXjQQ3mOYFljRFT34GBKp0VZdx4tZlNm+Ef74WTMRq5vQ5ZWvyA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B447E4B920BE Received: from eig-obgw-5001b.ext.cloudfilter.net ([10.0.29.181]) by cmsmtp with ESMTPS id HctPwoCHKrDqVHoBRw4gsL; Tue, 28 Apr 2026 19:33:25 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id HoBOwBFkAI7vWHoBOwi1ak; Tue, 28 Apr 2026 19:33:22 +0000 X-Authority-Analysis: v=2.4 cv=T6WMT+KQ c=1 sm=1 tr=0 ts=69f10b85 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=A5OVakUREuEA:10 a=ItBw4LHWJt0A:10 a=CCpqsmhAAAAA:8 a=7d_E57ReAAAA:8 a=zstS-IiYAAAA:8 a=t6FakJnSY_00Lat0I5QA:9 a=ul9cdbp4aOFLsgKbc677:22 a=jhqOcbufqs7Y1TYCrUUU:22 a=4G6NA9xxw8l3yy4pmD5M:22 a=DCx65vhANUyCzuf5D8fC:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=BRkO8K4X+8SZCddKrIf2NHfPUkG5iIM4ezYVAetEXdM=; b=yQIgGzzRpiErMn/dqIbwbHgdMN Djr0XG/3SQnvn9z43ucjZZ5D0rRGnhGc7DsEVMwz16kl4BPPpxPjxJtPg3SNWu1RI+LzjmsVRusxL XsKzfxnJNS78DWbEVPFaJ/oxj; Received: from 75-166-225-82.hlrn.qwest.net ([75.166.225.82]:50402 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wHoBN-00000002sfR-41zC; Tue, 28 Apr 2026 13:33:22 -0600 From: Tom Tromey To: Simon Marchi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v2 8/8] gdb/dwarf: read foreign type units In-Reply-To: <20260416200256.386186-9-simon.marchi@efficios.com> (Simon Marchi's message of "Thu, 16 Apr 2026 15:59:11 -0400") References: <20260316232042.368080-1-simon.marchi@polymtl.ca> <20260416200256.386186-1-simon.marchi@efficios.com> <20260416200256.386186-9-simon.marchi@efficios.com> X-Attribution: Tom Date: Tue, 28 Apr 2026 13:33:20 -0600 Message-ID: <871pfykhhb.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 75.166.225.82 X-Source-L: No X-Exim-ID: 1wHoBN-00000002sfR-41zC X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-166-225-82.hlrn.qwest.net (bapiya) [75.166.225.82]:50402 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfNLOx5tJV+bjJQapth++sU7oJNFdET5aIB8Q8I7m4FXBxPcFq3xDq+m+kjDRMdJLtg6NHQyk4wvYneAZaB1pVO35M0ZKvvvDobe+1NXGGiw1O4RyYnSc 6XeQZI2zUriJv/pBMI6SdnCBW0Vnphg+29NInSNn+QWiWlFzCQBmFAxMP1fFz4t6OkeQOw2/r4sISDAGZWSCic/DapVBl9z09Fg= X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org >>>>> "Simon" == Simon Marchi writes: Simon> However, I know that the current GDB DWARF reader is not able to load Simon> multiple type units with the same signature but different content. Once Simon> it loads one type unit with a given signature, all subsequent references Simon> to that signature will use that loaded type unit. FWIW this seems completely sensible to me, since the whole idea of signatured types is to exploit ODR and linker features to reduce the size of the DWARF. Simon> Setting a dwarf2_per_cu's section a posteriori breaks the assumed Simon> ordering of the dwarf2_per_bfd::all_units vector. After setting the Simon> section, re-sort the vector. I'm not a huge fan of this but I guess we can live with it. Simon> There is one known failure that I am unable to get to the bottom of. It Simon> seems orthogonal to my change though, more like an indexer or symbol Simon> reader issue. There are maybe more of this kind, but this is one Simon> example: Simon> FAIL: gdb.ada/tick_length_array_enum_idx.exp: ptype variable_table'length (GDB internal error) Simon> /home/smarchi/src/binutils-gdb/gdb/dwarf2/read.c:1839: internal-error: search_one: Assertion `symtab != nullptr' failed. See https://sourceware.org/bugzilla/show_bug.cgi?id=31648 Not really the same, but the same test case, so I kind of suspect that older compilers had some issue here. Though: Simon> The issue seems sensitive to some aspects of the environment (gnat Simon> version?). I am able to reproduce the issue on Arch Linux (gnat 15) Simon> with: Simon> $ make check TESTS="gdb.ada/tick_length_array_enum_idx.exp" RUNTESTFLAGS="--target_board=dwarf5-fission-debug-types-debug-names" Simon> But it doesn't reproduce on Debian 13 (gnat 14), Ubuntu 24.04 (gnat Simon> 13) or Fedora Rawhide (gnat 16). ... this goes against my thinking here. One question is whether this compiler defaults to "minimal" encodings or GNAT encodings. Simon> + /* A convenience function to allocate a signatured_type. The Simon> + returned object has its "index" field set properly. Simon> + I don't really understand how the index field even really makes sense any more, because now the vector is sorted after the fact. Not that this is new with this change, just pointing out that it seems incoherent with the description of the field: /* Our index in the unshared "symtabs" vector. */ Like is this still true? Approved-By: Tom Tromey Tom