Add a feature gate to control whether hide self from trace
This commit is contained in:
parent
a942d60e1a
commit
68baa798fb
@ -17,8 +17,9 @@ alloc = []
|
||||
fde-phdr = ["libc"]
|
||||
fde-registry = ["alloc"]
|
||||
dwarf-expr = []
|
||||
hide-trace = []
|
||||
system-alloc = []
|
||||
default = ["dwarf-expr", "fde-phdr", "fde-registry"]
|
||||
default = ["dwarf-expr", "hide-trace", "fde-phdr", "fde-registry"]
|
||||
|
||||
[profile.dev]
|
||||
# Must be turned on due to Rust bug https://github.com/rust-lang/rust/issues/50007
|
||||
|
@ -402,7 +402,7 @@ pub unsafe extern "C-unwind" fn _Unwind_Backtrace(
|
||||
trace_argument: *mut c_void,
|
||||
) -> UnwindReasonCode {
|
||||
let mut ctx = save_context();
|
||||
let mut skipping = true;
|
||||
let mut skipping = cfg!(feature = "hide-trace");
|
||||
|
||||
loop {
|
||||
let frame = try1!(Frame::from_context(&ctx));
|
||||
|
Loading…
Reference in New Issue
Block a user