diff --git a/hypervisor/src/arch/emulator/mod.rs b/hypervisor/src/arch/emulator/mod.rs index 2c02de89c..078f65525 100644 --- a/hypervisor/src/arch/emulator/mod.rs +++ b/hypervisor/src/arch/emulator/mod.rs @@ -18,7 +18,18 @@ pub struct Exception { impl Display for Exception { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "Exception {:?} at IP {:#x}", self.vector, self.ip) + write!( + f, + "Exception {:?} at IP {:#x}{}{}", + self.vector, + self.ip, + self.error + .map(|e| format!(": error {:x}", e)) + .unwrap_or_else(|| "".to_owned()), + self.payload + .map(|payload| format!(": payload {:x}", payload)) + .unwrap_or_else(|| "".to_owned()) + ) } }