public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches <gdb-patches@sourceware.org>,
	Aleksandar Ristovski <ARistovski@qnx.com>
Subject: Re: [PATCH v8 09/10] Validate symbol file using build-id
Date: Wed, 08 Jul 2015 15:40:00 -0000	[thread overview]
Message-ID: <CADPb22RfDHs4823GUtPFaqHbXCUjmpty+BULzzJxGMVss32bWA@mail.gmail.com> (raw)
In-Reply-To: <20150627210519.GA19048@host1.jankratochvil.net>

On Sat, Jun 27, 2015 at 4:05 PM, Jan Kratochvil
<jan.kratochvil@redhat.com> wrote:
> On Tue, 23 Jun 2015 00:25:52 +0200, Doug Evans wrote:
>> On Sun, Jun 21, 2015 at 5:16 AM, Jan Kratochvil <jan.kratochvil@redhat.com> 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.

  reply	other threads:[~2015-07-08 15:40 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-14 19:25 [PATCH v7 00/10] Validate binary before use Jan Kratochvil
2015-06-14 19:25 ` [PATCH v7 01/10] Move utility functions to common/ Jan Kratochvil
2015-06-15 13:22   ` Joel Brobecker
2015-06-15 15:07     ` [commit] " Jan Kratochvil
2015-06-14 19:26 ` [PATCH v7 05/10] Move gdb_regex* " Jan Kratochvil
2015-07-08 14:39   ` Pedro Alves
2015-07-14 20:13     ` Jan Kratochvil
2015-06-14 19:26 ` [PATCH v7 04/10] Create empty nat/linux-maps.[ch] and common/target-utils.[ch] Jan Kratochvil
2015-06-14 19:26 ` [PATCH v7 06/10] Prepare linux_find_memory_regions_full & co. for move Jan Kratochvil
2015-06-14 19:26 ` [PATCH v7 02/10] Merge multiple hex conversions Jan Kratochvil
2015-06-15 13:33   ` Joel Brobecker
2015-06-15 15:09     ` [commit] " Jan Kratochvil
2015-06-14 19:26 ` [PATCH v7 03/10] Code cleanup: Rename enum -> enum filterflags Jan Kratochvil
2015-06-15 13:34   ` Joel Brobecker
2015-06-15 15:12     ` [commit] " Jan Kratochvil
2015-07-08 14:38   ` Pedro Alves
2015-06-14 19:26 ` [PATCH v7 07/10] Move linux_find_memory_regions_full & co Jan Kratochvil
2015-06-14 19:27 ` [PATCH v7 09/10] Validate symbol file using build-id Jan Kratochvil
2015-06-21 10:16   ` [PATCH v8 " Jan Kratochvil
2015-06-22 12:55     ` Aleksandar Ristovski
2015-06-22 20:37       ` Jan Kratochvil
2015-06-22 20:41         ` Aleksandar Ristovski
2015-06-22 22:25     ` Doug Evans
2015-06-23 20:47       ` Jan Kratochvil
2015-07-08 14:44         ` Pedro Alves
2015-07-12 19:09           ` Jan Kratochvil
2015-07-12 19:29             ` [PATCH v9 " Jan Kratochvil
2015-07-12 19:54               ` Eli Zaretskii
2015-07-12 20:01                 ` Jan Kratochvil
2015-07-13  2:30                   ` Eli Zaretskii
2015-07-13 10:34                 ` Pedro Alves
2015-07-13 12:38                   ` Jan Kratochvil
2015-07-14 16:14                     ` Doug Evans
2015-07-15  8:21                       ` Jan Kratochvil
2015-07-15 14:59                         ` Doug Evans
2015-06-27 21:05       ` [PATCH v8 " Jan Kratochvil
2015-07-08 15:40         ` Doug Evans [this message]
2015-07-12 19:27           ` Jan Kratochvil
2015-06-14 19:27 ` [PATCH v7 08/10] gdbserver build-id attribute generator Jan Kratochvil
2015-07-08 14:41   ` Pedro Alves
2015-06-14 19:27 ` [PATCH v7 10/10] Tests for validate symbol file using build-id Jan Kratochvil
2015-07-08 14:44   ` Pedro Alves
2015-07-15 16:36 ` [commit] [PATCH v7 00/10] Validate binary before use Jan Kratochvil
2015-07-15 18:33   ` [revert] " Jan Kratochvil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADPb22RfDHs4823GUtPFaqHbXCUjmpty+BULzzJxGMVss32bWA@mail.gmail.com \
    --to=dje@google.com \
    --cc=ARistovski@qnx.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).