From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 116916 invoked by alias); 7 Jan 2018 16:24:30 -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 116826 invoked by uid 89); 7 Jan 2018 16:24:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-7.0 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=20171210, 2017-12-10 X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 07 Jan 2018 16:24:21 +0000 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 w07GOCSI027512 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 7 Jan 2018 11:24:17 -0500 Received: by simark.ca (Postfix, from userid 112) id A954D1E5B7; Sun, 7 Jan 2018 11:24:12 -0500 (EST) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 4BEE81E525; Sun, 7 Jan 2018 11:24:02 -0500 (EST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 07 Jan 2018 16:24:00 -0000 From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: Re: [PATCH 1/2] Replace objfile field in dwarf2_cu and dwarf2_per_cu_data with dwarf2_per_objfile In-Reply-To: <20171210180936.10263-1-simon.marchi@polymtl.ca> References: <20171210180936.10263-1-simon.marchi@polymtl.ca> Message-ID: X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.2 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Sun, 7 Jan 2018 16:24:12 +0000 X-IsSubscribed: yes X-SW-Source: 2018-01/txt/msg00142.txt.bz2 On 2017-12-10 13:09, Simon Marchi wrote: > From: Simon Marchi > > The next patch aims to remove the dwarf2_per_objfile global. In many > functions, we need to find a way to get a reference to the current > dwarf2_per_objfile through the objects passed in parameters. Often, we > have > access to a dwarf2_cu or a dwarf2_per_cu_data. These objects have a > reference > to the objfile, through which we can get the dwarf2_per_objfile: > > dwarf2_per_objfile = ((struct dwarf2_per_objfile *) > objfile_data (objfile, dwarf2_objfile_data_key)); > > However, this is a bit cumbersome to do all over the place. It would > be > more logical if the dwarf2_cu and dwarf2_per_cu_data had a reference to > their dwarf2_per_objfile, which would then have a reference to the > objfile. It would be more in line with the object hierarchy, where > dwarf2_per_objfile owns the dwarf2_per_cu_data instances. We could > even remove the reference dwarf2_cu has to dwarf2_per_objfile, since we > can access dwarf2_per_objfile through dwarf2_cu::per_cu. > > In a graphical way, references would look like this after the current > patch: > > objfile <--- dwarf2_per_objfile <--- dwarf2_per_cu_data > | ^ > | | > `- dwarf2_cu > > This patch has been tested on the buildbot. I pushed these three patches in. It required a non-automatic, but still simple rebase. Simon