Skip to content

Commit

Permalink
Merge pull request #828 from Tiwalun/update-gimli
Browse files Browse the repository at this point in the history
Update gimli to 0.29.0
  • Loading branch information
Urhengulas authored Apr 22, 2024
2 parents b5bb117 + 0236e89 commit cf4ca82
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

- [#828]: `defmt-decoder`: Update to `gimli 0.29`
- [#821]: Cleanup
- [#813]: doc: add note for the alloc feature flag
- [#812]: `defmt`: Add a feature to stop linking a default panic handler
- [#811]: `book`: Add some examples for byte slice/array hints as well
- [#800]: `defmt-macros`: Fix generic trait bounds in Format derive macro

[#828]: https://github.com/knurling-rs/defmt/pull/828
[#821]: https://github.com/knurling-rs/defmt/pull/821
[#813]: https://github.com/knurling-rs/defmt/pull/813
[#812]: https://github.com/knurling-rs/defmt/pull/812
Expand Down
2 changes: 1 addition & 1 deletion decoder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ defmt-json-schema = { version = "0.1", path = "./defmt-json-schema" }

# elf2table
anyhow = "1.0.65"
gimli = { version = "0.28", default-features = false, features = [
gimli = { version = "0.29", default-features = false, features = [
"read",
"std",
] }
Expand Down
7 changes: 4 additions & 3 deletions decoder/src/elf2table/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,15 +272,16 @@ pub fn get_locations(elf: &[u8], table: &Table) -> Result<Locations, anyhow::Err
};
let load_section_sup = |_| Ok(Cow::Borrowed(&[][..]));

let mut dwarf_cow = gimli::Dwarf::<Cow<[u8]>>::load::<_, anyhow::Error>(&load_section)?;
dwarf_cow.load_sup::<_, anyhow::Error>(&load_section_sup)?;
let dwarf_sections =
gimli::DwarfSections::<Cow<[u8]>>::load::<_, anyhow::Error>(&load_section)?;
let dwarf_sup_sections = gimli::DwarfSections::load::<_, anyhow::Error>(&load_section_sup)?;

let borrow_section: &dyn for<'a> Fn(
&'a Cow<[u8]>,
) -> gimli::EndianSlice<'a, gimli::RunTimeEndian> =
&|section| gimli::EndianSlice::new(section, endian);

let dwarf = dwarf_cow.borrow(&borrow_section);
let dwarf = dwarf_sections.borrow_with_sup(&dwarf_sup_sections, &borrow_section);

let mut units = dwarf.debug_info.units();

Expand Down

0 comments on commit cf4ca82

Please sign in to comment.