Upgrade to the latest versions of gimli, addr2line, object (#2901)

* Upgrade to the latest versions of gimli, addr2line, object

And adapt to API changes. New gimli supports wasm dwarf, resulting in
some simplifications in the debug crate.

* upgrade gimli usage in linux-specific profiling too

* Add "continue" statement after interpreting a wasm local dwarf opcode
This commit is contained in:
Benjamin Bouvier
2021-05-12 17:53:17 +02:00
committed by GitHub
parent 60f7b23ea1
commit d7053ea9c7
16 changed files with 195 additions and 190 deletions

View File

@@ -13,7 +13,7 @@ edition = "2018"
[dependencies]
anyhow = "1.0"
cfg-if = "1.0"
gimli = { version = "0.23.0", optional = true }
gimli = { version = "0.24.0", optional = true }
lazy_static = "1.4"
libc = { version = "0.2.60", default-features = false }
scroll = { version = "0.10.1", features = ["derive"], optional = true }
@@ -24,7 +24,7 @@ wasmtime-runtime = { path = "../runtime", version = "0.26.0" }
ittapi-rs = { version = "0.1.5", optional = true }
[dependencies.object]
version = "0.23.0"
version = "0.24.0"
optional = true
default-features = false
features = ['read_core', 'elf', 'std']

View File

@@ -371,7 +371,7 @@ impl State {
pid: u32,
tid: u32,
) -> Result<()> {
let file = object::File::parse(&dbg_image).unwrap();
let file = object::File::parse(dbg_image).unwrap();
let endian = if file.is_little_endian() {
gimli::RunTimeEndian::Little
} else {
@@ -386,8 +386,7 @@ impl State {
}
};
let load_section_sup = |_| Ok(borrow::Cow::Borrowed(&[][..]));
let dwarf_cow = gimli::Dwarf::load(&load_section, &load_section_sup)?;
let dwarf_cow = gimli::Dwarf::load(&load_section)?;
let borrow_section: &dyn for<'a> Fn(
&'a borrow::Cow<[u8]>,
)
@@ -599,9 +598,9 @@ impl State {
header: RecordHeader {
id: RecordId::JitCodeDebugInfo as u32,
record_size: 0,
timestamp: timestamp,
timestamp,
},
address: address,
address,
count: 0,
};
@@ -617,9 +616,9 @@ impl State {
)
.unwrap();
let filename = myfile.to_string_lossy()?;
let line = row.line().unwrap_or(0);
let line = row.line().map(|nonzero| nonzero.get()).unwrap_or(0);
let column = match row.column() {
gimli::ColumnType::Column(column) => column,
gimli::ColumnType::Column(column) => column.get(),
gimli::ColumnType::LeftEdge => 0,
};