Skip to content

Commit fc0cb6b

Browse files
committed
Update addr2line dependency to 0.15.0
1 parent 1ddaeba commit fc0cb6b

File tree

3 files changed

+8
-22
lines changed

3 files changed

+8
-22
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ cpp_demangle = { default-features = false, version = "0.3.0", optional = true }
3636

3737
# Optional dependencies enabled through the `gimli-symbolize` feature, do not
3838
# use these features directly.
39-
addr2line = { version = "0.14.1", optional = true, default-features = false }
39+
addr2line = { version = "0.15.0", optional = true, default-features = false }
4040
miniz_oxide = { version = "0.4.0", optional = true, default-features = false }
4141
[dependencies.object]
4242
version = "0.23"

crates/as-if-std/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ bench = false
1515
cfg-if = "1.0"
1616
rustc-demangle = "0.1.4"
1717
libc = { version = "0.2.45", default-features = false }
18-
addr2line = { version = "0.14.1", default-features = false }
18+
addr2line = { version = "0.15.0", default-features = false }
1919
miniz_oxide = { version = "0.4.0", default-features = false }
2020

2121
[dependencies.object]

src/symbolize/gimli.rs

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -85,27 +85,13 @@ struct Context<'a> {
8585

8686
impl<'data> Context<'data> {
8787
fn new(stash: &'data Stash, object: Object<'data>) -> Option<Context<'data>> {
88-
fn load_section<'data, S>(stash: &'data Stash, obj: &Object<'data>) -> S
89-
where
90-
S: gimli::Section<gimli::EndianSlice<'data, Endian>>,
91-
{
92-
let data = obj.section(stash, S::section_name()).unwrap_or(&[]);
93-
S::from(EndianSlice::new(data, Endian))
94-
}
95-
96-
let dwarf = addr2line::Context::from_sections(
97-
load_section(stash, &object),
98-
load_section(stash, &object),
99-
load_section(stash, &object),
100-
load_section(stash, &object),
101-
load_section(stash, &object),
102-
load_section(stash, &object),
103-
load_section(stash, &object),
104-
load_section(stash, &object),
105-
load_section(stash, &object),
106-
gimli::EndianSlice::new(&[], Endian),
107-
)
88+
let sections = gimli::Dwarf::load(|id| -> Result<_, ()> {
89+
let data = object.section(stash, id.name()).unwrap_or(&[]);
90+
Ok(EndianSlice::new(data, Endian))
91+
})
10892
.ok()?;
93+
let dwarf = addr2line::Context::from_dwarf(sections).ok()?;
94+
10995
Some(Context { dwarf, object })
11096
}
11197
}

0 commit comments

Comments
 (0)