Skip to content

A lightweight WebAssembly runtime that is fast, secure, and standards-compliant

Update gimli and addr2line dependencies (#12424)

Philip Craig7ee620a5b5d2
diff --git a/Cargo.lock b/Cargo.lock
index 4e1876bf1d..57b6e6dd2a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -13,11 +13,11 @@ dependencies = [
[[package]]
name = "addr2line"
-version = "0.25.1"
+version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b"
+checksum = "9698bf0769c641b18618039fe2ebd41eb3541f98433000f64e663fab7cea2c87"
dependencies = [
- "gimli 0.32.3",
+ "gimli 0.33.0",
]
[[package]]
@@ -763,7 +763,7 @@ dependencies = [
"cranelift-isle",
"criterion",
"env_logger 0.11.5",
- "gimli 0.32.3",
+ "gimli 0.33.0",
"hashbrown 0.15.2",
"libm",
"log",
@@ -830,7 +830,7 @@ dependencies = [
"cranelift-reader",
"file-per-thread-logger",
"filecheck",
- "gimli 0.32.3",
+ "gimli 0.33.0",
"libm",
"log",
"num_cpus",
@@ -1630,11 +1630,12 @@ dependencies = [
[[package]]
name = "gimli"
-version = "0.32.3"
+version = "0.33.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7"
+checksum = "0bf7f043f89559805f8c7cacc432749b2fa0d0a0a9ee46ce47164ed5ba7f126c"
dependencies = [
- "fallible-iterator",
+ "fnv",
+ "hashbrown 0.16.1",
"indexmap 2.11.4",
"stable_deref_trait",
]
@@ -1705,6 +1706,12 @@ dependencies = [
"serde",
]
+[[package]]
+name = "hashbrown"
+version = "0.16.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
+
[[package]]
name = "heck"
version = "0.4.1"
@@ -2015,7 +2022,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5"
dependencies = [
"equivalent",
- "hashbrown 0.15.2",
+ "hashbrown 0.16.1",
"serde",
"serde_core",
]
@@ -4498,7 +4505,7 @@ dependencies = [
name = "wasmtime"
version = "42.0.0"
dependencies = [
- "addr2line 0.25.1",
+ "addr2line 0.26.0",
"async-trait",
"bitflags 2.9.4",
"bumpalo",
@@ -4510,7 +4517,7 @@ dependencies = [
"env_logger 0.11.5",
"futures",
"fxprof-processed-profile",
- "gimli 0.32.3",
+ "gimli 0.33.0",
"hashbrown 0.15.2",
"indexmap 2.11.4",
"ittapi",
@@ -4619,7 +4626,7 @@ dependencies = [
"env_logger 0.11.5",
"filecheck",
"futures",
- "gimli 0.32.3",
+ "gimli 0.33.0",
"http",
"http-body-util",
"hyper",
@@ -4700,7 +4707,7 @@ dependencies = [
"cranelift-bitset",
"cranelift-entity",
"env_logger 0.11.5",
- "gimli 0.32.3",
+ "gimli 0.33.0",
"indexmap 2.11.4",
"log",
"object 0.37.3",
@@ -4875,7 +4882,7 @@ dependencies = [
"cranelift-entity",
"cranelift-frontend",
"cranelift-native",
- "gimli 0.32.3",
+ "gimli 0.33.0",
"itertools 0.14.0",
"log",
"object 0.37.3",
@@ -4973,7 +4980,7 @@ name = "wasmtime-internal-winch"
version = "42.0.0"
dependencies = [
"cranelift-codegen",
- "gimli 0.32.3",
+ "gimli 0.33.0",
"log",
"object 0.37.3",
"target-lexicon",
@@ -5386,7 +5393,7 @@ version = "42.0.0"
dependencies = [
"cranelift-assembler-x64",
"cranelift-codegen",
- "gimli 0.32.3",
+ "gimli 0.33.0",
"regalloc2",
"smallvec 1.15.1",
"target-lexicon",
diff --git a/Cargo.toml b/Cargo.toml
index c37eeae36e..a23ec3d974 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -363,8 +363,8 @@ backtrace = "0.3.75"
mutatis = "0.3.2"
cc = "1.2.41"
object = { version = "0.37.3", default-features = false, features = ['read_core', 'elf'] }
-gimli = { version = "0.32.3", default-features = false, features = ['read'] }
-addr2line = { version = "0.25.1", default-features = false }
+gimli = { version = "0.33.0", default-features = false, features = ['read'] }
+addr2line = { version = "0.26.0", default-features = false }
anyhow = { version = "1.0.100", default-features = false }
anyhow-for-testing = { package = "anyhow", version = "1.0.100", default-features = false }
windows-sys = "0.61.2"
diff --git a/crates/cranelift/src/debug/gc.rs b/crates/cranelift/src/debug/gc.rs
index 08e2ab90fe..0a6673332c 100644
--- a/crates/cranelift/src/debug/gc.rs
+++ b/crates/cranelift/src/debug/gc.rs
@@ -137,7 +137,7 @@ fn has_die_back_edge(die: &read::DebuggingInformationEntry<Reader<'_>>) -> read:
| constants::DW_TAG_imported_declaration
| constants::DW_TAG_imported_module
| constants::DW_TAG_module => false,
- constants::DW_TAG_subprogram => die.attr(constants::DW_AT_declaration)?.is_some(),
+ constants::DW_TAG_subprogram => die.attr(constants::DW_AT_declaration).is_some(),
_ => true,
};
Ok(result)
@@ -150,14 +150,14 @@ fn has_valid_code_range(
) -> read::Result<bool> {
match die.tag() {
constants::DW_TAG_subprogram => {
- if let Some(ranges_attr) = die.attr_value(constants::DW_AT_ranges)? {
+ if let Some(ranges_attr) = die.attr_value(constants::DW_AT_ranges) {
let offset = match ranges_attr {
read::AttributeValue::RangeListsRef(val) => unit.ranges_offset_from_raw(val),
read::AttributeValue::DebugRngListsIndex(index) => unit.ranges_offset(index)?,
_ => return Ok(false),
};
let mut has_valid_base = if let Some(read::AttributeValue::Addr(low_pc)) =
- die.attr_value(constants::DW_AT_low_pc)?
+ die.attr_value(constants::DW_AT_low_pc)
{
Some(at.can_translate_address(low_pc))
} else {
@@ -200,7 +200,7 @@ fn has_valid_code_range(
}
}
return Ok(false);
- } else if let Some(low_pc) = die.attr_value(constants::DW_AT_low_pc)? {
+ } else if let Some(low_pc) = die.attr_value(constants::DW_AT_low_pc) {
if let read::AttributeValue::Addr(a) = low_pc {
return Ok(at.can_translate_address(a));
} else if let read::AttributeValue::DebugAddrIndex(i) = low_pc {
@@ -222,9 +222,8 @@ fn build_die_dependencies(
) -> read::Result<()> {
let entry = die.entry();
let offset = entry.offset().to_unit_section_offset(&unit);
- let mut attrs = entry.attrs();
- while let Some(attr) = attrs.next()? {
- build_attr_dependencies(&attr, offset, unit, at, deps)?;
+ for attr in entry.attrs() {
+ build_attr_dependencies(attr, offset, unit, at, deps)?;
}
let mut children = die.children();
@@ -256,7 +255,7 @@ fn build_attr_dependencies(
deps.add_edge(offset, ref_offset);
}
read::AttributeValue::DebugInfoRef(val) => {
- let ref_offset = UnitSectionOffset::DebugInfoOffset(val);
+ let ref_offset = UnitSectionOffset(val.0);
deps.add_edge(offset, ref_offset);
}
_ => (),
diff --git a/crates/cranelift/src/debug/transform/attr.rs b/crates/cranelift/src/debug/transform/attr.rs
index 77da95ec5a..7ac15131a9 100644
--- a/crates/cranelift/src/debug/transform/attr.rs
+++ b/crates/cranelift/src/debug/transform/attr.rs
@@ -76,8 +76,7 @@ pub(crate) fn clone_die_attributes<'a>(
let mut is_obj_ptr = false;
prepare_die_context(unit, entry, &mut attr_context, &mut is_obj_ptr)?;
- let mut attrs = entry.attrs();
- while let Some(attr) = attrs.next()? {
+ for attr in entry.attrs() {
match attr.name() {
gimli::DW_AT_low_pc | gimli::DW_AT_high_pc | gimli::DW_AT_ranges => {
// Handled by RangeInfoBuilder.
@@ -420,13 +419,13 @@ fn is_obj_ptr_param<'a>(
// why do we need this heuristic as well?
// A: Declarations do not include DW_AT_object_pointer.
if param_num == 0
- && entry.attr_value(gimli::DW_AT_artificial)? == Some(AttributeValue::Flag(true))
+ && entry.attr_value(gimli::DW_AT_artificial) == Some(AttributeValue::Flag(true))
{
// Either this has no name (declarations omit them), or its explicitly "this".
- let name = entry.attr_value(gimli::DW_AT_name)?;
+ let name = entry.attr_value(gimli::DW_AT_name);
if name.is_none() || unit.attr_string(name.unwrap())?.slice().eq(b"this") {
// Finally, a type check. We expect a pointer.
- if let Some(type_attr) = entry.attr_value(gimli::DW_AT_type)? {
+ if let Some(type_attr) = entry.attr_value(gimli::DW_AT_type) {
if let Some(type_die) = resolve_die_ref(unit, &type_attr)? {
return Ok(type_die.tag() == gimli::DW_TAG_pointer_type);
}
diff --git a/crates/cranelift/src/debug/transform/debug_transform_logging.rs b/crates/cranelift/src/debug/transform/debug_transform_logging.rs
index eb33acb51d..c967d4904a 100644
--- a/crates/cranelift/src/debug/transform/debug_transform_logging.rs
+++ b/crates/cranelift/src/debug/transform/debug_transform_logging.rs
@@ -1,10 +1,7 @@
use crate::{debug::Reader, translate::get_vmctx_value_label};
use core::fmt;
use cranelift_codegen::{LabelValueLoc, ValueLabelsRanges, ir::ValueLabel, isa::TargetIsa};
-use gimli::{
- AttributeValue, DebuggingInformationEntry, LittleEndian, UnitOffset, UnitRef,
- UnitSectionOffset, write,
-};
+use gimli::{AttributeValue, DebuggingInformationEntry, LittleEndian, UnitOffset, UnitRef, write};
macro_rules! dbi_log_enabled {
() => {
@@ -29,8 +26,7 @@ pub struct CompileUnitSummary<'a, 'r> {
impl<'a, 'r> fmt::Debug for CompileUnitSummary<'a, 'r> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let unit = self.unit;
- let offs = get_offset_value(unit.header.offset());
- write!(f, "0x{offs:08x} [")?;
+ write!(f, "0x{:08x} [", unit.header.offset().0)?;
let comp_dir = match unit.comp_dir {
Some(dir) => &dir.to_string_lossy(),
None => "None",
@@ -56,8 +52,7 @@ pub struct DieRefSummary<'a, 'r> {
impl<'a, 'r> fmt::Debug for DieRefSummary<'a, 'r> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let section_offs = self.unit_ref.to_unit_section_offset(&self.unit);
- let offs = get_offset_value(section_offs);
- write!(f, "0x{offs:08x}")
+ write!(f, "0x{:08x}", section_offs.0)
}
}
@@ -70,7 +65,7 @@ pub fn log_get_die_ref<'a, 'r>(
struct DieDetailedSummary<'a, 'r> {
unit: UnitRef<'a, Reader<'r>>,
- die: &'a DebuggingInformationEntry<'a, 'a, Reader<'r>>,
+ die: &'a DebuggingInformationEntry<Reader<'r>>,
}
pub fn log_begin_input_die<'r>(
@@ -92,8 +87,7 @@ impl<'a, 'r> fmt::Debug for DieDetailedSummary<'a, 'r> {
let unit = self.unit;
write!(f, "{}\n", die.tag())?;
- let mut attrs = die.attrs();
- while let Some(attr) = attrs.next().unwrap_or(None) {
+ for attr in die.attrs() {
write!(f, " {} (", attr.name())?;
let attr_value = attr.value();
match attr_value {
@@ -150,8 +144,7 @@ impl<'a, 'r> fmt::Debug for DieDetailedSummary<'a, 'r> {
AttributeValue::Inline(value) => write!(f, "{value}"),
AttributeValue::Ordering(value) => write!(f, "{value}"),
AttributeValue::UnitRef(offset) => {
- let section_offset = offset.to_unit_section_offset(&unit);
- write!(f, "0x{:08x}", get_offset_value(section_offset))
+ write!(f, "0x{:08x}", offset.to_unit_section_offset(&unit).0)
}
AttributeValue::DebugInfoRef(offset) => write!(f, "0x{:08x}", offset.0),
unexpected_attr => write!(f, "<unexpected attr: {unexpected_attr:?}>"),
@@ -226,8 +219,8 @@ impl<'a> fmt::Debug for OutDieDetailedSummary<'a> {
write::AttributeValue::Ordering(value) => write!(f, "{value}"),
write::AttributeValue::UnitRef(unit_ref) => write!(f, "{unit_ref:?}>"),
write::AttributeValue::DebugInfoRef(reference) => match reference {
- write::Reference::Symbol(index) => write!(f, "symbol #{index}>"),
- write::Reference::Entry(unit_id, die_id) => {
+ write::DebugInfoRef::Symbol(index) => write!(f, "symbol #{index}>"),
+ write::DebugInfoRef::Entry(unit_id, die_id) => {
write!(f, "{die_id:?} in {unit_id:?}>")
}
},
@@ -273,13 +266,6 @@ pub fn log_end_output_die_skipped(
);
}
-fn get_offset_value(offset: UnitSectionOffset) -> usize {
- match offset {
- UnitSectionOffset::DebugInfoOffset(offs) => offs.0,
- UnitSectionOffset::DebugTypesOffset(offs) => offs.0,
- }
-}
-
pub fn log_get_value_name(value: ValueLabel) -> ValueNameSummary {
ValueNameSummary { value }
}
diff --git a/crates/cranelift/src/debug/transform/expression.rs b/crates/cranelift/src/debug/transform/expression.rs
index c19ec1f1cb..45ed49bc9d 100644
--- a/crates/cranelift/src/debug/transform/expression.rs
+++ b/crates/cranelift/src/debug/transform/expression.rs
@@ -647,7 +647,9 @@ where
| Operation::ImplicitValue { .. }
| Operation::ImplicitPointer { .. }
| Operation::EntryValue { .. }
- | Operation::ParameterRef { .. } => {
+ | Operation::ParameterRef { .. }
+ | Operation::VariableValue { .. }
+ | Operation::Uninitialized => {
return Ok(None);
}
Operation::WasmGlobal { index: _ } | Operation::WasmStack { index: _ } => {
diff --git a/crates/cranelift/src/debug/transform/range_info_builder.rs b/crates/cranelift/src/debug/transform/range_info_builder.rs
index 4547ecba00..052673a970 100644
--- a/crates/cranelift/src/debug/transform/range_info_builder.rs
+++ b/crates/cranelift/src/debug/transform/range_info_builder.rs
@@ -16,24 +16,24 @@ impl RangeInfoBuilder {
unit: UnitRef<Reader<'_>>,
entry: &DebuggingInformationEntry<Reader<'_>>,
) -> Result<Self, Error> {
- if let Some(AttributeValue::RangeListsRef(r)) = entry.attr_value(gimli::DW_AT_ranges)? {
+ if let Some(AttributeValue::RangeListsRef(r)) = entry.attr_value(gimli::DW_AT_ranges) {
let r = unit.ranges_offset_from_raw(r);
return RangeInfoBuilder::from_ranges_ref(unit, r);
};
- let low_pc =
- if let Some(AttributeValue::Addr(addr)) = entry.attr_value(gimli::DW_AT_low_pc)? {
- addr
- } else if let Some(AttributeValue::DebugAddrIndex(i)) =
- entry.attr_value(gimli::DW_AT_low_pc)?
- {
- unit.address(i)?
- } else {
- return Ok(RangeInfoBuilder::Undefined);
- };
+ let low_pc = if let Some(AttributeValue::Addr(addr)) = entry.attr_value(gimli::DW_AT_low_pc)
+ {
+ addr
+ } else if let Some(AttributeValue::DebugAddrIndex(i)) =
+ entry.attr_value(gimli::DW_AT_low_pc)
+ {
+ unit.address(i)?
+ } else {
+ return Ok(RangeInfoBuilder::Undefined);
+ };
Ok(
- if let Some(AttributeValue::Udata(u)) = entry.attr_value(gimli::DW_AT_high_pc)? {
+ if let Some(AttributeValue::Udata(u)) = entry.attr_value(gimli::DW_AT_high_pc) {
RangeInfoBuilder::Ranges(vec![(low_pc, low_pc + u)])
} else {
RangeInfoBuilder::Position(low_pc)
@@ -66,26 +66,24 @@ impl RangeInfoBuilder {
entry: &DebuggingInformationEntry<Reader<'_>>,
addr_tr: &AddressTransform,
) -> Result<Self, Error> {
- let addr =
- if let Some(AttributeValue::Addr(addr)) = entry.attr_value(gimli::DW_AT_low_pc)? {
- addr
- } else if let Some(AttributeValue::DebugAddrIndex(i)) =
- entry.attr_value(gimli::DW_AT_low_pc)?
- {
- unit.address(i)?
- } else if let Some(AttributeValue::RangeListsRef(r)) =
- entry.attr_value(gimli::DW_AT_ranges)?
- {
- let r = unit.ranges_offset_from_raw(r);
- let mut ranges = unit.ranges(r)?;
- if let Some(range) = ranges.next()? {
- range.begin
- } else {
- return Ok(RangeInfoBuilder::Undefined);
- }
+ let addr = if let Some(AttributeValue::Addr(addr)) = entry.attr_value(gimli::DW_AT_low_pc) {
+ addr
+ } else if let Some(AttributeValue::DebugAddrIndex(i)) =
+ entry.attr_value(gimli::DW_AT_low_pc)
+ {
+ unit.address(i)?
+ } else if let Some(AttributeValue::RangeListsRef(r)) = entry.attr_value(gimli::DW_AT_ranges)
+ {
+ let r = unit.ranges_offset_from_raw(r);
+ let mut ranges = unit.ranges(r)?;
+ if let Some(range) = ranges.next()? {
+ range.begin
} else {
return Ok(RangeInfoBuilder::Undefined);
- };
+ }
+ } else {
+ return Ok(RangeInfoBuilder::Undefined);
+ };
let index = addr_tr.find_func_index(addr);
if index.is_none() {
diff --git a/crates/cranelift/src/debug/transform/refs.rs b/crates/cranelift/src/debug/transform/refs.rs
index 027c82147f..ab5b42c86b 100644
--- a/crates/cranelift/src/debug/transform/refs.rs
+++ b/crates/cranelift/src/debug/transform/refs.rs
@@ -100,7 +100,7 @@ impl DebugInfoRefsMap {
if let Some((id, entry_id)) = self.map.get(&offset) {
die.set(
attr_name,
- write::AttributeValue::DebugInfoRef(write::Reference::Entry(
+ write::AttributeValue::DebugInfoRef(write::DebugInfoRef::Entry(
*id, *entry_id,
)),
);
diff --git a/crates/cranelift/src/debug/transform/simulate.rs b/crates/cranelift/src/debug/transform/simulate.rs
index cc47d1c424..24f6d6c7c8 100644
--- a/crates/cranelift/src/debug/transform/simulate.rs
+++ b/crates/cranelift/src/debug/transform/simulate.rs
@@ -196,7 +196,7 @@ fn generate_vars(
addr_tr: &AddressTransform,
frame_info: &FunctionFrameInfo,
scope_ranges: &[(u64, u64)],
- vmctx_ptr_die_ref: write::Reference,
+ vmctx_ptr_die_ref: write::DebugInfoRef,
wasm_types: &WasmTypesDieRefs,
func_meta: &FunctionMetadata,
locals_names: Option<&HashMap<u32, &str>>,
@@ -290,7 +290,7 @@ pub fn generate_simulated_dwarf(
addr_tr: &PrimaryMap<StaticModuleIndex, AddressTransform>,
translated: &HashSet<usize>,
out_encoding: gimli::Encoding,
- vmctx_ptr_die_refs: &PrimaryMap<StaticModuleIndex, write::Reference>,
+ vmctx_ptr_die_refs: &PrimaryMap<StaticModuleIndex, write::DebugInfoRef>,
out_units: &mut write::UnitTable,
out_strings: &mut write::StringTable,
isa: &dyn TargetIsa,
diff --git a/crates/cranelift/src/debug/transform/synthetic.rs b/crates/cranelift/src/debug/transform/synthetic.rs
index 1723baf5d7..f1477924d2 100644
--- a/crates/cranelift/src/debug/transform/synthetic.rs
+++ b/crates/cranelift/src/debug/transform/synthetic.rs
@@ -1,5 +1,5 @@
use gimli::write::{
- AttributeValue, LineProgram, Reference, StringTable, Unit, UnitEntryId, UnitId, UnitTable,
+ AttributeValue, DebugInfoRef, LineProgram, StringTable, Unit, UnitEntryId, UnitId, UnitTable,
};
use wasmtime_environ::StaticModuleIndex;
use wasmtime_versioned_export_macros::versioned_stringify_ident;
@@ -49,12 +49,12 @@ impl ModuleSyntheticUnit {
}
}
- pub fn vmctx_ptr_die_ref(&self) -> Reference {
- Reference::Entry(self.unit_id, self.vmctx_ptr_die_id)
+ pub fn vmctx_ptr_die_ref(&self) -> DebugInfoRef {
+ DebugInfoRef::Entry(self.unit_id, self.vmctx_ptr_die_id)
}
- pub fn wasm_ptr_die_ref(&self) -> Reference {
- Reference::Entry(self.unit_id, self.wasm_ptr_die_id)
+ pub fn wasm_ptr_die_ref(&self) -> DebugInfoRef {
+ DebugInfoRef::Entry(self.unit_id, self.wasm_ptr_die_id)
}
fn create_unit(
diff --git a/crates/cranelift/src/debug/transform/unit.rs b/crates/cranelift/src/debug/transform/unit.rs
index a6c78a453f..adda2c5969 100644
--- a/crates/cranelift/src/debug/transform/unit.rs
+++ b/crates/cranelift/src/debug/transform/unit.rs
@@ -62,9 +62,9 @@ fn get_base_type_name<'a>(
unit: UnitRef<Reader<'a>>,
) -> Result<String, Error> {
// FIXME remove recursion.
- if let Some(die_ref) = type_entry.attr_value(gimli::DW_AT_type)? {
+ if let Some(die_ref) = type_entry.attr_value(gimli::DW_AT_type) {
if let Some(ref die) = resolve_die_ref(unit, &die_ref)? {
- if let Some(value) = die.attr_value(gimli::DW_AT_name)? {
+ if let Some(value) = die.attr_value(gimli::DW_AT_name) {
return Ok(String::from(unit.attr_string(value)?.to_string()?));
}
match die.tag() {
@@ -113,7 +113,7 @@ fn replace_pointer_type<'a>(
parent_id: write::UnitEntryId,
kind: WebAssemblyPtrKind,
comp_unit: &mut write::Unit,
- wasm_ptr_die_ref: write::Reference,
+ wasm_ptr_die_ref: write::DebugInfoRef,
pointer_type_entry: &DebuggingInformationEntry<Reader<'a>>,
unit: UnitRef<Reader<'a>>,
out_strings: &mut write::StringTable,
@@ -154,7 +154,7 @@ fn replace_pointer_type<'a>(
gimli::DW_AT_type = write::AttributeValue::UnitRef(wrapper_die_id)
});
- let base_type_id = pointer_type_entry.attr_value(gimli::DW_AT_type)?;
+ let base_type_id = pointer_type_entry.attr_value(gimli::DW_AT_type);
// Build DW_TAG_reference_type for `T&`:
// .. DW_AT_type = <base_type>
add_tag!(parent_id, gimli::DW_TAG_reference_type => ref_type as ref_type_id {});
@@ -268,8 +268,7 @@ pub(crate) fn clone_unit<'a>(
dbi_log!("Cloning CU {:?}", log_get_cu_summary(unit));
let (mut out_unit, out_unit_id, file_map, file_index_base) =
- if let Some((depth_delta, entry)) = entries.next_dfs()? {
- assert_eq!(depth_delta, 0);
+ if let Some(entry) = entries.next_dfs()? {
let (out_line_program, debug_line_offset, file_map, file_index_base) =
clone_line_program(skeleton_unit, unit.name, addr_tr, out_encoding, out_strings)?;
@@ -297,7 +296,7 @@ pub(crate) fn clone_unit<'a>(
isa,
)?;
if split_unit.is_some() {
- if let Some((_, skeleton_entry)) = skeleton_unit.entries().next_dfs()? {
+ if let Some(skeleton_entry) = skeleton_unit.entries().next_dfs()? {
clone_die_attributes(
skeleton_unit,
skeleton_entry,
@@ -329,50 +328,36 @@ pub(crate) fn clone_unit<'a>(
dbi_log!("... skipped: empty CU (no DW_TAG_compile_unit entry)");
return Ok(None); // empty
};
- let mut current_depth = 0;
let mut skip_at_depth = None;
let mut current_frame_base = InheritedAttr::new();
let mut current_value_range = InheritedAttr::new();
let mut current_scope_ranges = InheritedAttr::new();
let mut current_subprogram = InheritedAttr::new();
- while let Some((depth_delta, entry)) = entries.next_dfs()? {
- current_depth += depth_delta;
+ while let Some(entry) = entries.next_dfs()? {
+ let current_depth = entry.depth();
log_begin_input_die(unit, entry, current_depth);
// If `skip_at_depth` is `Some` then we previously decided to skip over
- // a node and all it's children. Let A be the last node processed, B be
- // the first node skipped, C be previous node, and D the current node.
- // Then `cached` is the difference from A to B, `depth` is the difference
- // from B to C, and `depth_delta` is the differenc from C to D.
- let depth_delta = if let Some((depth, cached)) = skip_at_depth {
- // `new_depth` = B to D
- let new_depth = depth + depth_delta;
- // if D is below B continue to skip
- if new_depth > 0 {
- skip_at_depth = Some((new_depth, cached));
+ // a node and all it's children.
+ if let Some(depth) = skip_at_depth {
+ if current_depth > depth {
log_end_output_die_skipped(entry, unit, "unreachable", current_depth);
continue;
}
- // otherwise process D with `depth_delta` being the difference from A to D
skip_at_depth = None;
- new_depth + cached
- } else {
- depth_delta
- };
+ }
if !context
.reachable
.contains(&entry.offset().to_unit_section_offset(&unit))
{
// entry is not reachable: discarding all its info.
- // Here B = C so `depth` is 0. A is the previous node so `cached` =
- // `depth_delta`.
- skip_at_depth = Some((0, depth_delta));
+ skip_at_depth = Some(current_depth);
log_end_output_die_skipped(entry, unit, "unreachable", current_depth);
continue;
}
- let new_stack_len = stack.len().wrapping_add(depth_delta as usize);
+ let new_stack_len = current_depth as usize + 1;
current_frame_base.update(new_stack_len);
current_scope_ranges.update(new_stack_len);
current_value_range.update(new_stack_len);
@@ -391,8 +376,8 @@ pub(crate) fn clone_unit<'a>(
None
}
} else {
- let high_pc = entry.attr_value(gimli::DW_AT_high_pc)?;
- let ranges = entry.attr_value(gimli::DW_AT_ranges)?;
+ 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)?;
current_scope_ranges.push(new_stack_len, range_builder.get_ranges(addr_tr));
@@ -402,15 +387,11 @@ pub(crate) fn clone_unit<'a>(
}
};
- if depth_delta <= 0 {
- for _ in depth_delta..1 {
- stack.pop();
- }
- } else {
- assert_eq!(depth_delta, 1);
+ while stack.len() >= new_stack_len {
+ stack.pop();
}
- if let Some(AttributeValue::Exprloc(expr)) = entry.attr_value(gimli::DW_AT_frame_base)? {
+ if let Some(AttributeValue::Exprloc(expr)) = entry.attr_value(gimli::DW_AT_frame_base) {
if let Some(expr) = compile_expression(&expr, unit.encoding(), None)? {
current_frame_base.push(new_stack_len, expr);
}
diff --git a/crates/cranelift/src/debug/transform/utils.rs b/crates/cranelift/src/debug/transform/utils.rs
index 1f8b545ccd..3e25432511 100644
--- a/crates/cranelift/src/debug/transform/utils.rs
+++ b/crates/cranelift/src/debug/transform/utils.rs
@@ -9,7 +9,7 @@ use wasmtime_environ::error::Error;
pub(crate) fn append_vmctx_info(
comp_unit: &mut write::Unit,
parent_id: write::UnitEntryId,
- vmctx_ptr_die_ref: write::Reference,
+ vmctx_ptr_die_ref: write::DebugInfoRef,
addr_tr: &AddressTransform,
frame_info: Option<&FunctionFrameInfo>,
scope_ranges: &[(u64, u64)],
@@ -51,7 +51,7 @@ pub(crate) fn append_vmctx_info(
pub fn resolve_die_ref<'a, 'r>(
unit: UnitRef<'a, Reader<'r>>,
die_ref: &'a AttributeValue<Reader<'r>>,
-) -> Result<Option<DebuggingInformationEntry<'a, 'a, Reader<'r>>>, Error> {
+) -> Result<Option<DebuggingInformationEntry<Reader<'r>>>, Error> {
let die = match die_ref {
AttributeValue::UnitRef(unit_offs) => Some(unit.unit.entry(*unit_offs)?),
// TODO-DebugInfo: support AttributeValue::DebugInfoRef. The trouble is that we don't have
diff --git a/supply-chain/audits.toml b/supply-chain/audits.toml
index 73328b52a2..e5264b0e65 100644
--- a/supply-chain/audits.toml
+++ b/supply-chain/audits.toml
@@ -1990,6 +1990,12 @@ criteria = "safe-to-deploy"
delta = "0.25.0 -> 0.25.1"
notes = "Minor updates, looks like a minor bug fix, nothing awry."
+[[audits.addr2line]]
+who = "Alex Crichton <[email protected]>"
+criteria = "safe-to-deploy"
+delta = "0.25.1 -> 0.26.0"
+notes = "Nothing out of the ordinary for this update, all DWARF all the time."
+
[[audits.adler]]
who = "Alex Crichton <[email protected]>"
criteria = "safe-to-deploy"
@@ -6745,6 +6751,12 @@ user-id = 6825 # Dan Gohman (sunfishcode)
start = "2020-09-15"
end = "2026-10-10"
+[[trusted.gimli]]
+criteria = "safe-to-deploy"
+user-id = 4415 # Philip Craig (philipc)
+start = "2019-04-25"
+end = "2027-01-24"
+
[[trusted.h2]]
criteria = "safe-to-deploy"
user-id = 359 # Sean McArthur (seanmonstar)
@@ -6757,6 +6769,12 @@ user-id = 2915 # Amanieu d'Antras (Amanieu)
start = "2019-04-02"
end = "2025-12-02"
+[[trusted.hashbrown]]
+criteria = "safe-to-deploy"
+user-id = 55123 # rust-lang-owner
+start = "2025-04-30"
+end = "2027-01-24"
+
[[trusted.http]]
criteria = "safe-to-deploy"
user-id = 359 # Sean McArthur (seanmonstar)
diff --git a/supply-chain/imports.lock b/supply-chain/imports.lock
index 4e6b138468..4a4d65570a 100644
--- a/supply-chain/imports.lock
+++ b/supply-chain/imports.lock
@@ -660,6 +660,13 @@ user-id = 6825
user-login = "sunfishcode"
user-name = "Dan Gohman"
+[[publisher.gimli]]
+version = "0.33.0"
+when = "2026-01-24"
+user-id = 4415
+user-login = "philipc"
+user-name = "Philip Craig"
+
[[publisher.h2]]
version = "0.4.4"
when = "2024-04-03"
@@ -674,6 +681,12 @@ user-id = 2915
user-login = "Amanieu"
user-name = "Amanieu d'Antras"
+[[publisher.hashbrown]]
+version = "0.16.1"
+when = "2025-11-20"
+user-id = 55123
+user-login = "rust-lang-owner"
+
[[publisher.http]]
version = "1.3.1"
when = "2025-03-11"