From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 130772 invoked by alias); 8 Jul 2015 15:40: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 130692 invoked by uid 89); 8 Jul 2015 15:39:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-HELO: mail-wi0-f174.google.com Received: from mail-wi0-f174.google.com (HELO mail-wi0-f174.google.com) (209.85.212.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 08 Jul 2015 15:39:58 +0000 Received: by wibdq8 with SMTP id dq8so216704330wib.1 for ; Wed, 08 Jul 2015 08:39:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=Oa9ip9TJZHtZewfAfnkYciT9ByzQIpLWY4fIYU6Vqrc=; b=W8zVZ4XEHH2pJodXzfcCM5CJpf/c4BXWtgYwEGmYFLiRBkNxA0ZZMO6kvTB/9PWWvd tP4YpmtsG3l6Y+vZ9hnhwQZvYAms4gh0nQW4w0WdDyVMBp1wsuEeDW7LOImhJvy58PBx 4ASyqpou/3jhaWqhPwN6fNtWjIAo1CBd6QeXEjSGvcnmIA0eN2eZCCnu3yHHrrQ6Iq2e 5nVzOxlkZKsw4jw+lhSRdhETmx5nQm3Ac8rUGsOIoy40nFvG0wlouDgA5308O2MqkUNf Z5ah9wNrE7PuZALSRUxYfchOKGvm84NFMi8fzBbKfJwML2Gc5AQ85CbV/DiqldMM9GBA Ephw== X-Gm-Message-State: ALoCoQnzQR3kl3QRKz4KBAbLglHuDHQm/zSIOXbRaY6v8kPXsmsBd50K/OpNewifu+3LyuDAHka1 X-Received: by 10.194.246.105 with SMTP id xv9mr20987713wjc.135.1436369994916; Wed, 08 Jul 2015 08:39:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.103.134 with HTTP; Wed, 8 Jul 2015 08:39:14 -0700 (PDT) In-Reply-To: <20150627210519.GA19048@host1.jankratochvil.net> References: <20150614192542.18346.87859.stgit@host1.jankratochvil.net> <20150614192655.18346.17075.stgit@host1.jankratochvil.net> <20150621101644.GA12733@host1.jankratochvil.net> <20150627210519.GA19048@host1.jankratochvil.net> From: Doug Evans Date: Wed, 08 Jul 2015 15:40:00 -0000 Message-ID: Subject: Re: [PATCH v8 09/10] Validate symbol file using build-id To: Jan Kratochvil Cc: gdb-patches , Aleksandar Ristovski Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-07/txt/msg00226.txt.bz2 On Sat, Jun 27, 2015 at 4:05 PM, Jan Kratochvil wrote: > On Tue, 23 Jun 2015 00:25:52 +0200, Doug Evans wrote: >> On Sun, Jun 21, 2015 at 5:16 AM, Jan Kratochvil wrote: >> > --- a/gdb/solist.h >> > +++ b/gdb/solist.h >> > @@ -75,6 +75,22 @@ struct so_list >> > There may not be just one (e.g. if two segments are relocated >> > differently); but this is only used for "info sharedlibrary". */ >> > CORE_ADDR addr_low, addr_high; >> > + >> > + /* Build id in raw format, contains verbatim contents of >> > + .note.gnu.build-id including note header. >> >> Including the note header will be confusing to readers. >> Is there a reason to include it? >> >> OTOH, given the above call to hex2bin, >> does this really include the note header? > > It does not, only the comment was wrong. Changed it to: > /* Build id decoded from .note.gnu.build-id without note header. This is > actual BUILD_ID which comes either from the remote target via qXfer > > >> > ... This is actual >> > + BUILD_ID which comes either from the remote target via qXfer >> > + packet or via reading target memory. Therefore, it may differ >> > + from the build-id of the associated bfd. In a normal >> > + scenario, this so would soon lose its abfd due to failed >> > + validation. >> >> I can't read this last sentence. >> What are you trying to say here? > > It was written by Aleksandar Ristovski and I find it OK myself. > So as an explanation the process is: > > 1. GDB reads/receives so->build_id from GDB server. > 2. GDB opens local BFD so->abfd. > 3. GDB compares so->build_id with so->abfd->build_id (by ops->validate) > 4. If they differ so->abfd is freed/cleared (in solib_map_sections). > > Therefore could you suggest a different comment? I'd be ok with just deleting the last two sentences: This is actual BUILD_ID which comes either from the remote target via qXfer packet or via reading target memory. But if you want more I'm ok with: This is actual BUILD_ID which comes either from the remote target via qXfer packet or via reading target memory. Note that if there's a mismatch with the associated bfd then so->abfd will be cleared.