From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id SaaCFu/TQmktmgUAWB0awg (envelope-from ) for ; Wed, 17 Dec 2025 11:01:51 -0500 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=in7VPiX0; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 57F461E0B6; Wed, 17 Dec 2025 11:01:51 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham 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 E41301E08D for ; Wed, 17 Dec 2025 11:01:50 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 7829E4BA2E23 for ; Wed, 17 Dec 2025 16:01:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7829E4BA2E23 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=in7VPiX0 Received: from omta036.useast.a.cloudfilter.net (omta036.useast.a.cloudfilter.net [44.202.169.35]) by sourceware.org (Postfix) with ESMTPS id C6FC94BA2E34 for ; Wed, 17 Dec 2025 16:01:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C6FC94BA2E34 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 C6FC94BA2E34 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1765987282; cv=none; b=PSp8K2NIa76VudsOpjl993Ul+YU6RE0ZFFvpZWD1aaOy2b+hO6uVWQPzFTRGUHpxN9SmNlcfeCpo27dZqWiRIOcfah+x0goD5ifO5YVr07OUF50hyzEWim2hE7Q5rIBgGQTmu+B/bLwOgBMjVxPyNE45R6RaVDEDRdGB6Jne95E= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1765987282; c=relaxed/simple; bh=AWGdD5Yp8H1kim25eCXk5JBeO1/O7ar5yoBd+yjVD8U=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=RIqPiDr4M1kLPXciMQT4Jpr/tPkHD/fVcSl+aozrKAONm9mYTbozj0/d9KTK1hKQmzreAmtPPhVC8Fse4RypVZPHwuQzlmEhdIJ8BM/+byhsa8ILMZkFhCz0e+fFBlHeTMMNYszmAAi7x8JCykmmzlxf2cIJrVZ1EYV1wiouKZE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C6FC94BA2E34 Received: from eig-obgw-6007b.ext.cloudfilter.net ([10.0.30.166]) by cmsmtp with ESMTPS id VATyvxCHBKXDJVtxqvu63T; Wed, 17 Dec 2025 16:01:22 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id Vtxpvsyk7h8QWVtxpvYmFG; Wed, 17 Dec 2025 16:01:22 +0000 X-Authority-Analysis: v=2.4 cv=Mcdsu4/f c=1 sm=1 tr=0 ts=6942d3d2 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=wP3pNCr1ah4A:10 a=ItBw4LHWJt0A:10 a=_ZhYKdCeAAAA:8 a=9ENPgM4trmqU07AX6zUA:9 a=uqOk3ZSnBfCTOznnrPA1: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=QiGfO0Rv7Igw4lPOE4FgjIfoEXwofq3kj77xLKQumoI=; b=in7VPiX0A2tY9HkVuiTAQA4KE4 0d0vaEMphvYsHMWPhmUjYvHF46rMD9yVWMaw2TYpIfY1TfZmoGP1LOUTS63GrQ1cNnWahOs3mz9y3 D/XR/OJrqq9BH9LwRwudUJEHi; Received: from 97-122-120-205.hlrn.qwest.net ([97.122.120.205]:43356 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vVtxm-00000000geL-1utP; Wed, 17 Dec 2025 09:01:18 -0700 From: Tom Tromey To: simon.marchi@polymtl.ca Cc: gdb-patches@sourceware.org, Simon Marchi Subject: Re: [PATCH] gdb: replace msym_bunch with deque In-Reply-To: <20251217043141.1790384-1-simon.marchi@polymtl.ca> (simon marchi's message of "Tue, 16 Dec 2025 23:31:39 -0500") References: <20251217043141.1790384-1-simon.marchi@polymtl.ca> X-Attribution: Tom Date: Wed, 17 Dec 2025 09:01:11 -0700 Message-ID: <87jyylyu60.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: 97.122.120.205 X-Source-L: No X-Exim-ID: 1vVtxm-00000000geL-1utP X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-120-205.hlrn.qwest.net (bapiya) [97.122.120.205]:43356 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: MS4xfLiLIN5Us4980+dfi6iFFdmS4q8BS2ANHi+WhPF5zzk2dkmAZm3/TQPMPUgZpb1NdVPmiKwSMRy/7517EabnG9VqYMum+kR0HzZxRH1Flt26EI+2U9M7 cNzga3O9zC8GnWYMWIClhtF0UoSXg2YxmlDQU5gcxlQ/cgX+StAFlKgJmYcS3oqpNuAiH+ZSeKqrUHJZINhZKQgEZNxu0+jAazE= 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> An std::deque implementation typically uses a sequence of fixed-sized Simon> arrays, much like our current msym_bunch implementation. So adding an Simon> item at the end will not invalidate existing references. But unlike our Simon> msym_bunch, we don't have to worry about memory management. FWIW we have another instance of this idiom in buildsym. Simon> I am a bit puzzled about this code in Simon> minimal_symbol_reader::record_full: Simon> I am not sure when minsyms_read would already be true when reading Simon> minimal symbols, and if we should do anything differently here. It's been a long time since I worked on this, but IIRC there were readers where minimal symbol reading was mixed with partial symbol reading. In these cases we could reuse the already-read minimal symbols but not the partial symbols. This code, and the check in minimal_symbol_reader::install, were there to allow the reuse without creating new symbols. The particular check you highlighted is just based on the idea that the code is still trying to create a minimal symbol, but since it won't ever be installed, there's no point to allocating more memory, we can just reuse the same one over and over. It's possible all this is obsolete given the stabs removal. You'd have to investigate. But anyway all of this was a hack to avoid doing work on these ancient / obsolete readers. Simon> + /* The minimal symbols recorded so far. This uses a deque instead of e.g. a Simon> + vector, because references to minimal symbols need to stay valid across Simon> + calls to recod_full. */ Typo, "record_full" Tom