This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 0/2] Better handling of slow remote transfers
- From: Gary Benson <gbenson at redhat dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: Joel Brobecker <brobecker at adacore dot com>, Doug Evans <dje at google dot com>, Jan Kratochvil <jan dot kratochvil at redhat dot com>, gdb-patches <gdb-patches at sourceware dot org>, Sandra Loosemore <sandra at codesourcery dot com>, André Pönitz <apoenitz at t-online dot de>, Paul Koning <Paul_Koning at dell dot com>
- Date: Wed, 12 Aug 2015 14:02:48 +0100
- Subject: Re: [PATCH 0/2] Better handling of slow remote transfers
- Authentication-results: sourceware.org; auth=none
- References: <001a11c301b0388ac5051d0c5ab8 at google dot com> <20150811185519 dot GA28644 at host1 dot jankratochvil dot net> <CADPb22TM42jGif4PqOgpvDxb7RhzS=vBgGJijcB7h9-3rCbH7A at mail dot gmail dot com> <20150811195943 dot GC22245 at adacore dot com> <20150812094831 dot GD11096 at blade dot nx> <55CB1B8D dot 6010501 at redhat dot com> <20150812103831 dot GA12792 at blade dot nx> <55CB2DF8 dot 2050506 at redhat dot com> <20150812123254 dot GA14726 at blade dot nx> <55CB4150 dot 6090807 at redhat dot com>
Pedro Alves wrote:
> On 08/12/2015 01:32 PM, Gary Benson wrote:
> > Pedro Alves wrote:
> > > IIUC, it still auto fetches the executable and then the solibs
> > > from the target by default (e.g., after "attach"), so still
> > > subject to lack of interruptibility?
> >
> > Yes and no. It will fetch the executable from the remote iff one
> > has not been otherwise specified (i.e. by "file", or on the
> > command line). It will *only* fetch libraries from the remote if
> > the parent executable has a target prefix. So:
> >
> > (gdb) file a.out
> > (gdb) target remote :9999
> >
> > - exec_filename is "a.out"
> > - exec_filename has no "target:" prefix
> > - "target:" prefix is NOT applied to shared libraries
> > - solib paths end up as "/path/to/libsolib.so.1"
> > - solibs are NOT fetched over RSP
> >
>
> But to me it looks like GDB _should_ retrieve the libraries out of
> the target in this case. You'll usually have a local copy of the
> executable, because you just compiled it, but not of the shared
> libraries. It seems to me we're only considering this option
> because we didn't make transfers interruptible?
Right, but users who have been doing that will be using "set sysroot
remote:":
(gdb) file a.out
(gdb) set sysroot remote:
(gdb) target remote :9999
- gdb_sysroot is "target:"
- solib paths end up as "target:/path/to/libsolib.so.1"
- solibs ARE fetched over RSP
This series basically means that:
a) users get to type whatever they were typing before and have the
same thing happen, with the exception of the 0.001% of users who
have been typing "target remote :9999" with no "file" or "set sysroot"
commands and debugging with no symbols whatsoever.
b) those users can add "set auto-target-prefix off" in their .gdbinit
c) users who want GDB to connect to a remote target and Just Work
get to type "target remote :9999" without messing about with
"file" and "set sysroot" commands.
> > > I was only OK with trying to make transfers interruptible in the
> > > branch assuming it was something non-invasive, like a missing
> > > QUIT here and there.
> >
> > No, gdbserver sends the data in PBUFSIZ chunks, but GDB reads the
> > data a character at a time.
>
> Can you expand on this? What code is it that reads the data a
> character at a time? What data is gdb getting at when it does that?
I was looking in getpkt_or_notif_sane_1, but I think maybe I misread
it. I'll get back to you on this...
Cheers,
Gary
--
http://gbenson.net/