Skip to content

Commit

Permalink
Merge pull request #400 from philipc/issue-296-2
Browse files Browse the repository at this point in the history
cfi: various cleanups
  • Loading branch information
philipc authored Mar 7, 2019
2 parents b8d7ee7 + bfc4f72 commit f30aeaa
Show file tree
Hide file tree
Showing 4 changed files with 321 additions and 251 deletions.
8 changes: 4 additions & 4 deletions benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ mod cfi {
}
CieOrFde::Fde(partial) => {
let fde = partial
.parse(|offset| eh_frame.cie_from_offset(&bases, offset))
.parse(EhFrame::cie_from_offset)
.expect("Should be able to get CIE for FED");
test::black_box(fde);
}
Expand Down Expand Up @@ -594,7 +594,7 @@ mod cfi {
}
CieOrFde::Fde(partial) => {
let fde = partial
.parse(|offset| eh_frame.cie_from_offset(&bases, offset))
.parse(EhFrame::cie_from_offset)
.expect("Should be able to get CIE for FED");
let mut instrs = fde.instructions();
while let Some(i) =
Expand Down Expand Up @@ -627,7 +627,7 @@ mod cfi {
CieOrFde::Cie(_) => {}
CieOrFde::Fde(partial) => {
let fde = partial
.parse(|offset| eh_frame.cie_from_offset(&bases, offset))
.parse(EhFrame::cie_from_offset)
.expect("Should be able to get CIE for FED");
let mut table = fde
.rows(&mut ctx)
Expand Down Expand Up @@ -665,7 +665,7 @@ mod cfi {
CieOrFde::Cie(_) => {}
CieOrFde::Fde(partial) => {
let fde = partial
.parse(|offset| eh_frame.cie_from_offset(&bases, offset))
.parse(EhFrame::cie_from_offset)
.expect("Should be able to get CIE for FED");

let this_len = instrs_len(&fde);
Expand Down
4 changes: 2 additions & 2 deletions examples/dwarfdump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -642,10 +642,10 @@ fn dump_eh_frame<R: Reader, W: Write>(
}
Some(gimli::CieOrFde::Fde(partial)) => {
let mut offset = None;
let fde = partial.parse(|o| {
let fde = partial.parse(|_, bases, o| {
offset = Some(o);
cies.entry(o)
.or_insert_with(|| eh_frame.cie_from_offset(&bases, o))
.or_insert_with(|| eh_frame.cie_from_offset(bases, o))
.clone()
})?;

Expand Down
Loading

0 comments on commit f30aeaa

Please sign in to comment.