Skip to content

Commit

Permalink
Update gimli from 0.26.1 to 0.28.1
Browse files Browse the repository at this point in the history
Summary:
This release includes gimli-rs/addr2line#260 which unblocks supporting Split DWARF in reverie and cadaverdog.

Separately, ayermolo is looking into whether this gimli update fixes an issue with an iOS test that uses lionhead, and uses gimli to dump debuginfo, which is blocking the land of DWARF5.

Reviewed By: jasonwhite

Differential Revision: D51814926

fbshipit-source-id: ae0882432019250060c65792476a0f6e296daffb
  • Loading branch information
David Tolnay authored and facebook-github-bot committed Dec 4, 2023
1 parent ccaa2e5 commit b5d1131
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
3 changes: 1 addition & 2 deletions reverie/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ edition = "2021"
license = "BSD-2-Clause"

[dependencies]
addr2line = "0.18"
addr2line = "0.21"
anyhow = "1.0.75"
async-trait = "0.1.71"
bitflags = "1.3"
byteorder = "1.3"
gimli = "0.26"
lazy_static = "1.4"
libc = "0.2.139"
linked-hash-map = { version = "0.5", features = ["serde_impl"] }
Expand Down
17 changes: 16 additions & 1 deletion reverie/src/backtrace/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ use std::io;
use std::io::Read;
use std::path::PathBuf;

use addr2line::LookupContinuation;
use addr2line::LookupResult;
use serde::Deserialize;
use serde::Serialize;

Expand Down Expand Up @@ -155,7 +157,20 @@ impl Backtrace {
let symbols = cache.load(library)?;

// Find the file + line number of the instruction pointer.
if let Ok(mut source_frames) = symbols.find_frames(addr) {
let mut lookup_result = symbols.find_frames(addr);
if let Ok(mut source_frames) = loop {
match lookup_result {
LookupResult::Output(result) => break result,
LookupResult::Load {
load: _,
continuation,
} => {
// FIXME support Split DWARF
// let dwo = do_split_dwarf_load(load);
lookup_result = continuation.resume(None);
}
}
} {
while let Ok(Some(f)) = source_frames.next() {
if let Some(loc) = f.location {
locations.push(Location {
Expand Down
11 changes: 8 additions & 3 deletions reverie/src/backtrace/symbols.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ use std::os::unix::ffi::OsStrExt;
use std::path::Path;
use std::path::PathBuf;

use gimli::EndianSlice;
use gimli::RunTimeEndian as Endian;
use addr2line::gimli;
use addr2line::gimli::EndianSlice;
use addr2line::gimli::RunTimeEndian as Endian;
use memmap2::Mmap;
use object::Object as _;
use object::ObjectSegment;
Expand Down Expand Up @@ -173,7 +174,11 @@ impl Symbols {
pub fn find_frames(
&self,
probe: u64,
) -> Result<addr2line::FrameIter<EndianSlice<'static, Endian>>, gimli::read::Error> {
) -> addr2line::LookupResult<
impl addr2line::LookupContinuation<
Output = Result<addr2line::FrameIter<EndianSlice<'static, Endian>>, gimli::read::Error>,
>,
> {
self.context.dwarf.find_frames(probe + self.base_addr())
}

Expand Down

0 comments on commit b5d1131

Please sign in to comment.