MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / resolve_die_ref

Function resolve_die_ref

crates/cranelift/src/debug/transform/utils.rs:51–65  ·  view source on GitHub ↗
(
    unit: UnitRef<'a, Reader<'r>>,
    die_ref: &AttributeValue<Reader<'r>>,
)

Source from the content-addressed store, hash-verified

49}
50
51pub fn resolve_die_ref<'a, 'r>(
52 unit: UnitRef<'a, Reader<'r>>,
53 die_ref: &AttributeValue<Reader<'r>>,
54) -> Result<Option<write::ConvertUnitEntry<'a, Reader<'r>>>, Error> {
55 let die = match die_ref {
56 AttributeValue::UnitRef(unit_offs) => {
57 Some(write::ConvertUnitEntry::read(unit, *unit_offs)?)
58 }
59 // TODO-DebugInfo: support AttributeValue::DebugInfoRef. The trouble is that we don't have
60 // a fast way to go from a DI offset to a unit offset (which is needed to parse the DIE).
61 // We would likely need to maintain a cache.
62 _ => None,
63 };
64 Ok(die)
65}

Callers 2

is_obj_ptr_paramFunction · 0.85
get_base_type_nameFunction · 0.85

Calls 2

OkFunction · 0.85
readFunction · 0.50

Tested by

no test coverage detected