This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
Re: Proof-of-concept on fd-connected linux-nat.c server
- From: Pedro Alves <pedro at codesourcery dot com>
- To: archer at sourceware dot org
- Cc: Jan Kratochvil <jan dot kratochvil at redhat dot com>,Chris Moller <cmoller at redhat dot com>
- Date: Sun, 10 May 2009 11:25:24 +0100
- Subject: Re: Proof-of-concept on fd-connected linux-nat.c server
- References: <20090509151556.GA17252@host0.dyn.jankratochvil.net>
On Saturday 09 May 2009 16:15:56, Jan Kratochvil wrote:
> tried to implement the file-descriptor based client for GDB as a possible
> client for the kernel module which would interface utrace. Based on my mail:
> http://sourceware.org/ml/archer/2009-q1/msg00257.html
>
> http://sourceware.org/gdb/wiki/ArcherBranchManagement
> branch archer-jankratochvil-stork
>
> Its current client is communicating over pipe with ./stork-server which is
> ptrace based. Expecting there would be no stork-server and this pipe would be
> some socket communicating directly with kernel.
>
> Currently waitpid()+ptrace() get implemented remotely over the pipe/fd/wire as
> both need to be called from the same process to work properly with the goal to
> exercise proper remote waitpid() events handling in GDB. Sure the abstraction
> layer should include also kill/tkill etc. but these are not interesting from
> the events processing point of view.
You're reinventing a remote protocol, and, at the wrong layer, IMO.
> Just while writing the code remembered Tom Tromey was discussing maybe GDB
> should always run using gdbserver and this gdbserver could be whole in the
> kernel. While writing this code I found out I just duplicate the gdbserver
> client/protocol/server functionality. While the gdbserver protocol is
> ASCII=inefficient I do not think it is worth fixing on hardware nowadays
> - expensive is inefficient/excessive symbols reading, not the ASCII hex
> mangling/demangling.
I seriously, highly doubt that ascii is a real inefficiency here. For
bulk memory transfers, the remote protocol has binary packets --- 8-bit
with a few bytes needing an escape sequence (see X packet). Far, far
more important is roundtrip latency. OTOH, an ascii protocol makes
debugging what's going on between client/server much much easier
than reading binary blobs. The single most important time
sensitive operation when debugging is single-stepping speed, and
that's mostly dominated by roundtrips.
> What do you think about implementing gdbserver.ko?
What would this be solving?
> (Unfortunately I have not much knowledge on gdbserver.)
In all seriousness, I think that you're going the wrong direction
entirely. I really suggest you get acquainted with the remote
protocol and gdbserver, before coming up with a new solution.
> * Removing local queue (waitpid_queue) would be IMHO good even for current FSF
> GDB HEAD -
It's going to happen:
http://sourceware.org/ml/gdb-patches/2009-04/msg00125.html
(that's not the final patch, but, I'll get to it this week probably)
--
Pedro Alves