Skip to content

Commit

Permalink
Merge pull request #3116 from fitzgen/update-gimli-and-addr2line
Browse files Browse the repository at this point in the history
Update `gimli` to 0.25; `addr2line` to 0.16
  • Loading branch information
fitzgen authored Jul 26, 2021
2 parents 0f068ac + 10eead1 commit a2cfddf
Show file tree
Hide file tree
Showing 19 changed files with 47 additions and 31 deletions.
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ wasmtime-wasi = { path = "crates/wasi", version = "0.28.0" }
wasmtime-wasi-crypto = { path = "crates/wasi-crypto", version = "0.28.0", optional = true }
wasmtime-wasi-nn = { path = "crates/wasi-nn", version = "0.28.0", optional = true }
structopt = { version = "0.3.5", features = ["color", "suggestions"] }
object = { version = "0.25.0", default-features = false, features = ["write"] }
object = { version = "0.26.0", default-features = false, features = ["write"] }
anyhow = "1.0.19"
target-lexicon = { version = "0.12.0", default-features = false }
pretty_env_logger = "0.4.0"
Expand Down
2 changes: 1 addition & 1 deletion cranelift/codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ target-lexicon = "0.12"
log = { version = "0.4.6", default-features = false }
serde = { version = "1.0.94", features = ["derive"], optional = true }
bincode = { version = "1.2.1", optional = true }
gimli = { version = "0.24.0", default-features = false, features = ["write"], optional = true }
gimli = { version = "0.25.0", default-features = false, features = ["write"], optional = true }
smallvec = { version = "1.6.1" }
peepmatic = { path = "../peepmatic", optional = true, version = "0.75.0" }
peepmatic-traits = { path = "../peepmatic/crates/traits", optional = true, version = "0.75.0" }
Expand Down
2 changes: 1 addition & 1 deletion cranelift/filetests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ cranelift-reader = { path = "../reader", version = "0.75.0" }
cranelift-preopt = { path = "../preopt", version = "0.75.0" }
file-per-thread-logger = "0.1.2"
filecheck = "0.5.0"
gimli = { version = "0.24.0", default-features = false, features = ["read"] }
gimli = { version = "0.25.0", default-features = false, features = ["read"] }
log = "0.4.6"
memmap2 = "0.2.1"
num_cpus = "1.8.0"
Expand Down
2 changes: 1 addition & 1 deletion cranelift/object/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ edition = "2018"
[dependencies]
cranelift-module = { path = "../module", version = "0.75.0" }
cranelift-codegen = { path = "../codegen", version = "0.75.0", default-features = false, features = ["std"] }
object = { version = "0.25.3", default-features = false, features = ["write"] }
object = { version = "0.26.0", default-features = false, features = ["write"] }
target-lexicon = "0.12"
anyhow = "1.0"
log = { version = "0.4.6", default-features = false }
Expand Down
4 changes: 2 additions & 2 deletions crates/debug/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ keywords = ["webassembly", "wasm", "debuginfo"]
edition = "2018"

[dependencies]
gimli = "0.24.0"
gimli = "0.25.0"
wasmparser = "0.79"
object = { version = "0.25.0", default-features = false, features = ["read_core", "elf", "write"] }
object = { version = "0.26.0", default-features = false, features = ["read_core", "elf", "write"] }
wasmtime-environ = { path = "../environ", version = "0.28.0" }
target-lexicon = { version = "0.12.0", default-features = false }
anyhow = "1.0"
Expand Down
4 changes: 3 additions & 1 deletion crates/debug/src/gc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ fn has_valid_code_range<R: Reader<Offset = usize>>(
constants::DW_TAG_subprogram => {
if let Some(ranges_attr) = die.attr_value(constants::DW_AT_ranges)? {
let offset = match ranges_attr {
read::AttributeValue::RangeListsRef(val) => val,
read::AttributeValue::RangeListsRef(val) => {
dwarf.ranges_offset_from_raw(unit, val)
}
read::AttributeValue::DebugRngListsIndex(index) => {
dwarf.ranges_offset(unit, index)?
}
Expand Down
4 changes: 3 additions & 1 deletion crates/debug/src/transform/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ fn is_exprloc_to_loclist_allowed(attr_name: gimli::constants::DwAt) -> bool {
}

pub(crate) fn clone_die_attributes<'a, R>(
dwarf: &gimli::Dwarf<R>,
unit: &Unit<R, R::Offset>,
entry: &DebuggingInformationEntry<R>,
context: &DebugInputContext<R>,
Expand Down Expand Up @@ -63,7 +64,7 @@ where
// FIXME for CU: currently address_transform operate on a single
// function range, and when CU spans multiple ranges the
// transformation may be incomplete.
RangeInfoBuilder::from(unit, entry, context, cu_low_pc)?
RangeInfoBuilder::from(dwarf, unit, entry, context, cu_low_pc)?
};
range_info.build(addr_tr, out_unit, current_scope_id);

Expand Down Expand Up @@ -139,6 +140,7 @@ where
write::AttributeValue::StringRef(out_strings.add(s))
}
AttributeValue::RangeListsRef(r) => {
let r = dwarf.ranges_offset_from_raw(unit, r);
let range_info = RangeInfoBuilder::from_ranges_ref(unit, r, context, cu_low_pc)?;
let range_list_id = range_info.build_ranges(addr_tr, &mut out_unit.ranges);
write::AttributeValue::RangeListRef(range_list_id)
Expand Down
1 change: 1 addition & 0 deletions crates/debug/src/transform/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ pub fn transform_dwarf(
while let Some(header) = iter.next().unwrap_or(None) {
let unit = di.dwarf.unit(header)?;
if let Some((id, ref_map, pending_refs)) = clone_unit(
&di.dwarf,
unit,
&context,
&addr_tr,
Expand Down
4 changes: 4 additions & 0 deletions crates/debug/src/transform/range_info_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub(crate) enum RangeInfoBuilder {

impl RangeInfoBuilder {
pub(crate) fn from<R>(
dwarf: &gimli::Dwarf<R>,
unit: &Unit<R, R::Offset>,
entry: &DebuggingInformationEntry<R>,
context: &DebugInputContext<R>,
Expand All @@ -24,6 +25,7 @@ impl RangeInfoBuilder {
R: Reader,
{
if let Some(AttributeValue::RangeListsRef(r)) = entry.attr_value(gimli::DW_AT_ranges)? {
let r = dwarf.ranges_offset_from_raw(unit, r);
return RangeInfoBuilder::from_ranges_ref(unit, r, context, cu_low_pc);
};

Expand Down Expand Up @@ -80,6 +82,7 @@ impl RangeInfoBuilder {
}

pub(crate) fn from_subprogram_die<R>(
dwarf: &gimli::Dwarf<R>,
unit: &Unit<R, R::Offset>,
entry: &DebuggingInformationEntry<R>,
context: &DebugInputContext<R>,
Expand All @@ -100,6 +103,7 @@ impl RangeInfoBuilder {
} else if let Some(AttributeValue::RangeListsRef(r)) =
entry.attr_value(gimli::DW_AT_ranges)?
{
let r = dwarf.ranges_offset_from_raw(unit, r);
let mut ranges = context.rnglists.ranges(
r,
unit_encoding,
Expand Down
11 changes: 8 additions & 3 deletions crates/debug/src/transform/unit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ where
}

pub(crate) fn clone_unit<'a, R>(
dwarf: &gimli::Dwarf<R>,
unit: Unit<R, R::Offset>,
context: &DebugInputContext<R>,
addr_tr: &'a AddressTransform,
Expand Down Expand Up @@ -302,6 +303,7 @@ where
};

clone_die_attributes(
dwarf,
&unit,
entry,
context,
Expand Down Expand Up @@ -369,8 +371,9 @@ where
current_scope_ranges.update(new_stack_len);
current_value_range.update(new_stack_len);
let range_builder = if entry.tag() == gimli::DW_TAG_subprogram {
let range_builder =
RangeInfoBuilder::from_subprogram_die(&unit, entry, context, addr_tr, cu_low_pc)?;
let range_builder = RangeInfoBuilder::from_subprogram_die(
dwarf, &unit, entry, context, addr_tr, cu_low_pc,
)?;
if let RangeInfoBuilder::Function(func_index) = range_builder {
if let Some(frame_info) = get_function_frame_info(memory_offset, funcs, func_index)
{
Expand All @@ -387,7 +390,8 @@ where
let high_pc = entry.attr_value(gimli::DW_AT_high_pc)?;
let ranges = entry.attr_value(gimli::DW_AT_ranges)?;
if high_pc.is_some() || ranges.is_some() {
let range_builder = RangeInfoBuilder::from(&unit, entry, context, cu_low_pc)?;
let range_builder =
RangeInfoBuilder::from(dwarf, &unit, entry, context, cu_low_pc)?;
current_scope_ranges.push(new_stack_len, range_builder.get_ranges(addr_tr));
Some(range_builder)
} else {
Expand Down Expand Up @@ -443,6 +447,7 @@ where
die_ref_map.insert(entry.offset(), die_id);

clone_die_attributes(
dwarf,
&unit,
entry,
context,
Expand Down
2 changes: 1 addition & 1 deletion crates/environ/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ serde = { version = "1.0.94", features = ["derive"] }
log = { version = "0.4.8", default-features = false }
more-asserts = "0.2.1"
cfg-if = "1.0"
gimli = "0.24"
gimli = "0.25.0"

[badges]
maintenance = { status = "actively-developed" }
6 changes: 4 additions & 2 deletions crates/environ/src/module_environ.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,9 @@ impl<'data> ModuleEnvironment<'data> {
let slice = gimli::EndianSlice::new(data, endian);

match name {
// Dwarf fields.
// `gimli::Dwarf` fields.
".debug_abbrev" => dwarf.debug_abbrev = gimli::DebugAbbrev::new(data, endian),
".debug_addr" => dwarf.debug_addr = gimli::DebugAddr::from(slice),
// TODO aranges?
".debug_info" => dwarf.debug_info = gimli::DebugInfo::new(data, endian),
".debug_line" => dwarf.debug_line = gimli::DebugLine::new(data, endian),
".debug_line_str" => dwarf.debug_line_str = gimli::DebugLineStr::from(slice),
Expand All @@ -226,6 +225,9 @@ impl<'data> ModuleEnvironment<'data> {
".debug_ranges" => info.debug_ranges = gimli::DebugRanges::new(data, endian),
".debug_rnglists" => info.debug_rnglists = gimli::DebugRngLists::new(data, endian),

// We don't use these at the moment.
".debug_aranges" | ".debug_pubnames" | ".debug_pubtypes" => return,

other => {
log::warn!("unknown debug section `{}`", other);
return;
Expand Down
2 changes: 1 addition & 1 deletion crates/fiber/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ features = [
cc = "1.0"

[dev-dependencies]
backtrace = "0.3"
backtrace = "0.3.61"
6 changes: 3 additions & 3 deletions crates/jit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ more-asserts = "0.2.1"
anyhow = "1.0"
cfg-if = "1.0"
log = "0.4"
gimli = { version = "0.24.0", default-features = false, features = ["write"] }
object = { version = "0.25.0", default-features = false, features = ["write"] }
gimli = { version = "0.25.0", default-features = false, features = ["write"] }
object = { version = "0.26.0", default-features = false, features = ["write"] }
serde = { version = "1.0.94", features = ["derive"] }
addr2line = { version = "0.15", default-features = false }
addr2line = { version = "0.16.0", default-features = false }

[target.'cfg(target_os = "windows")'.dependencies]
winapi = { version = "0.3.8", features = ["winnt", "impl-default"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/obj/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ edition = "2018"
[dependencies]
anyhow = "1.0"
wasmtime-environ = { path = "../environ", version = "0.28.0" }
object = { version = "0.25.0", default-features = false, features = ["write"] }
object = { version = "0.26.0", default-features = false, features = ["write"] }
more-asserts = "0.2.1"
target-lexicon = { version = "0.12.0", default-features = false }
wasmtime-debug = { path = "../debug", version = "0.28.0" }
Expand Down
4 changes: 2 additions & 2 deletions crates/profiling/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ edition = "2018"
[dependencies]
anyhow = "1.0"
cfg-if = "1.0"
gimli = { version = "0.24.0", optional = true }
gimli = { version = "0.25.0", optional = true }
lazy_static = "1.4"
libc = { version = "0.2.60", default-features = false }
scroll = { version = "0.10.1", features = ["derive"], optional = true }
Expand All @@ -23,7 +23,7 @@ wasmtime-runtime = { path = "../runtime", version = "0.28.0" }
ittapi-rs = { version = "0.1.5", optional = true }

[dependencies.object]
version = "0.25.0"
version = "0.26.0"
optional = true
default-features = false
features = ['read_core', 'elf', 'std']
Expand Down
2 changes: 1 addition & 1 deletion crates/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ indexmap = "1.0.2"
thiserror = "1.0.4"
more-asserts = "0.2.1"
cfg-if = "1.0"
backtrace = "0.3.55"
backtrace = "0.3.61"
lazy_static = "1.3.0"
rand = "0.8.3"
anyhow = "1.0.38"
Expand Down
2 changes: 1 addition & 1 deletion crates/wasmtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ anyhow = "1.0.19"
region = "2.2.0"
libc = "0.2"
cfg-if = "1.0"
backtrace = "0.3.42"
backtrace = "0.3.61"
rustc-demangle = "0.1.16"
cpp_demangle = "0.3.2"
log = "0.4.8"
Expand Down

0 comments on commit a2cfddf

Please sign in to comment.