gdbstub: Rework configuration via command line and monitor (Jan Kiszka)

Introduce a more canonical gdbstub configuration (system emulation only)
via the new switch '-gdb dev'. Keep '-s' as shorthand for
'-gdb tcp::1234'. Use the same syntax also for the corresponding monitor
command 'gdbserver'. Its default remains to listen on TCP port 1234.

Changes in v4:
 - Rebased over new command line switches meta file

Changes in v3:
 - Fix documentation

Changes in v2:
 - Support for pipe-based like to gdb (target remote | qemu -gdb stdio)
 - Properly update the qemu-doc

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6992 c046a42c-6fe2-441c-8c8c-71466251a162
diff --git a/qemu-options.hx b/qemu-options.hx
index 32f936f..51593a3 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -1216,19 +1216,25 @@
 Do not start CPU at startup (you must type 'c' in the monitor).
 ETEXI
 
-DEF("s", 0, QEMU_OPTION_s, \
-    "-s              wait gdb connection to port\n")
+DEF("gdb", HAS_ARG, QEMU_OPTION_gdb, \
+    "-gdb dev        wait for gdb connection on 'dev'\n")
 STEXI
-@item -s
-Wait gdb connection to port 1234 (@pxref{gdb_usage}).
+@item -gdb @var{dev}
+Wait for gdb connection on device @var{dev} (@pxref{gdb_usage}). Typical
+connections will likely be TCP-based, but also UDP, pseudo TTY, or even
+stdio are reasonable use case. The latter is allowing to start qemu from
+within gdb and establish the connection via a pipe:
+@example
+(gdb) target remote | exec qemu -gdb stdio ...
+@end example
 ETEXI
 
-DEF("p", HAS_ARG, QEMU_OPTION_p, \
-    "-p port         set gdb connection port [default=%s]\n")
+DEF("s", 0, QEMU_OPTION_s, \
+    "-s              shorthand for -gdb tcp::%s\n")
 STEXI
-@item -p @var{port}
-Change gdb connection port.  @var{port} can be either a decimal number
-to specify a TCP port, or a host device (same devices as the serial port).
+@item -s
+Shorthand for -gdb tcp::1234, i.e. open a gdbserver on TCP port 1234
+(@pxref{gdb_usage}).
 ETEXI
 
 DEF("d", HAS_ARG, QEMU_OPTION_d, \