From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Aleksandar Ristovski <aristovski@qnx.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: [draft patch 0/6] Split FYI and some review notes
Date: Sun, 10 Mar 2013 21:07:00 -0000 [thread overview]
Message-ID: <20130310210734.GA21130@host2.jankratochvil.net> (raw)
In-Reply-To: <51278984.3070208@qnx.com>
Hello Aleksandar,
to send something here is some draft, there will be still some changes.
I had first difficulties to apply it to FSF GDB HEAD as it has some conflicts
so I had to rebase it first.
It is not a normal review as your patch has merged code moves + code
modifications which is unreviewable. Moves and modifications need to be in
separate patches so that one can see what has changed in the diff.
fileio_read_stralloc you have reimplemented for gdbserver; I have rather
chosen to generalize the gdb/ variant and call the same common/ code from both
gdb and gdbserver. One may ask whether it is not more complicated than its
reimplementation, not sure.
By moving linux_find_memory_regions_full you have dropped make_cleanup there.
Its use from GDB may now leak memory as its called FUNC may throw an
exception. I have put there 'void **memory_to_free_ptr' to make it reusable
from both gdb and gdbserver.
I tried to make the patches similar to your code so that one can diff the
result against your patch.
There were many code formatting little changes and also needless casts
(probably from C++).
For the last [draft patch 6/6] - things not done there yet:
get_dynamic already parses/scans PHDRs, you introduce new PHDR parser, they
should be merged.
get_hex_build_id must not be based on soname, moreover playing with realname
on it, it is too fragile. It should be based on addresses, you know that l_ld
is absolute address inside the library. So find maps/smaps entry containing
l_ld, subtract its file offset from vaddr and you have the ELF header address.
Do not run get_hex_build_id quadratically - currently for each library you
open and scan maps/smaps again. Probably the best approach is to scan all
l_ld addresses from r_debug first, then qsort them and then linearly match
them to the maps/smaps entries. I am not sure but I guess they still should
be returned to GDB in their original order from r_debug for some backward and
solib-svr4.c compatibility. Also Gary Benson is working on incremental shlib
transfers from gdbserver so that it does not clash too much (it will anyway).
While just quadratic computation would be in real world acceptable all the
open/read/close syscalls I find really needlessly expensive.
PT_NOTE segment contains arbitrary number of notes, up to its size. You check
only the first entry there.
On Fri, 22 Feb 2013 16:06:44 +0100, Aleksandar Ristovski wrote:
> As per Jan's request, this patch adds 'build-id' to the gdbserver
> response. The value is hex encoded string representing
> .note.gnu.build-id section of the corresponding shared library.
gdbserver reports PT_NOTE segment, not any section. gdbserver is dependent on
runtime information (segments), it cannot rely on debug/link information
(sections).
BTW ping me (possibly off-list) whether you plan to work on it now yourself or
whether I should be doing more of the changes described above; I sure have
also enough other work...
Thanks,
Jan
next prev parent reply other threads:[~2013-03-10 21:07 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 ` Jan Kratochvil [this message]
2013-03-11 14:25 ` [draft patch 0/6] Split FYI and some review notes 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 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: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: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
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 ` Gary Benson
2013-04-09 15:29 ` Aleksandar Ristovski
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=20130310210734.GA21130@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