Debugging LLVM trap code WIP

This commit is contained in:
Mark McCaskey
2020-04-26 12:52:58 -07:00
parent 89af5dc107
commit 2bbe3406cf
7 changed files with 16 additions and 16 deletions

View File

@ -296,7 +296,7 @@ impl std::fmt::Display for RuntimeError {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
// TODO: update invoke error formatting
RuntimeError::InvokeError(_) => write!(f, "Error when calling invoke"),
RuntimeError::InvokeError(ie) => write!(f, "Error when calling invoke: {:?}", ie),
RuntimeError::Metering(_) => write!(f, "unknown metering error type"),
RuntimeError::InstanceImage(_) => write!(
f,

View File

@ -281,7 +281,7 @@ extern "C" fn signal_trap_handler(
let mut should_unwind = false;
let mut unwind_result: Option<Box<RuntimeError>> = None;
let get_unwind_result = |uw_result: Option<Box<RuntimeError>>| -> Box<RuntimeError> {
uw_result
dbg!(uw_result)
.unwrap_or_else(|| Box::new(RuntimeError::InvokeError(InvokeError::FailedWithNoError)))
};

View File

@ -602,9 +602,9 @@ pub(crate) fn call_func_with_index_inner(
if success {
Ok(())
} else {
let error: RuntimeError = error_out
.map(Into::into)
.unwrap_or_else(|| RuntimeError::InvokeError(InvokeError::FailedWithNoError));
let error: RuntimeError = dbg!(error_out)
.map_or_else(|| RuntimeError::InvokeError(InvokeError::FailedWithNoError), Into::into);
dbg!(&error);
Err(error.into())
}
};

View File

@ -590,7 +590,7 @@ macro_rules! impl_traits {
) {
Ok(Rets::from_ret_array(rets))
} else {
Err(error_out.map_or_else(|| RuntimeError::InvokeError(InvokeError::FailedWithNoError), Into::into))
Err(dbg!(error_out).map_or_else(|| RuntimeError::InvokeError(InvokeError::FailedWithNoError), Into::into))
}
}
}