This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 0/2] Better handling of slow remote transfers


Pedro Alves wrote:
> On 08/12/2015 11:38 AM, Gary Benson wrote:
> > It seems like you're saying this series is a big change, but it's
> > really not: the core of it is that little snippet of logic, which
> > is easy enough to reason about:
> > 
> >   IF target filesystem is remote
> >      AND auto_target_prefix is enabled
> >      AND no sysroot is set
> >      AND (we're looking for an executable
> >           OR we're looking for a solib loaded by a target-prefixed executable):
> >        Prefix the filename with "target:"
> > 
> 
> 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:

  (gdb) target remote :9999

    - exec_filename is set to, e.g., "target:/path/to/a.out"
    - exec_filename HAS a "target:" prefix
    - "target:" prefix IS applied to shared libraries
    - solib paths end up as "target:/path/to/libsolib.so.1"
    - solibs ARE fetched over RSP

Basically it fetches the libraries over RSP if and only if the
executable was fetched over RSP.  So it works as Sandra expects
when she uses GDB her way, but it still has the automatic
executable filename discovery and automatic fetch-from-remote
for users who just do "target remote ..." on it's own (which is
something that doesn't make much sense in 7.9).
       
> > It's certainly way less invasive a change than making transfers
> > interruptible would be.
> 
> 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.

Cheers,
Gary

-- 
http://gbenson.net/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]