From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 62006 invoked by alias); 27 Jan 2020 19:02:02 -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 61997 invoked by uid 89); 27 Jan 2020 19:02:02 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=his X-HELO: us-smtp-1.mimecast.com Received: from us-smtp-delivery-1.mimecast.com (HELO us-smtp-1.mimecast.com) (205.139.110.120) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 27 Jan 2020 19:02:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580151719; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mfupsHWIJprukYRiStRDKPJ1YMa3/kngmSUaPupYEFQ=; b=E4mdNgi8T2fJEZsBvQbzzh3oSfN0bw0Yfd1AnaSHbEuPn3qbMmVkUKGjL6A/FT3cNFjeDA 67aLFft2QNdCd8Fq65fMJ5aSHHLlJtKzyETtHcecRGnX8F9khNY4YD/cDqzRiuUITu6e5n 9B+dZgDvb51MuDISjxSVuAuxDBPA4II= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-336-Wjemb-IyNQeW6g401YQ-SQ-1; Mon, 27 Jan 2020 14:01:58 -0500 Received: by mail-wm1-f70.google.com with SMTP id g26so1788303wmk.6 for ; Mon, 27 Jan 2020 11:01:57 -0800 (PST) Return-Path: Received: from ?IPv6:2001:8a0:f909:7b00:56ee:75ff:fe8d:232b? ([2001:8a0:f909:7b00:56ee:75ff:fe8d:232b]) by smtp.gmail.com with ESMTPSA id e12sm22015959wrn.56.2020.01.27.11.01.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Jan 2020 11:01:56 -0800 (PST) Subject: Re: [PATCH] gdb: Reinitialize objfile::section_offsets during objfile reload To: Tom Tromey , Andrew Burgess References: <20200125225555.16846-1-andrew.burgess@embecosm.com> <875zgy6vo5.fsf@tromey.com> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: Date: Mon, 27 Jan 2020 19:07:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <875zgy6vo5.fsf@tromey.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2020-01/txt/msg00885.txt.bz2 On 1/26/20 4:15 PM, Tom Tromey wrote: > Andrew> One thing I did wonder about while looking at this fix is whether it > Andrew> would be possible to combine at least parts of syms_from_objfile_1 > Andrew> with the core of reread_symbols. I did have a go at doing this but > Andrew> gave up in the end due to the subtle differences between the two. > Andrew> Still, I think that with some more effort this might be possible, and > Andrew> this could be a nice clean up. > > A long time ago, Jan had a patch along these lines. > I believe what his did was just throw away the logic in reread_symbols > in favor of simply creating a new objfile. I wonder if it's too late to > do this now, since objfiles are exposed to Python. IIRC, that patch walked all the places that store objfile pointers, to recreate the objfiles. IMO, an approach that avoids that would be better. > > Anyway, IMO, if there are subtle differences, they are probably bugs of > some sort; and unifying these code paths seems like clearly the right > thing to do. Agreed. Thanks, Pedro Alves