public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Change how "target:" gets into filenames
@ 2015-07-28 15:36 Gary Benson
  2015-07-28 15:36 ` [PATCH 4/5] Use TARGET_FILENAME_PREFIX as the system root in some cases Gary Benson
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Gary Benson @ 2015-07-28 15:36 UTC (permalink / raw)
  To: gdb-patches
  Cc: Pedro Alves, Sandra Loosemore, Paul_Koning, Jan Kratochvil,
	Joel Brobecker

Hi all,

This is a continuation of this thread:
https://sourceware.org/ml/gdb/2015-07/msg00038.html

In summary, GDB since April automatically locates and fetches
binary files from remote systems.  A number of people would
like this not to happen.

This automation hinged on changing the default sysroot from ""
to "target:".  This series reverts that change, and instead
updates solib_find_1 to use "target:" as the sysroot where it
would be necessary to access the files.

Most use cases proceed as before, but with this series the
files are *not* transferred if you supply GDB an executable
either on the command line or with a "file" command.

Remote examples:

  $ gdb ./a.out
  (gdb) target remote :9999
  # no "target:" prefix (=no files transferred)

  $ gdb
  (gdb) file a.out
  (gdb) target remote :9999
  # no "target:" prefix (=no files transferred)

  $ gdb
  (gdb) target remote :9999
  # "target:" prefix, files transferred

Aside from fixing this issue, GDB with this change has the advantage
that users don't see the "target:" prefix unless either they are
using GDB in a way that didn't work in 7.9 (remote target without
"file" and "set sysroot" commands, containerized target) or they
explitictly set it themselves (e.g. "set sysroot target:/foo/bar").

I've Cc'd Joel because, if this is the way we want to go, it would
be nice to have this in 7.10 as it minimises the difference from
7.9 and would avoid having 7.10 introduce the "target:" sysroot
only for 7.11 to remove it.

I've Cc'd Jan because he's working on making sysroot be a search
path. (defaulting to something like "/", "target:/").  I think you
could do that from this series by treating the auto-target-prefix
boolean as a stepping-stone that could be removed.  If nothing else
this series is a map of the places you'll need to update :)

Built and regtested on RHEL 6.6 x86_64.

Opinions?  (Should I commit this, and if so where?)

Cheers,
Gary

--
http://gbenson.net/

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: [PATCH 4/5] Use TARGET_FILENAME_PREFIX as the system root in some cases
@ 2015-07-28 17:35 Doug Evans
  2015-07-28 20:02 ` Sandra Loosemore
  2015-08-04 16:09 ` Joel Brobecker
  0 siblings, 2 replies; 13+ messages in thread
From: Doug Evans @ 2015-07-28 17:35 UTC (permalink / raw)
  To: Gary Benson
  Cc: gdb-patches, Pedro Alves, Sandra Loosemore, Paul_Koning,
	Jan Kratochvil, Joel Brobecker

Gary Benson writes:
  > This commit updates solib_find_1 to use TARGET_FILENAME_PREFIX as the
  > system root if auto-target-prefix is enabled and gdb_sysroot is empty
  > and the target filesystem is not the local filesystem.
  >
  > gdb/ChangeLog:
  >
  > 	* solib.c (auto_target_prefix): New static variable.
  > 	(solib_find_1): Use TARGET_FILENAME_PREFIX as sysroot
  > 	in some cases.
  > 	(show_auto_target_prefix): New function.
  > 	(_initialize_solib): New "set/show auto-target-prefix"
  > 	commands.
  > 	* NEWS: Mention that GDB will use "target:" as the system
  > 	root in some cases.  Mention new "set/show auto-target-prefix"
  > 	commands.
  >
  > gdb/doc/ChangeLog:
  >
  > 	* gdb.texinfo (Commands to Specify Files): Document the
  > 	"set/show auto-target-prefix" commands.

Hi.

Still not sure whether the subtlety between these two will trip people up.

$ gdb
(gdb) file a.out
(gdb) target remote :9999
# no "target:" prefix (=no files transferred)

$ gdb
(gdb) target remote :9999
# "target:" prefix, files transferred

One thing that comes to mind is that there's no indication/warning
here of the potential massive responsiveness hit people may take
if they turn this feature on, plus an explanation of what's going
on, or how they can do things differently to avoid it.

If, after doing:

(gdb) target remote :9999

the user was first prompted with something like:

"Warning: I have no way to find files with debug info locally,
and auto-target-prefix is set to "on",
so I will try to fetch these files from the target.
This may take time.  If you want to avoid having me try to transfer
files from the target, you can do the following:
blah blah blah
Are you sure you want to continue?"
[suitably cleaned up, I didn't want to spend any time wordsmithing that]

then that may be sufficient.  What do others think?

I agree that we should get this resolved for 7.10 though.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-08-04 16:09 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-28 15:36 [PATCH 0/5] Change how "target:" gets into filenames Gary Benson
2015-07-28 15:36 ` [PATCH 4/5] Use TARGET_FILENAME_PREFIX as the system root in some cases Gary Benson
2015-07-28 15:40   ` Eli Zaretskii
2015-07-28 15:36 ` [PATCH 3/5] Rename TARGET_SYSROOT_PREFIX as TARGET_FILENAME_PREFIX Gary Benson
2015-07-28 15:36 ` [PATCH 2/5] Update Valgrind GDB special case Gary Benson
2015-07-28 15:45 ` [PATCH 5/5] Update exec_file_find callers Gary Benson
2015-07-28 15:45 ` [PATCH 1/5] Revert default system root back to "" Gary Benson
2015-07-28 15:58   ` Eli Zaretskii
2015-07-29 17:04 ` [PATCH 0/5] Change how "target:" gets into filenames Jan Kratochvil
2015-07-28 17:35 [PATCH 4/5] Use TARGET_FILENAME_PREFIX as the system root in some cases Doug Evans
2015-07-28 20:02 ` Sandra Loosemore
2015-07-29 10:30   ` Gary Benson
2015-08-04 16:09 ` Joel Brobecker

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).