Skip to content

Switch to gimli-symbolize by default #324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,16 @@ jobs:
- run: cargo build
- run: cargo test
- run: cargo test --features "gimli-symbolize"
- run: cargo test --features "libbacktrace"
- run: cargo test --features "libbacktrace gimli-symbolize"
- run: cargo test --features "serialize-rustc"
- run: cargo test --features "serialize-serde"
- run: cargo test --features "verify-winapi"
- run: cargo test --features "cpp_demangle"
- run: cargo test --no-default-features
- run: cargo test --no-default-features --features "libbacktrace"
- run: cargo test --no-default-features --features "gimli-symbolize"
- run: cargo test --no-default-features --features "gimli-symbolize libbacktrace"
- run: cargo test --no-default-features --features "libbacktrace std"
- run: cargo test --no-default-features --features "gimli-symbolize std"
- run: cargo test --no-default-features --features "std"
Expand Down Expand Up @@ -182,5 +185,5 @@ jobs:
with:
submodules: true
- name: Install Rust
run: rustup update 1.32.0 && rustup default 1.32.0
run: rustup update 1.40.0 && rustup default 1.40.0
- run: cargo build
15 changes: 8 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,26 @@ features = ['read_core', 'elf', 'macho', 'pe']
winapi = { version = "0.3.3", optional = true }

[features]
# By default libstd support and libbacktrace is used to symbolize addresses.
default = ["std", "libbacktrace"]
# By default libstd support and gimli-symbolize is used to symbolize addresses.
default = ["std", "gimli-symbolize"]

# Include std support. This enables types like `Backtrace`.
std = []

#=======================================
# Methods of resolving symbols
#
# - libbacktrace: this feature activates the `backtrace-sys` dependency,
# building the libbacktrace library found in gcc repos. This is the historical
# default for the `backtrace` crate.
# - gimli-symbolize: use the `gimli-rs/addr2line` crate to symbolicate
# addresses into file, line, and name using DWARF debug information.
# - libbacktrace: this feature activates the `backtrace-sys` dependency,
# building the libbacktrace library found in gcc repos.
#
# Note that MSVC unconditionally uses the dbghelp library to symbolize and won't
# be affected by feature selection here.
libbacktrace = ["backtrace-sys/backtrace-sys"]
# be affected by feature selection here. Also note that it's highly unlikely you
# want to configure this. If you're having trouble getting backtraces it's
# likely best to open an issue.
gimli-symbolize = ["addr2line", "object", "std"]
libbacktrace = ["backtrace-sys/backtrace-sys"]

#=======================================
# Methods of serialization
Expand Down
1 change: 0 additions & 1 deletion src/symbolize/gimli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ cfg_if::cfg_if! {
use self::elf::Object;

fn native_libraries() -> Vec<Library> {
wut();
let mut ret = Vec::new();
unsafe {
libc::dl_iterate_phdr(Some(callback), &mut ret as *mut _ as *mut _);
Expand Down
1 change: 1 addition & 0 deletions src/symbolize/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ cfg_if::cfg_if! {
unsafe fn clear_symbol_cache_imp() {}
} else if #[cfg(all(
feature = "gimli-symbolize",
any(unix, windows),
not(target_os = "emscripten"),
))] {
mod gimli;
Expand Down