Allow dwarf expr support to be turned off
This commit is contained in:
parent
d22df752ca
commit
a942d60e1a
@ -16,8 +16,9 @@ spin = { version = "0.9", default-features = false, features = ["mutex", "spin_m
|
|||||||
alloc = []
|
alloc = []
|
||||||
fde-phdr = ["libc"]
|
fde-phdr = ["libc"]
|
||||||
fde-registry = ["alloc"]
|
fde-registry = ["alloc"]
|
||||||
|
dwarf-expr = []
|
||||||
system-alloc = []
|
system-alloc = []
|
||||||
default = ["fde-phdr"]
|
default = ["dwarf-expr", "fde-phdr", "fde-registry"]
|
||||||
|
|
||||||
[profile.dev]
|
[profile.dev]
|
||||||
# Must be turned on due to Rust bug https://github.com/rust-lang/rust/issues/50007
|
# Must be turned on due to Rust bug https://github.com/rust-lang/rust/issues/50007
|
||||||
|
@ -8,5 +8,5 @@ edition = "2018"
|
|||||||
crate-type = ["cdylib"]
|
crate-type = ["cdylib"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
unwind = { path = "../", features = ["fde-registry"] }
|
unwind = { path = "../", features = ["system-alloc"] }
|
||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
|
10
src/frame.rs
10
src/frame.rs
@ -44,6 +44,7 @@ impl Frame {
|
|||||||
Ok(Some(Self { fde_result, row }))
|
Ok(Some(Self { fde_result, row }))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "dwarf-expr")]
|
||||||
fn evaluate_expression(
|
fn evaluate_expression(
|
||||||
&self,
|
&self,
|
||||||
ctx: &Context,
|
ctx: &Context,
|
||||||
@ -83,6 +84,15 @@ impl Frame {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(feature = "dwarf-expr"))]
|
||||||
|
fn evaluate_expression(
|
||||||
|
&self,
|
||||||
|
ctx: &Context,
|
||||||
|
expr: Expression<StaticSlice>,
|
||||||
|
) -> Result<usize, gimli::Error> {
|
||||||
|
Err(gimli::Error::UnsupportedEvaluation)
|
||||||
|
}
|
||||||
|
|
||||||
pub fn unwind(&self, ctx: &Context) -> Result<Context, gimli::Error> {
|
pub fn unwind(&self, ctx: &Context) -> Result<Context, gimli::Error> {
|
||||||
let row = &self.row;
|
let row = &self.row;
|
||||||
let mut new_ctx = ctx.clone();
|
let mut new_ctx = ctx.clone();
|
||||||
|
Loading…
Reference in New Issue
Block a user