-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a test that without debuginfo symbols still resolve
Almost all platforms should still have some degree of symbolication without debug symbols being present (aka the dynamic symbol table and such), so add a test asserting that symbols do indeed come out in these scenarios. This test will likely need to be blacklisted for platforms over time, but that's ok.
- Loading branch information
1 parent
f15a3e9
commit 2b8aae5
Showing
4 changed files
with
54 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
[package] | ||
name = "without_debuginfo" | ||
version = "0.1.0" | ||
authors = ["Alex Crichton <[email protected]>"] | ||
edition = "2018" | ||
|
||
[dependencies.backtrace] | ||
path = "../.." | ||
default-features = false | ||
features = [ | ||
# make sure a trace can be acquired | ||
'libunwind', | ||
'dbghelp', | ||
|
||
# Allow fallback to dladdr | ||
'dladdr', | ||
|
||
# Yes, we have `std` | ||
'std', | ||
] | ||
|
||
[profile.dev] | ||
debug = false | ||
|
||
[profile.test] | ||
debug = false | ||
|
||
[features] | ||
libbacktrace = ['backtrace/libbacktrace'] | ||
coresymbolication = ['backtrace/coresymbolication'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// intentionally blank |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#[test] | ||
fn all_frames_have_symbols() { | ||
println!("{:?}", backtrace::Backtrace::new()); | ||
|
||
let mut all_have_symbols = true; | ||
backtrace::trace(|frame| { | ||
let mut any = false; | ||
backtrace::resolve_frame(frame, |sym| { | ||
if sym.name().is_some() { | ||
any = true; | ||
} | ||
}); | ||
if !any && !frame.ip().is_null() { | ||
all_have_symbols = false; | ||
} | ||
true | ||
}); | ||
assert!(all_have_symbols); | ||
} |