Message ID | 8c171da885807f7b534bdcde6757cd35b2969816.1485250702.git.mjt@msgid.tls.msk.ru (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/gdbstub.c b/gdbstub.c index de9b62b..27e0923 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -18,6 +18,7 @@ */ #include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu/error-report.h" #include "qemu/cutils.h" #include "cpu.h" #ifdef CONFIG_USER_ONLY @@ -1732,6 +1733,12 @@ int gdbserver_start(const char *device) CharDriverState *mon_chr; ChardevCommon common = { 0 }; + if (!first_cpu) { + error_report("gdbstub: meaningless to attach gdb to a " + "machine without any CPU."); + return -1; + } + if (!device) return -1; if (strcmp(device, "none") != 0) {