From: Peter Maydell Date: Tue, 6 Sep 2011 13:15:50 +0000 (+0100) Subject: linux-user: Exit with an error if we couldn't set up gdbserver X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=ff7a981affbbc4f19f6f92143a3ddff90a1363fe;p=qemu.git linux-user: Exit with an error if we couldn't set up gdbserver If gdbserver_start() fails (usually because we couldn't bind to the requested TCP port) then exit qemu rather than blithely continuing. This brings the linux-user behaviour in to line with system mode. Signed-off-by: Riku Voipio Signed-off-by: Peter Maydell --- diff --git a/linux-user/main.c b/linux-user/main.c index 25cb4ddf36..8910d2c494 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -3655,7 +3655,11 @@ int main(int argc, char **argv, char **envp) #endif if (gdbstub_port) { - gdbserver_start (gdbstub_port); + if (gdbserver_start(gdbstub_port) < 0) { + fprintf(stderr, "qemu: could not open gdbserver on port %d\n", + gdbstub_port); + exit(1); + } gdb_handlesig(env, 0); } cpu_loop(env);