@@ -43,4 +43,6 @@
_t; \
})
+bool windbg_on_load(void);
+
#endif
@@ -18,6 +18,7 @@
#define WINDBG_DEBUG_ON false
#endif
+void windbg_try_load(void);
int windbg_server_start(const char *device);
#endif
@@ -12,6 +12,9 @@
#include "qemu/osdep.h"
#include "exec/windbgstub.h"
+void windbg_try_load(void)
+{}
+
int windbg_server_start(const char *device)
{
return 0;
@@ -24,6 +24,7 @@
#include "exec/exec-all.h"
#include "exec/cpu_ldst.h"
#include "exec/address-spaces.h"
+#include "exec/windbgstub.h"
void helper_outb(CPUX86State *env, uint32_t port, uint32_t data)
{
@@ -385,6 +386,8 @@ void helper_wrmsr(CPUX86State *env)
/* XXX: exception? */
break;
}
+
+ windbg_try_load();
}
void helper_rdmsr(CPUX86State *env)
@@ -10,3 +10,13 @@
*/
#include "qemu/osdep.h"
+
+#ifndef TARGET_X86_64
+#include "exec/windbgstub-utils.h"
+
+bool windbg_on_load(void)
+{
+ return false;
+}
+
+#endif
@@ -16,6 +16,7 @@
#include "qemu/cutils.h"
#include "exec/windbgstub.h"
#include "exec/windbgstub-utils.h"
+#include "sysemu/kvm.h"
typedef struct WindbgState {
bool is_loaded;
@@ -45,6 +46,13 @@ static void windbg_exit(void)
g_free(windbg_state);
}
+void windbg_try_load(void)
+{
+ if (windbg_state && !windbg_state->is_loaded) {
+ windbg_state->is_loaded = windbg_on_load();
+ }
+}
+
int windbg_server_start(const char *device)
{
Chardev *chr = NULL;
@@ -54,6 +62,11 @@ int windbg_server_start(const char *device)
exit(1);
}
+ if (kvm_enabled()) {
+ WINDBG_ERROR("KVM is not supported.");
+ exit(1);
+ }
+
if (!strstart(device, "pipe:", NULL)) {
WINDBG_ERROR("Unsupported device. Supported only pipe.");
exit(1);