mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-10-03 20:15:45 +00:00
hypervisor: emulator: Print out all exception details
Print out all the details from an emulator exception. As identified by the new beta clippy. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
84f0f332b3
commit
7d7577007a
@ -18,7 +18,18 @@ pub struct Exception<T: Debug> {
|
|||||||
|
|
||||||
impl<T: Debug> Display for Exception<T> {
|
impl<T: Debug> Display for Exception<T> {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
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())
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user