From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id RT26D17wkF9iKwAAWB0awg (envelope-from ) for ; Wed, 21 Oct 2020 22:37:18 -0400 Received: by simark.ca (Postfix, from userid 112) id 302271EFC3; Wed, 21 Oct 2020 22:37:18 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham 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 249051E58E for ; Wed, 21 Oct 2020 22:37:17 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 72B713857C5C; Thu, 22 Oct 2020 02:37:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 72B713857C5C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1603334236; bh=hdECcmf6hKijrtIRtE+zyWLo1bnfV5g0MI7CAFjFE44=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=As8ChzWE581t4J1OD1sgCacXb/AsSZVoVVaAsrPdsPH/yXdqeTUh6/3JTcg+SQNPe 5MU5+wa7vkN6SRA00UyFDzNYKg0/WtONjqdPmmgD6yU3pAFoEqiYnXDXGhdIyGEp6h 1/uezLDkj7CXBDI4rhhXUYq+p5SWwCMe9FNxEZZg= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 99C1C3857C5C for ; Thu, 22 Oct 2020 02:37:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 99C1C3857C5C Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 09M2b8pk015798 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Oct 2020 22:37:12 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 09M2b8pk015798 Received: from [10.0.0.11] (173-246-6-90.qc.cable.ebox.net [173.246.6.90]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id AD6C51E58E; Wed, 21 Oct 2020 22:37:07 -0400 (EDT) Subject: Re: [PATCH v2] gdb/dwarf: fix reading subprogram with DW_AT_specification (PR gdb/26693) To: Tom Tromey , Simon Marchi via Gdb-patches References: <20201020165055.93142-1-simon.marchi@polymtl.ca> <878sbzgvk0.fsf@tromey.com> Message-ID: Date: Wed, 21 Oct 2020 22:37:07 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <878sbzgvk0.fsf@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 22 Oct 2020 02:37:08 +0000 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: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 2020-10-21 4:42 p.m., Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi via Gdb-patches writes: > > Simon> 0x00000014: DW_TAG_subprogram > Simon> DW_AT_name [DW_FORM_string] ("apply") > > Simon> 0x0000001b: DW_TAG_subprogram > Simon> DW_AT_specification [DW_FORM_ref4] (0x00000014 "apply") > > gdb currently goes through a lot of work to support DWARF like this, but > I wish it didn't have to. It complicates the DWARF reader -- but IIRC > both gcc and clang just emit specializations with names like > "apply". So, I wonder if we could drop support for this at some > point. The object that contained this kind of DWARF, that made GDB crash, was compiled with ICC. So unless we decide to drop support for ICC, I don't think we can get rid of it any time soon. > Simon> Since the caller of load_full_comp_unit knows about the existing > Simon> dwarf2_cu object for the CU we are reading (the one load_full_comp_unit > Simon> is expected to find), we can simply make it pass it down, instead of > Simon> having load_full_comp_unit look up the per-objfile map. > > Sounds reasonable. > > Simon> @@ -9231,12 +9233,12 @@ die_eq (const void *item_lhs, const void *item_rhs) > Simon> static void > Simon> load_full_comp_unit (dwarf2_per_cu_data *this_cu, > Simon> dwarf2_per_objfile *per_objfile, > Simon> + dwarf2_cu *existing_cu, > > I think a comment explaining why this is needed would be really helpful. > > The patch looks good to me. Thank you very much for the detailed > explanation. I would write this, does that sound good? /* Load the DIEs associated with PER_CU into memory. In some cases, the caller, while reading partial symbols, will need to load the full symbols for the CU for some reason. It will already have a dwarf2_cu object for THIS_CU and pass it as EXISTING_CU, so it can be re-used rather than creating a new one. */ Thanks for the review. Simon