Skip to content

Commit

Permalink
Merge pull request #215 from philipc/deps
Browse files Browse the repository at this point in the history
Update object/gimli deps
  • Loading branch information
philipc committed May 2, 2021
2 parents 72a7c69 + 2306612 commit 1676872
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 91 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,19 @@ jobs:
rustup default nightly
- run: cargo bench

rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install rustup
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal
- name: Install rust
run: |
rustup install stable
rustup default stable
rustup component add rustfmt
- run: cargo fmt --all -- --check

coverage:
runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ exclude = ["/benches/*", "/fixtures/*"]
travis-ci = { repository = "gimli-rs/addr2line" }

[dependencies]
gimli = { version = "0.23", default-features = false, features = ["read"] }
gimli = { version = "0.24", default-features = false, features = ["read"] }
fallible-iterator = { version = "0.2", default-features = false, optional = true }
object = { version = "0.23", default-features = false, features = ["read"], optional = true }
object = { version = "0.24", default-features = false, features = ["read"], optional = true }
smallvec = { version = "1", default-features = false, optional = true }
rustc-demangle = { version = "0.1", optional = true }
cpp_demangle = { version = "0.3", default-features = false, optional = true }
Expand Down
3 changes: 1 addition & 2 deletions benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ fn dwarf_load<'a>(object: &object::File<'a>) -> gimli::Dwarf<Cow<'a, [u8]>> {
.map(|section| section.uncompressed_data().unwrap())
.unwrap_or(Cow::Borrowed(&[][..])))
};
let load_section_sup = |_| Ok(Cow::Borrowed(&[][..]));
gimli::Dwarf::load(&load_section, &load_section_sup).unwrap()
gimli::Dwarf::load(&load_section).unwrap()
}

fn dwarf_borrow<'a>(
Expand Down
26 changes: 9 additions & 17 deletions examples/addr2line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use std::borrow::Cow;
use std::fs::File;
use std::io::{BufRead, Lines, StdinLock, Write};
use std::path::Path;
use std::result;

use clap::{App, Arg, Values};
use fallible_iterator::FallibleIterator;
Expand Down Expand Up @@ -38,7 +37,7 @@ impl<'a> Iterator for Addrs<'a> {
fn next(&mut self) -> Option<u64> {
let text = match *self {
Addrs::Args(ref mut vals) => vals.next().map(Cow::from),
Addrs::Stdin(ref mut lines) => lines.next().map(result::Result::unwrap).map(Cow::from),
Addrs::Stdin(ref mut lines) => lines.next().map(Result::unwrap).map(Cow::from),
};
text.as_ref()
.map(Cow::as_ref)
Expand Down Expand Up @@ -201,24 +200,17 @@ fn main() {
} else {
None
};
let mut load_sup_section = |id: gimli::SectionId| -> Result<_, _> {
if let Some(ref sup_object) = sup_object {
load_file_section(id, &sup_object, endian, &arena_data)
} else {
Ok(gimli::EndianSlice::new(&[][..], endian))
}
};

let symbols = object.symbol_map();
let dwarf = gimli::Dwarf::load(&mut load_section, &mut load_sup_section).unwrap();
let dwarf_sup = Some(
gimli::Dwarf::load(&mut load_sup_section, |_| -> Result<_, _> {
Ok(gimli::EndianSlice::new(&[][..], endian))
})
.unwrap(),
);
let mut dwarf = gimli::Dwarf::load(&mut load_section).unwrap();
if let Some(ref sup_object) = sup_object {
let mut load_sup_section = |id: gimli::SectionId| -> Result<_, _> {
load_file_section(id, sup_object, endian, &arena_data)
};
dwarf.load_sup(&mut load_sup_section).unwrap();
}

let ctx = Context::from_dwarf_with_sup(dwarf, dwarf_sup).unwrap();
let ctx = Context::from_dwarf(dwarf).unwrap();

let stdin = std::io::stdin();
let addrs = matches
Expand Down
Loading

0 comments on commit 1676872

Please sign in to comment.