aboutsummaryrefslogtreecommitdiff
path: root/gdb/doc
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2011-12-16 19:06:38 +0000
committerDoug Evans <dje@google.com>2011-12-16 19:06:38 +0000
commite0f9f062204827dd5f8a01ab9252ec29273cd3b0 (patch)
treeb59a5c9d50f4d48b63a75b4d1a63213eee7c7c1d /gdb/doc
parente77616d77a34e00c99d803b2324e17ece340ac5e (diff)
downloadgdb-e0f9f062204827dd5f8a01ab9252ec29273cd3b0.zip
gdb-e0f9f062204827dd5f8a01ab9252ec29273cd3b0.tar.gz
gdb-e0f9f062204827dd5f8a01ab9252ec29273cd3b0.tar.bz2
* NEWS: Add entry for stdio gdbserver.
gdbserver/ * linux-low.c (linux_create_inferior): If stdio connection, redirect stdin from /dev/null, stdout to stderr. * remote-utils.c (remote_is_stdio): New static global. (remote_connection_is_stdio): New function. (remote_prepare): Handle stdio connection. (remote_open): Ditto. (remote_close): Don't close stdin for stdio connections. (read_prim,write_prim): New functions. Replace all calls to read/write to these. * server.c (main): Watch for "-" argument. Move call to remote_prepare before start_inferior. * server.h (STDIO_CONNECTION_NAME): New macro. (remote_connection_is_stdio): Declare. doc/ * gdb.texinfo (Server): Document -/stdio argument to gdbserver. testsuite/ * lib/gdbserver-support.exp (gdb_target_cmd): Recognize stdio gdbserver output. (gdbserver_default_get_remote_address): New function. (gdbserver_start): Call gdb,get_remote_address to compute argument to "target remote" command.
Diffstat (limited to 'gdb/doc')
-rw-r--r--gdb/doc/ChangeLog4
-rw-r--r--gdb/doc/gdb.texinfo23
2 files changed, 25 insertions, 2 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index e8ff5c8..8451302 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,7 @@
+2011-12-16 Doug Evans <dje@google.com>
+
+ * gdb.texinfo (Server): Document -/stdio argument to gdbserver.
+
2011-12-16 Phil Muldoon <pmuldoon@redhat.com>
* gdb.texinfo (Python Commands): Remove "maint set/show print
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 4787b82..4a7ae6e 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -16766,8 +16766,10 @@ syntax is:
target> gdbserver @var{comm} @var{program} [ @var{args} @dots{} ]
@end smallexample
-@var{comm} is either a device name (to use a serial line) or a TCP
-hostname and portnumber. For example, to debug Emacs with the argument
+@var{comm} is either a device name (to use a serial line), or a TCP
+hostname and portnumber, or @code{-} or @code{stdio} to use
+stdin/stdout of @code{gdbserver}.
+For example, to debug Emacs with the argument
@samp{foo.txt} and communicate with @value{GDBN} over the serial port
@file{/dev/com1}:
@@ -16796,6 +16798,23 @@ conflicts with another service, @code{gdbserver} prints an error message
and exits.} You must use the same port number with the host @value{GDBN}
@code{target remote} command.
+The @code{stdio} connection is useful when starting @code{gdbserver}
+with ssh:
+
+@smallexample
+(gdb) target remote | ssh -T hostname gdbserver - hello
+@end smallexample
+
+The @samp{-T} option to ssh is provided because we don't need a remote pty,
+and we don't want escape-character handling. Ssh does this by default when
+a command is provided, the flag is provided to make it explicit.
+You could elide it if you want to.
+
+Programs started with stdio-connected gdbserver have @file{/dev/null} for
+@code{stdin}, and @code{stdout},@code{stderr} are sent back to gdb for
+display through a pipe connected to gdbserver.
+Both @code{stdout} and @code{stderr} use the same pipe.
+
@subsubsection Attaching to a Running Program
@cindex attach to a program, @code{gdbserver}
@cindex @option{--attach}, @code{gdbserver} option