Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Aleksandar Ristovski <aristovski@qnx.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [patch 6/6] gdbserver build-id attribute generator
Date: Thu, 04 Apr 2013 02:22:00 -0000	[thread overview]
Message-ID: <20130403193258.GA9853@host2.jankratochvil.net> (raw)
In-Reply-To: <515B05D8.1000003@qnx.com>

On Tue, 02 Apr 2013 18:22:48 +0200, Aleksandar Ristovski wrote:
> >>+static int
> >>+find_phdr_p (const void *const phdr, const int is_elf64,
> >>+		const void *const data)
> >
> >But I do not understand why this function exists - it could be integrated in
> >find_phdr as very every caller of find_phdr passse as find_phdr_p parameter
> >this find_phdr_p implementation.
> 
> 
> [AR] Yes, but I am eyeing solib-svr4.c loops over pheaders
> generalization - find_phdr could be moved to 'common' and possibly
> called 'iterate_phdrs' with the ability to pass in any function, not
> necessarily a predicate only. E.g. svr4_exec_displacement, etc...)

It is not relevant for this patch what do you plan.  In the form as is it is
needlessly overcomplicated.  That more thorough generalization would be
possibly good but it is not here and it may never happen.  GDB will just
remain with needlessly complicated code.



> >You need to check here also the name content, it is "GNU\x00" (n_namesz == 4).
> 
> [AR], can it be any other name if type is NT_GNU_BUILD_ID? Added the
> check but seems like an overkill to me.

NT_GNU_BUILD_ID is just number 3.  I find very realistic for example
"SUNW Solaris" would use at least 3 note types (does not use it already?).


> >>+/* Linear reverse find starting from RBEGIN towards REND looking for
> >>+   the lowest vaddr mapping of the same inode and zero offset.  */
> >>+
> >>+static mapping_entry_s *
> >>+lrfind_mapping_entry (mapping_entry_s *const rbegin,
> >>+		      const mapping_entry_s *const rend)
> >>+{
> >>+  mapping_entry_s *p;
> >>+
> >>+  for (p = rbegin - 1; p >= rend && p->inode == rbegin->inode; --p)
> >>+    if (p->offset == 0)
> >>+      return p;
> >
> >I had here this layout:
> >7ffff7ddc000-7ffff7dfd000 r-xp 00000000 fd:01 51415762                   /usr/lib64/ld-2.17.so
> >7ffff7ff9000-7ffff7ffa000 rw-p 00000000 00:00 0
> >7ffff7ffa000-7ffff7ffc000 r-xp 00000000 00:00 0                          [vdso]
> >7ffff7ffc000-7ffff7ffe000 rw-p 00020000 fd:01 51415762                   /usr/lib64/ld-2.17.so
> >
> >so it should rather be:
> >   for (p = rbegin - 1; p >= rend; --p)
> >     if (p->offset == 0 && p->inode == rbegin->inode)
> >       return p;
> >
> >Fortunately it should not have any real performance impact.
> 
> [AR] Ok, though we are not adding mappings with inode == 0. See
> 'find_memory_region_callback'.

Hmm, that's true, I do not see now why it failed for me.  But that could be
even non-zero-inode mapping so a change was appropriate.


This is not yet a full review.


Thanks,
Jan


  reply	other threads:[~2013-04-03 19:33 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-22 15:07 [patch] gdbserver build-id in qxfer_libraries reply Aleksandar Ristovski
2013-02-22 18:39 ` Aleksandar Ristovski
2013-02-26 12:01   ` Pedro Alves
2013-02-27 17:25     ` Aleksandar Ristovski
2013-02-27 17:31       ` Aleksandar Ristovski
2013-02-27 18:44       ` Eli Zaretskii
2013-03-10 21:07 ` [draft patch 0/6] Split FYI and some review notes Jan Kratochvil
2013-03-11 14:25   ` Aleksandar Ristovski
2013-03-11 15:07     ` Jan Kratochvil
2013-03-14 18:43       ` Gary Benson
2013-03-14 19:55         ` Tom Tromey
2013-03-15 15:35         ` Aleksandar Ristovski
2013-03-15 15:44   ` Aleksandar Ristovski
2013-03-15 15:38     ` Aleksandar Ristovski
2013-03-15 16:28     ` Jan Kratochvil
2013-03-15 16:43       ` Aleksandar Ristovski
2013-03-10 21:08 ` [draft patch 2/6] Merge multiple hex conversions Jan Kratochvil
2013-03-22 13:05   ` [patch " Aleksandar Ristovski
2013-04-05 16:07     ` Aleksandar Ristovski
2013-03-10 21:08 ` [draft patch 1/6] Move utility functions to common/ Jan Kratochvil
2013-03-22 13:13   ` [patch " Aleksandar Ristovski
2013-03-22 13:05     ` Aleksandar Ristovski
2013-04-07 18:54     ` Aleksandar Ristovski
2013-04-05 13:06       ` Aleksandar Ristovski
2013-03-10 21:08 ` [draft patch 4/6] Prepare linux_find_memory_regions_full & co. for move Jan Kratochvil
2013-03-22 13:34   ` [patch " Aleksandar Ristovski
2013-03-22 13:54     ` Aleksandar Ristovski
2013-03-26 18:11     ` Jan Kratochvil
2013-03-27 20:44       ` Aleksandar Ristovski
2013-03-27 21:54         ` Aleksandar Ristovski
2013-03-28 23:02         ` Jan Kratochvil
2013-03-29  0:26           ` Aleksandar Ristovski
2013-03-29  0:29             ` Pedro Alves
2013-04-01 22:39           ` Aleksandar Ristovski
2013-04-01 21:13             ` Aleksandar Ristovski
2013-04-02 13:41             ` Jan Kratochvil
2013-04-02 13:41               ` Aleksandar Ristovski
2013-04-02 13:41                 ` Jan Kratochvil
2013-04-05 15:37                   ` Aleksandar Ristovski
2013-04-07 14:28                     ` Aleksandar Ristovski
2013-03-10 21:08 ` [draft patch 3/6] Create empty common/linux-maps.[ch] Jan Kratochvil
2013-03-22 14:54   ` [patch " Aleksandar Ristovski
2013-03-22 13:06     ` Aleksandar Ristovski
2013-04-05 13:25     ` Aleksandar Ristovski
2013-03-10 21:09 ` [draft patch 5/6] Move linux_find_memory_regions_full & co Jan Kratochvil
2013-03-22 13:05   ` [patch " Aleksandar Ristovski
2013-03-22 13:34     ` Aleksandar Ristovski
2013-03-26 18:27     ` Jan Kratochvil
2013-03-27 21:25       ` Aleksandar Ristovski
2013-03-28 22:38         ` Jan Kratochvil
2013-04-01 23:19           ` Aleksandar Ristovski
2013-04-02  2:33             ` Jan Kratochvil
2013-04-07 18:54               ` Aleksandar Ristovski
2013-04-05 15:37                 ` Aleksandar Ristovski
2013-04-02  2:33             ` Aleksandar Ristovski
2013-03-10 21:09 ` [draft patch 6/6] gdbserver build-id attribute generator (unfixed) Jan Kratochvil
2013-03-10 22:04   ` Eli Zaretskii
2013-03-22 13:05   ` [patch 6/6] gdbserver build-id attribute generator Aleksandar Ristovski
2013-03-22 15:19     ` Aleksandar Ristovski
2013-03-22 17:24     ` Eli Zaretskii
2013-03-26 23:45     ` Jan Kratochvil
2013-03-27 17:54       ` Aleksandar Ristovski
2013-03-27 18:08         ` Jan Kratochvil
2013-03-27 18:12           ` Eli Zaretskii
2013-03-27 20:46           ` Aleksandar Ristovski
2013-03-29  0:13             ` Aleksandar Ristovski
2013-03-29  0:20               ` Aleksandar Ristovski
2013-03-29 16:19               ` Jan Kratochvil
     [not found]               ` <20130331174322.GB21374@host2.jankratochvil.net>
2013-04-02 17:18                 ` Aleksandar Ristovski
2013-04-04  2:22                   ` Jan Kratochvil [this message]
2013-04-05 15:05                     ` Aleksandar Ristovski
2013-04-09 15:28                       ` Gary Benson
2013-04-09 15:28                         ` Jan Kratochvil
2013-04-09 15:29                           ` Aleksandar Ristovski
2013-04-09 15:29                           ` Gary Benson
2013-04-09 15:28                         ` Aleksandar Ristovski
2013-04-09 19:26                           ` Gary Benson
2013-04-12 15:28                             ` Jan Kratochvil
2013-04-04 16:08 ` [patch] gdbserver build-id in qxfer_libraries reply 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=20130403193258.GA9853@host2.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=aristovski@qnx.com \
    --cc=gdb-patches@sourceware.org \
    /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