summaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-04-05 18:43:41 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-04-05 18:43:41 +0000
commit59030a8cd4000fcf92d9b8225c6083f9e6ab86b8 (patch)
tree69e87af5f58695776a7d375049d2d4114f832146 /monitor.c
parentbc14ca2453f22f20569699bda5f12e892131092c (diff)
downloadqemu-59030a8cd4000fcf92d9b8225c6083f9e6ab86b8.zip
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
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/monitor.c b/monitor.c
index c6fe968ff2..75c8663a1e 100644
--- a/monitor.c
+++ b/monitor.c
@@ -570,17 +570,18 @@ static void encrypted_bdrv_it(void *opaque, BlockDriverState *bs)
}
#ifdef CONFIG_GDBSTUB
-static void do_gdbserver(Monitor *mon, const char *port)
-{
- if (!port)
- port = DEFAULT_GDBSTUB_PORT;
- if (gdbserver_start(port) < 0) {
- monitor_printf(mon, "Could not open gdbserver socket on port '%s'\n",
- port);
- } else if (strcmp(port, "none") == 0) {
+static void do_gdbserver(Monitor *mon, const char *device)
+{
+ if (!device)
+ device = "tcp::" DEFAULT_GDBSTUB_PORT;
+ if (gdbserver_start(device) < 0) {
+ monitor_printf(mon, "Could not open gdbserver on device '%s'\n",
+ device);
+ } else if (strcmp(device, "none") == 0) {
monitor_printf(mon, "Disabled gdbserver\n");
} else {
- monitor_printf(mon, "Waiting gdb connection on port '%s'\n", port);
+ monitor_printf(mon, "Waiting for gdb connection on device '%s'\n",
+ device);
}
}
#endif