qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] linux-user: Exit with an error if we couldn't set up gdbserver
@ 2011-09-06 13:15 Peter Maydell
  0 siblings, 0 replies; only message in thread
From: Peter Maydell @ 2011-09-06 13:15 UTC (permalink / raw)
  To: qemu-devel; +Cc: Riku Voipio, patches

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: Peter Maydell <peter.maydell@linaro.org>
---
 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 89a51d7..7268997 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -3568,7 +3568,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);
-- 
1.7.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-09-06 13:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-06 13:15 [Qemu-devel] [PATCH] linux-user: Exit with an error if we couldn't set up gdbserver Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).