From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 72838 invoked by alias); 10 Jan 2018 16:32:07 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 72725 invoked by uid 89); 10 Jan 2018 16:32:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: gateway24.websitewelcome.com Received: from gateway24.websitewelcome.com (HELO gateway24.websitewelcome.com) (192.185.50.84) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 10 Jan 2018 16:32:04 +0000 Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway24.websitewelcome.com (Postfix) with ESMTP id D607013AC7AD for ; Wed, 10 Jan 2018 10:32:01 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id ZJIHeNveUzzFjZJIHe6EUx; Wed, 10 Jan 2018 10:32:01 -0600 Received: from 71-218-90-63.hlrn.qwest.net ([71.218.90.63]:36586 helo=pokyo) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1eZJIH-000iAc-K9; Wed, 10 Jan 2018 10:32:01 -0600 From: Tom Tromey To: Yao Qi Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [RFA 5/6] Remove objfile argument from add_dyn_prop References: <20180106002621.21099-1-tom@tromey.com> <20180106002621.21099-6-tom@tromey.com> <86wp0pg95s.fsf@gmail.com> Date: Wed, 10 Jan 2018 16:32:00 -0000 In-Reply-To: <86wp0pg95s.fsf@gmail.com> (Yao Qi's message of "Wed, 10 Jan 2018 13:01:19 +0000") Message-ID: <87mv1lisjj.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BWhitelist: no X-Source-L: No X-Exim-ID: 1eZJIH-000iAc-K9 X-Source-Sender: 71-218-90-63.hlrn.qwest.net (pokyo) [71.218.90.63]:36586 X-Source-Auth: tom+tromey.com X-Email-Count: 9 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-SW-Source: 2018-01/txt/msg00203.txt.bz2 >>>>> "Yao" == Yao Qi writes: Yao> Tom Tromey writes: >> @@ -25116,7 +25116,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) >> if (attr_form_is_block (attr)) >> { >> if (attr_to_dynamic_prop (attr, die, cu, &prop)) >> - add_dyn_prop (DYN_PROP_ALLOCATED, prop, type, objfile); >> + add_dyn_prop (DYN_PROP_ALLOCATED, prop, type); >> } Yao> Before the patch, the objfile is Yao> cu-> per_cu->dwarf2_per_objfile->objfile, but after the patch, the Yao> objfile is TYPE_OBJFILE (type), are they equivalent? If they were not the same, then that was already a bug, because types generally have the restriction that they can only point to static data or to other objects allocated on the same objfile. Cross-objfile pointers are not allowed, to avoid dangling pointers when an objfile is destroyed. Now, a given invocation of the DWARF reader generally deals with a single objfile. So I believe they were the same. But if they were not, then this patch actually improves the situation. Tom