public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Paul_Koning@Dell.com
Cc: gbenson@redhat.com, sandra@codesourcery.com, gdb@sourceware.org
Subject: Re: GDB now takes 4 minutes to start up with remote gdbserver target
Date: Tue, 28 Jul 2015 22:12:00 -0000	[thread overview]
Message-ID: <55B7FE32.1000506@redhat.com> (raw)
In-Reply-To: <75C87584-1A46-435F-A8AF-F7D827CE9793@dell.com>

On 07/24/2015 05:58 PM, Paul_Koning@Dell.com wrote:
> 
>> On Jul 24, 2015, at 12:05 PM, Pedro Alves <palves@redhat.com> wrote:
>>
>> On 07/24/2015 04:27 PM, Paul_Koning@Dell.com wrote:
>>
>>> But having sysroot default to target is also a bad idea for lots of other people.  Consider embedded systems: you presumably have stripped images there, but unstripped ones on your build host.
>>
>> But in that scenario, with the old default sysroot, how was gdb finding
>> the binaries on the build host?  The binaries on the equilalent locations
>> on the host's root will certainly not match the embedded/target system's.
>> In that scenario, you must have been pointing the "set sysroot" somewhere
>> local?  And if you do that, nothing changes in 7.10, gdb will still access
>> the files on the local filesystem.
>>
>> From the discussion so far, it seems that the only case that ends up
>> regressing is the case where the host and target share both the
>> filesystem, and the host/target paths match.  I don't know off hand how to
>> make gdb aware of that automatically.
>>
>> That seems like enough of a special case that could well be handled
>> by an explicit "set sysroot /" in e.g., the toolchain's system-gdbinit, or
>> by building gdb with "--with-sysroot=/“.
> 
> If you’re doing cross-builds, then yes, you’d have a non-default sysroot.  But if the host and target are the same OS, but the target has a small local file system with stripped images on it, then the default sysroot was valid in the past, but the new default is not.

And in case the host and target are the same OS, but the binaries are
of different versions (which happens frequently, machines
don't usually update their packages at exactly the same time), then
the default is almost right, but then the user gets misleading backtraces.

It seems to me like if you take the trouble to build such a setup
as you suggest, putting a "set sysroot /" somewhere is just another
small setup step.

The idea of the new default was both what's more convenient in the wider
set of use cases and also picking correctness over efficiency, while still
letting the user point at local copies of files (or set sysroot /dev/null
to point nowhere, for e.g.) to get efficiency back, when possible.

The discoverability of the need to do the latter I believe should be
treated as a separate matter, which seems could be resolved with a warning
around "warning: fetching files from the target.  Use "set sysroot" to
point at local copies for faster access." or some such, as has already
been suggested elsewhere.  IOW, if we had that already, how bad would it
really be if target: remains the default?

Thanks,
Pedro Alves

  reply	other threads:[~2015-07-28 22:12 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-23 23:21 Sandra Loosemore
2015-07-24  2:39 ` Sandra Loosemore
2015-07-24  8:52   ` Gary Benson
2015-07-24 13:59     ` Sandra Loosemore
2015-07-24 14:08       ` Paul_Koning
2015-07-24 15:11         ` Gary Benson
2015-07-24 15:27           ` Paul_Koning
2015-07-24 16:36             ` Pedro Alves
2015-07-24 16:58               ` Paul_Koning
2015-07-28 22:12                 ` Pedro Alves [this message]
2015-07-24 17:19               ` Sandra Loosemore
2015-07-27 12:22                 ` Gary Benson
2015-07-28  9:25                   ` Gary Benson
2015-07-28 15:22                     ` Sandra Loosemore
2015-07-29 10:00                       ` Gary Benson
2015-07-28 15:38                     ` Gary Benson
2015-07-28 17:04                     ` Doug Evans
2015-07-28 22:13                 ` Pedro Alves
2015-07-29  1:32                   ` Sandra Loosemore
2015-07-26 20:03               ` Frank Ch. Eigler
2015-07-26 20:06                 ` Jan Kratochvil
2015-07-26 20:50                   ` Frank Ch. Eigler
2015-07-28 16:55     ` Doug Evans
2015-07-28 22:14       ` Pedro Alves
2015-07-29 10:39         ` Gary Benson
2015-07-29 16:54           ` Jan Kratochvil
2015-07-29 10:15       ` Gary Benson
2015-07-24 10:34   ` Gary Benson
2015-07-24 16:05     ` Sandra Loosemore

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=55B7FE32.1000506@redhat.com \
    --to=palves@redhat.com \
    --cc=Paul_Koning@Dell.com \
    --cc=gbenson@redhat.com \
    --cc=gdb@sourceware.org \
    --cc=sandra@codesourcery.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).