Reset Config.GdbServer if GDB server init fails

This commit is contained in:
Xavier Del Campo Romero 2020-12-31 00:05:28 +01:00
parent bf989aec3b
commit ca3b98cc53
1 changed files with 6 additions and 2 deletions

View File

@ -415,12 +415,16 @@ void dbg_start(void)
if (server_socket >= 0) { if (server_socket >= 0) {
printf("GDB server started on port %hu.\n", port); 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"); fprintf(stderr, "could not create gdb stub internal queues\n");
Config.GdbServer = 0;
}
else else
start_thread(); start_thread();
} }
else else {
fprintf(stderr, "could not start GDB server\n"); fprintf(stderr, "could not start GDB server\n");
Config.GdbServer = 0;
}
} }
} }