]> git.proxmox.com Git - qemu.git/commitdiff
linux-user: Exit with an error if we couldn't set up gdbserver
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 6 Sep 2011 13:15:50 +0000 (14:15 +0100)
committerRiku Voipio <riku.voipio@linaro.org>
Fri, 9 Sep 2011 07:46:58 +0000 (10:46 +0300)
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>
linux-user/main.c

index 25cb4ddf36f91ea9acf83c74d352e27fc0ae6223..8910d2c4943f3f23488c8d4b3a0284894b72d413 100644 (file)
@@ -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);