From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lndn.lancelotsix.com (vps-42846194.vps.ovh.net [IPv6:2001:41d0:801:2000::2400]) by sourceware.org (Postfix) with ESMTPS id 6A1093847815 for ; Fri, 11 Jun 2021 23:07:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6A1093847815 Received: from Plymouth (unknown [IPv6:2a02:390:9086:0:ccd2:26d1:a133:8d62]) by lndn.lancelotsix.com (Postfix) with ESMTPSA id 153FB818D5; Fri, 11 Jun 2021 23:07:25 +0000 (UTC) Date: Sat, 12 Jun 2021 00:07:21 +0100 From: Lancelot SIX To: Wei-min Pan Cc: gdb-patches@sourceware.org Subject: Re: [PATCH V5] CTF: multi-CU and archive support Message-ID: <20210611230721.vzlpo5u4umczi57g@Plymouth> References: <1621297225-2332-1-git-send-email-weimin.pan@oracle.com> <20210610003512.auljolwwl5tmcrvx@Plymouth> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.11 (lndn.lancelotsix.com [0.0.0.0]); Fri, 11 Jun 2021 23:07:25 +0000 (UTC) X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_PASS, TXREP, URI_HEX autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-List-Received-Date: Fri, 11 Jun 2021 23:07:28 -0000 > Hi, > > You can find the latest gcc patch series for CTF support, which is currently > under review, here: > > http://gcc.1065356.n8.nabble.com/PATCH-V9-0-7-Support-for-the-CTF-and-BTF-debug-formats-td1897109.html > > Also please make sure to use a binutils version with CTF support. > Hi, Thanks for the pointer. Now that I have a ctf-aware gcc, I can give a first try to the patch. It looks like the flag to enable CTF generation (at least in this version of the GCC patch set) is '-gctf', not '-gt'. The '-gt' flag is currently used in the tests to detect if the compiler supports CTF (in gdb/testsuite/lib/gdb.exp). In the current situation, tests are skipped with GCC master + CTF. We might want to wait for GCC to settle on the flag, and update tests codebase as well as this patch. > > I believe  the psymtab_discarder's dtor should take care of discarding all > built partial > symbol tables. So I'm not sure if this is a CTF specific issue. > It is taken care of by psymtab_storage::~psymtab_storage which is eventually triggered by the dtor of objfile. I did not dig enough before sending the email. Sorry for that. > One way to avoid dealing with either the storage or dtor issue is to > declare: > >         struct ctf_context context; > > in struct ctf_psymtab. Yes, this would work. However, considering what I missed with the memory management of the psymtab and given that ctf_context is a POD type, everything should properly come down with the dtor of objfile. So after reconsidering I believe your proposition should works. Lancelot.