diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2011-09-06 14:15:50 +0100 |
---|---|---|
committer | Riku Voipio <riku.voipio@linaro.org> | 2011-09-09 10:46:58 +0300 |
commit | ff7a981affbbc4f19f6f92143a3ddff90a1363fe (patch) | |
tree | 038a82fa76650daf4186d88c6eb5169f6c370505 /linux-user/main.c | |
parent | 97cc75606aef406e90a243cdb25347039003e7f0 (diff) | |
download | qemu-ff7a981affbbc4f19f6f92143a3ddff90a1363fe.zip qemu-ff7a981affbbc4f19f6f92143a3ddff90a1363fe.tar.gz qemu-ff7a981affbbc4f19f6f92143a3ddff90a1363fe.tar.bz2 |
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 <riku.voipio@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'linux-user/main.c')
-rw-r--r-- | linux-user/main.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/linux-user/main.c b/linux-user/main.c index 25cb4dd..8910d2c 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); |