int read_size = 0;
if (hook == NULL) {
- PrintError("Hook Not present for in on port %x\n", io_info->port);
+ PrintError("Hook Not present for in on port 0x%x\n", io_info->port);
// error, we should not have exited on this port
return -1;
}
if (hook->read(io_info->port, &(info->vm_regs.rax), read_size, hook->priv_data) != read_size) {
// not sure how we handle errors.....
- PrintError("Read Failure for in on port %x\n", io_info->port);
+ PrintError("Read Failure for in on port 0x%x\n", io_info->port);
return -1;
}
if (hook == NULL) {
- PrintError("Hook Not present for ins on port %x\n", io_info->port);
+ PrintError("Hook Not present for ins on port 0x%x\n", io_info->port);
// error, we should not have exited on this port
return -1;
}
if (hook->read(io_info->port, (char *)host_addr, read_size, hook->priv_data) != read_size) {
// not sure how we handle errors.....
- PrintError("Read Failure for ins on port %x\n", io_info->port);
+ PrintError("Read Failure for ins on port 0x%x\n", io_info->port);
return -1;
}
int write_size = 0;
if (hook == NULL) {
- PrintError("Hook Not present for out on port %x\n", io_info->port);
+ PrintError("Hook Not present for out on port 0x%x\n", io_info->port);
// error, we should not have exited on this port
return -1;
}
if (hook->write(io_info->port, &(info->vm_regs.rax), write_size, hook->priv_data) != write_size) {
// not sure how we handle errors.....
- PrintError("Write Failure for out on port %x\n", io_info->port);
+ PrintError("Write Failure for out on port 0x%x\n", io_info->port);
return -1;
}
if (hook == NULL) {
- PrintError("Hook Not present for outs on port %x\n", io_info->port);
+ PrintError("Hook Not present for outs on port 0x%x\n", io_info->port);
// error, we should not have exited on this port
return -1;
}
if (hook->write(io_info->port, (char*)host_addr, write_size, hook->priv_data) != write_size) {
// not sure how we handle errors.....
- PrintError("Write Failure for outs on port %x\n", io_info->port);
+ PrintError("Write Failure for outs on port 0x%x\n", io_info->port);
return -1;
}
io_hook->priv_data = priv_data;
if (insert_io_hook(info, io_hook)) {
- V3_Free(io_hook);
- return -1;
+ PrintError("Could not insert IO hook for port %d\n", port);
+ V3_Free(io_hook);
+ return -1;
}
if (info->io_map.update_map(info, port,
((read == NULL) ? 0 : 1),
((write == NULL) ? 0 : 1)) == -1) {
- V3_Free(io_hook);
- return -1;
+ PrintError("Could not update IO map for port %d\n", port);
+ V3_Free(io_hook);
+ return -1;
}