From: Gary Benson <gbenson@redhat.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA 4/4 take 2] Improved linker-debugger interface
Date: Fri, 28 Sep 2012 10:51:00 -0000 [thread overview]
Message-ID: <20120928105145.GA3465@redhat.com> (raw)
In-Reply-To: <20120921144543.GA23658@host2.jankratochvil.net>
Jan Kratochvil wrote:
> On Fri, 21 Sep 2012 14:35:56 +0200, Gary Benson wrote:
> > I've also passed --with-expat to force the issue. I'm not seeing the
> > XML warning any more, but the tests are still using the probes code
> > and not the code from linux-low.c.
>
> The tests are using linux-low.c:
>
> ../gdb gdb.base/break-probes -ex 'target remote localhost:1234' -ex 'set stop-on-solib-events 1' -ex 'set debug remote 1' -ex c
> [...]
> Sending packet: $qXfer:libraries-svr4:read::0,fff#91...Packet received: l<library-list-svr4 version="1.0" main-lm="0x7ffff7ffe2a8"><library name="/lib64/ld-linux-x86-64.so.2" lm="0x7ffff7ffd998" l_addr="0x7ffff7ddc000" l_ld="0x7ffff7ffcdd8"/></library-list-svr4>
> SVR4:PASS
> Sending packet: $z0,7ffff7ddf702,1#00...Packet received: OK
> [...]
> Sending packet: $z0,7ffff7df0285,1#d2...Packet received: OK
> Stopped due to shared library event (no libraries added or removed)
> (gdb) _
>
> It has stopped on probe due to stop_on_solib_events == 1 but that is unrelated
> to how solib-svr4.c fetches the library list.
I'm seeing this too now. I think I assumed gdbserver would be
responsible for everything, but that's not the case; gdb sets the
breakpoints, so in this configuration it's stopping at the probes
breakpoints but using the old-style code in linux-low.c to fetch
the library list. This explains why the testcases see the probes
breakpoints, and why the check for PR 2328 doesn't segfault.
> I see the implementation for the linux-low.c side may not be so easy
> as I thought about before.
>
> GDB still needs to stop at the stap probes as it does but:
>
> * gdbserver needs to fetch probe arguments on its own. Therefore GDB client
> needs to compile the arguments into AX (agent-expression) and upload them
> to gdbserver. gdbserver then can do the incremental fetching of solist
> entries like solib-svr4.c with your patches does.
>
> * svr4_handle_solib_event should disable updating the local list of shared
> libraries as svr4_current_sos->svr4_current_sos_via_xfer_libraries will
> accomplish everything without needing svr4_handle_solib_event.
>
> * It could transfer only differences of <library-list-svr4> although that is
> an add-on optional feature. The major reason for implementing
> <library-list-svr4> was the high amount of pings over long latency links.
> The amound of transferred data over wire may not be such a concern.
> Although with your high-performance solib goals it may be also your goal.
>
> I had to clear it up for myself so I wrote it down, I hope I have it
> right.
Ah, I wondered if the stap code was in gdbserver, but apparently not.
dlmopen support requires the local cache that incremental updating
uses, because when you stop to update a namespace's so_list you can
only see the address of that namespace in the inferior. The other
namespace's so_lists are fetched from the cache, so either gdb or
gdbserver will have to maintain a cache somewhere. I'm tempted to
retain the cache in gdb, and have gdbserver send namespace updates.
I'm trying to understand the existing interface between gdb and
gdbserver. Does gdb request a library list and gdbserver send one,
or does gdbserver recognise the stop and send one, and gdb assumes
it's been sent one and try to read it?
Thanks,
Gary
--
http://gbenson.net/
next prev parent reply other threads:[~2012-09-28 10:51 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-19 11:09 Gary Benson
2012-07-25 19:36 ` Tom Tromey
2012-07-31 12:12 ` Gary Benson
2012-07-31 12:13 ` Gary Benson
2012-08-14 19:49 ` Tom Tromey
2012-08-15 17:24 ` Jan Kratochvil
2012-08-15 17:46 ` Jan Kratochvil
2012-08-16 11:14 ` Gary Benson
2012-08-16 15:52 ` Gary Benson
2012-08-17 10:54 ` Gary Benson
2012-08-17 16:41 ` Jan Kratochvil
2012-09-19 9:49 ` Gary Benson
2012-09-19 11:14 ` Jan Kratochvil
2012-09-19 15:06 ` Gary Benson
2012-09-19 15:13 ` Jan Kratochvil
2012-09-21 12:36 ` Gary Benson
2012-09-21 14:46 ` Jan Kratochvil
2012-09-28 10:51 ` Gary Benson [this message]
2012-09-28 10:58 ` 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=20120928105145.GA3465@redhat.com \
--to=gbenson@redhat.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