From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 5kSjFMPsw2DMEwAAWB0awg (envelope-from ) for ; Fri, 11 Jun 2021 19:07:47 -0400 Received: by simark.ca (Postfix, from userid 112) id 44A551F163; Fri, 11 Jun 2021 19:07:47 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED,URI_HEX autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.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 EC63C1E813 for ; Fri, 11 Jun 2021 19:07:46 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 71911383F408 for ; Fri, 11 Jun 2021 23:07:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 71911383F408 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623452866; bh=CCYyXiBie/jWy4wIApryEZ89Y/a/6RdtJZnvaFL/gzo=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=k4R2ZhzBIXcWPowaICw+1jVVQC5m0y4kKLmzfgDO/bseyATCF+dfn4fJJUS6jrIEV bwqw8ARX15gzoWgZy5aHQklrPnxiTXoe+/4NL+cZ6XlmpSMCUFolPMB71zApUPQfRq auIsEYbv4UfgPqbpb8qVAppIVAROH5Osog1zJsdA= 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 To: Wei-min Pan 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-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: Lancelot SIX via Gdb-patches Reply-To: Lancelot SIX Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" > 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.