#include "kvm/kvm.h"
+#include <stdbool.h>
#include <assert.h>
#include <limits.h>
#include <stdlib.h>
#include <stdio.h>
+bool ioport_debug;
+
static uint8_t ioport_to_uint8(void *data)
{
uint8_t *p = data;
}
return true;
error:
- ioport_error(port, data, direction, size, count);
- return false;
+ if (ioport_debug)
+ ioport_error(port, data, direction, size, count);
+
+ return !ioport_debug;
}
#include <string.h>
#include <stdio.h>
+extern bool ioport_debug;
+
static void usage(char *argv[])
{
- fprintf(stderr, " usage: %s [--single-step] [--params=<kernel-params>] [--kernel=]<kernel-image>\n",
+ fprintf(stderr, " usage: %s [--single-step] [--ioport-debug] [--params=<kernel-params>] [--kernel=]<kernel-image>\n",
argv[0]);
exit(1);
}
for (i = 1; i < argc; i++) {
if (option_matches(argv[i], "--kernel=")) {
- kernel_filename = &argv[i][9];
+ kernel_filename = &argv[i][9];
continue;
} else if (option_matches(argv[i], "--params=")) {
- kernel_cmdline = &argv[i][9];
+ kernel_cmdline = &argv[i][9];
continue;
} else if (option_matches(argv[i], "--single-step")) {
- single_step = true;
+ single_step = true;
+ continue;
+ } else if (option_matches(argv[i], "--ioport-debug")) {
+ ioport_debug = true;
continue;
} else {
/* any unspecified arg is kernel image */