From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id W6IfMESdkF/0IQAAWB0awg (envelope-from ) for ; Wed, 21 Oct 2020 16:42:44 -0400 Received: by simark.ca (Postfix, from userid 112) id B8ACA1EFC3; Wed, 21 Oct 2020 16:42:44 -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.4 required=5.0 tests=DKIM_SIGNED,MAILING_LIST_MULTI, RCVD_IN_BL_SPAMCOP_NET,T_DKIM_INVALID,URIBL_BLOCKED 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 678D41EFB9 for ; Wed, 21 Oct 2020 16:42:44 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1F56F3857C61; Wed, 21 Oct 2020 20:42:44 +0000 (GMT) Received: from gateway23.websitewelcome.com (gateway23.websitewelcome.com [192.185.49.60]) by sourceware.org (Postfix) with ESMTPS id A00683857C61 for ; Wed, 21 Oct 2020 20:42:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A00683857C61 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=tom@tromey.com Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway23.websitewelcome.com (Postfix) with ESMTP id 503D41720F for ; Wed, 21 Oct 2020 15:42:41 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id VKwTkfAKELFNkVKwTka2A0; Wed, 21 Oct 2020 15:42:41 -0500 X-Authority-Reason: nr=8 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:In-Reply-To:Date: References: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=0FRA4+DxAKym4vmWB0a7ABUwkA6Q28lX2KDKIPogPrE=; b=LQscbLrBG6Lz9yOfbPXP0NrlEG QJZOTp+9a9cP7hix1KrHD7a2xB5JwXqtt89siboKCptQgxH9xE2/EVPkPjLNVRtIQdBQD1klJTgWN FAHxgtTGsBKrEzHoLKB69yHK0; Received: from 75-166-102-113.hlrn.qwest.net ([75.166.102.113]:57416 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1kVKwT-000cOg-2C; Wed, 21 Oct 2020 14:42:41 -0600 From: Tom Tromey To: Simon Marchi via Gdb-patches Subject: Re: [PATCH v2] gdb/dwarf: fix reading subprogram with DW_AT_specification (PR gdb/26693) References: <20201020165055.93142-1-simon.marchi@polymtl.ca> X-Attribution: Tom Date: Wed, 21 Oct 2020 14:42:39 -0600 In-Reply-To: <20201020165055.93142-1-simon.marchi@polymtl.ca> (Simon Marchi via Gdb-patches's message of "Tue, 20 Oct 2020 12:50:55 -0400") Message-ID: <878sbzgvk0.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1.50 (gnu/linux) 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.102.113 X-Source-L: No X-Exim-ID: 1kVKwT-000cOg-2C X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-166-102-113.hlrn.qwest.net (murgatroyd) [75.166.102.113]:57416 X-Source-Auth: tom+tromey.com X-Email-Count: 3 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes 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: , Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" >>>>> "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. 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. Tom