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

@ -52,8 +52,6 @@ extern "C" {
fn throw_trap(ty: i32) -> !;
fn throw_breakpoint(ty: i64) -> !;
/// This should be the same as spliting up the fat pointer into two arguments,
/// but this is cleaner, I think?
#[cfg_attr(nightly, unwind(allowed))]
#[allow(improper_ctypes)]
fn throw_runtime_error(data: *mut Option<RuntimeError>) -> !;

View File

@ -944,8 +944,10 @@ pub unsafe extern "C" fn callback_trampoline(
b: *mut Option<RuntimeError>,
callback: *mut BreakpointHandler,
) {
dbg!("In llvm's callback_trampoline");
let callback = Box::from_raw(callback);
let result: Result<(), RuntimeError> = callback(BreakpointInfo { fault: None });
dbg!(&*b);
match result {
Ok(()) => *b = None,
Err(e) => *b = Some(e),