From ca3b98cc53a15a627c48e281a37e9665f36c879d Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Thu, 31 Dec 2020 00:05:28 +0100 Subject: [PATCH] Reset Config.GdbServer if GDB server init fails --- gdbstub/gdbstub_sys.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gdbstub/gdbstub_sys.c b/gdbstub/gdbstub_sys.c index f98a7abb..bd966b29 100644 --- a/gdbstub/gdbstub_sys.c +++ b/gdbstub/gdbstub_sys.c @@ -415,12 +415,16 @@ void dbg_start(void) if (server_socket >= 0) { printf("GDB server started on port %hu.\n", port); - if (queue_create()) + if (queue_create()) { fprintf(stderr, "could not create gdb stub internal queues\n"); + Config.GdbServer = 0; + } else start_thread(); } - else + else { fprintf(stderr, "could not start GDB server\n"); + Config.GdbServer = 0; + } } }