From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 38147 invoked by alias); 16 Nov 2018 13:19:13 -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 37402 invoked by uid 89); 16 Nov 2018 13:19:13 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=H*F:D*ca, 20181023, 2018-10-23, Keith 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; Fri, 16 Nov 2018 13:19:12 +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 wAGDJ5Ij008629 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 16 Nov 2018 08:19:10 -0500 Received: by simark.ca (Postfix, from userid 112) id 5BE321E74D; Fri, 16 Nov 2018 08:19:05 -0500 (EST) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id DA5671E182; Fri, 16 Nov 2018 08:19:04 -0500 (EST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 16 Nov 2018 13:19:00 -0000 From: Simon Marchi To: Keith Seitz Cc: gdb-patches@sourceware.org Subject: Re: [RFC PATCH] Introduce dwarf2_cu::get_builder In-Reply-To: <20181023185715.23082-1-keiths@redhat.com> References: <20181023185715.23082-1-keiths@redhat.com> Message-ID: <077020e3a67e027bf358b899ba9ebdd4@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.6 X-IsSubscribed: yes X-SW-Source: 2018-11/txt/msg00250.txt.bz2 On 2018-10-23 14:57, Keith Seitz wrote: > This patch is an attempt to deal with a variety of bugs reported where > GDB segfaults attempting to access a dwarf2_cu's builder. In certain > circumstances, this builder can be NULL. > > The approach taken here is to save the ancestor CU into the dwarf2_cu > of > all CUs with DIEs that are "imported." This can happen whenever > follow_die_offset and friends are called. This essentially introduces > a > chain of CUs that caused the importation of a DIE from a CU. Whenever > a builder is requested of a CU that has none, the ancestors are > searched > for the first one with a builder. > > The bulk of the patch is relatively mindless text conversion from > "cu->builder" to "cu->get_builder ()". I've included one test which > was derived from one (of the many) bugs reported on the issue in both > sourceware and Fedora bugzillas. > > I'm submitting this as an RFC rather than an actual patch because of > the > lack of coverage testing for all the places where get_builder() is > used. Hi Keith, I can't give meaningful comments yet, because this deals with cases I'm not really used to. With the way you did it, I'm confident that the behavior will not change for existing cases, since we will end up using the same builder as before. Only in those cases where it would have been NULL (and thus would have caused a segfault) will the behavior change. And if it gives some good results for these cases, then it seems right. I noticed there were still some "naked" access to builder (places that don't use get_builder). fixup_go_packaging is one, for example. Is it expected or should they be converted too? Simon