diff --git a/Cargo.toml b/Cargo.toml index e592fc7..cb9f6eb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,8 +7,6 @@ edition = "2018" [dependencies] gimli = { version = "0.25.0", default-features = false, features = ["read"] } libc = "0.2" -fallible-iterator = "0.1" -log = "0.4" once_cell = "1.8" [profile.release] diff --git a/src/arch/x86_64.rs b/src/arch/x86_64.rs index d5c5fec..aa40053 100644 --- a/src/arch/x86_64.rs +++ b/src/arch/x86_64.rs @@ -11,6 +11,13 @@ pub struct Context { pub fcw: usize, } +pub struct Arch; + +impl Arch { + pub const SP: Register = X86_64::RSP; + pub const RA: Register = X86_64::RA; +} + impl fmt::Debug for Context { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { let mut fmt = fmt.debug_struct("Context"); @@ -84,7 +91,6 @@ pub extern "C-unwind" fn save_context() -> Context { #[naked] pub unsafe extern "C" fn restore_context(ctx: &Context) -> ! { - // No need to save caller-saved registers here. asm!( " /* Restore stack */ diff --git a/src/find_fde/mod.rs b/src/find_fde/mod.rs index ec0b658..0b4881b 100644 --- a/src/find_fde/mod.rs +++ b/src/find_fde/mod.rs @@ -4,6 +4,7 @@ mod registry; use crate::util::*; use gimli::{BaseAddresses, EhFrame, FrameDescriptionEntry}; +#[derive(Debug)] pub struct FDESearchResult { pub fde: FrameDescriptionEntry, pub bases: BaseAddresses, diff --git a/src/lib.rs b/src/lib.rs index e9feef6..e793755 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,8 @@ +#![feature(c_unwind)] +#![feature(naked_functions)] +#![feature(asm)] +#![allow(unused_unsafe)] + mod arch; mod find_fde; mod util;