aboutsummaryrefslogtreecommitdiff
path: root/gdbstub.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdbstub.c')
-rw-r--r--gdbstub.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gdbstub.c b/gdbstub.c
index a26c12ca6e..aeddc34745 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1234,4 +1234,18 @@ int gdbserver_start(CharDriverState *chr)
qemu_add_vm_stop_handler(gdb_vm_stopped, s);
return 0;
}
+
+int gdbserver_start_port(int port)
+{
+ CharDriverState *chr;
+ char gdbstub_port_name[128];
+
+ snprintf(gdbstub_port_name, sizeof(gdbstub_port_name),
+ "tcp::%d,nowait,nodelay,server", port);
+ chr = qemu_chr_open(gdbstub_port_name);
+ if (!chr)
+ return -EIO;
+ return gdbserver_start(chr);
+}
+
#endif