Skip to content

Commit 1676872

Browse files
authored
Merge pull request #215 from philipc/deps
Update object/gimli deps
2 parents 72a7c69 + 2306612 commit 1676872

6 files changed

Lines changed: 57 additions & 91 deletions

File tree

.github/workflows/rust.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,19 @@ jobs:
5353
rustup default nightly
5454
- run: cargo bench
5555

56+
rustfmt:
57+
runs-on: ubuntu-latest
58+
steps:
59+
- uses: actions/checkout@v2
60+
- name: Install rustup
61+
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal
62+
- name: Install rust
63+
run: |
64+
rustup install stable
65+
rustup default stable
66+
rustup component add rustfmt
67+
- run: cargo fmt --all -- --check
68+
5669
coverage:
5770
runs-on: ubuntu-latest
5871
steps:

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ exclude = ["/benches/*", "/fixtures/*"]
1515
travis-ci = { repository = "gimli-rs/addr2line" }
1616

1717
[dependencies]
18-
gimli = { version = "0.23", default-features = false, features = ["read"] }
18+
gimli = { version = "0.24", default-features = false, features = ["read"] }
1919
fallible-iterator = { version = "0.2", default-features = false, optional = true }
20-
object = { version = "0.23", default-features = false, features = ["read"], optional = true }
20+
object = { version = "0.24", default-features = false, features = ["read"], optional = true }
2121
smallvec = { version = "1", default-features = false, optional = true }
2222
rustc-demangle = { version = "0.1", optional = true }
2323
cpp_demangle = { version = "0.3", default-features = false, optional = true }

benches/bench.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ fn dwarf_load<'a>(object: &object::File<'a>) -> gimli::Dwarf<Cow<'a, [u8]>> {
3636
.map(|section| section.uncompressed_data().unwrap())
3737
.unwrap_or(Cow::Borrowed(&[][..])))
3838
};
39-
let load_section_sup = |_| Ok(Cow::Borrowed(&[][..]));
40-
gimli::Dwarf::load(&load_section, &load_section_sup).unwrap()
39+
gimli::Dwarf::load(&load_section).unwrap()
4140
}
4241

4342
fn dwarf_borrow<'a>(

examples/addr2line.rs

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use std::borrow::Cow;
1010
use std::fs::File;
1111
use std::io::{BufRead, Lines, StdinLock, Write};
1212
use std::path::Path;
13-
use std::result;
1413

1514
use clap::{App, Arg, Values};
1615
use fallible_iterator::FallibleIterator;
@@ -38,7 +37,7 @@ impl<'a> Iterator for Addrs<'a> {
3837
fn next(&mut self) -> Option<u64> {
3938
let text = match *self {
4039
Addrs::Args(ref mut vals) => vals.next().map(Cow::from),
41-
Addrs::Stdin(ref mut lines) => lines.next().map(result::Result::unwrap).map(Cow::from),
40+
Addrs::Stdin(ref mut lines) => lines.next().map(Result::unwrap).map(Cow::from),
4241
};
4342
text.as_ref()
4443
.map(Cow::as_ref)
@@ -201,24 +200,17 @@ fn main() {
201200
} else {
202201
None
203202
};
204-
let mut load_sup_section = |id: gimli::SectionId| -> Result<_, _> {
205-
if let Some(ref sup_object) = sup_object {
206-
load_file_section(id, &sup_object, endian, &arena_data)
207-
} else {
208-
Ok(gimli::EndianSlice::new(&[][..], endian))
209-
}
210-
};
211203

212204
let symbols = object.symbol_map();
213-
let dwarf = gimli::Dwarf::load(&mut load_section, &mut load_sup_section).unwrap();
214-
let dwarf_sup = Some(
215-
gimli::Dwarf::load(&mut load_sup_section, |_| -> Result<_, _> {
216-
Ok(gimli::EndianSlice::new(&[][..], endian))
217-
})
218-
.unwrap(),
219-
);
205+
let mut dwarf = gimli::Dwarf::load(&mut load_section).unwrap();
206+
if let Some(ref sup_object) = sup_object {
207+
let mut load_sup_section = |id: gimli::SectionId| -> Result<_, _> {
208+
load_file_section(id, sup_object, endian, &arena_data)
209+
};
210+
dwarf.load_sup(&mut load_sup_section).unwrap();
211+
}
220212

221-
let ctx = Context::from_dwarf_with_sup(dwarf, dwarf_sup).unwrap();
213+
let ctx = Context::from_dwarf(dwarf).unwrap();
222214

223215
let stdin = std::io::stdin();
224216
let addrs = matches

0 commit comments

Comments
 (0)