History log of /wasmtime-44.0.1/crates/cranelift/src/debug/transform/mod.rs (Results 1 – 19 of 19)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: dev, v36.0.9, v44.0.1, v43.0.2, v36.0.8, v24.0.8, v44.0.0, v43.0.1, v42.0.2, v36.0.7, v24.0.7, v43.0.0, v42.0.1, v41.0.4, v42.0.0, v40.0.4, v36.0.6, v24.0.6, v41.0.3, v41.0.2, v41.0.1, v36.0.5
# c4a38d67 26-Jan-2026 Philip Craig <[email protected]>

Use `gimli::write::Dwarf::convert_with_filter` for DWARF transform (#12428)

Replace parts of the transform code with `gimli`'s generic DWARF
transformation support. Most of the remaining code is spe

Use `gimli::write::Dwarf::convert_with_filter` for DWARF transform (#12428)

Replace parts of the transform code with `gimli`'s generic DWARF
transformation support. Most of the remaining code is specific to the
needs of Wasmtime.

The overall behaviour is the same as the previous implementation. We
build a graph of the DIE dependencies, and prune DIEs that don't have
valid code ranges. Then we traverse the DIE tree again and transform the
DIEs. However, there are some differences.

Previously, unresolved references to DIEs were stored in `PendingUnitRefs`
and `PendingDebugInfoRefs`, then at the end of the transformation we
went back and fixed up these references. The new behaviour reserves IDs
for all of the DIEs in the dependency tree before transformation, which
avoids the need to fix up references later. It also allows gimli to
correctly handle references in DWARF expressions, although that doesn't
currently matter for Wasmtime because it doesn't handle references in
expressions yet. The visible effect of this in Wasmtime is that the
order of transformed attributes will now always match the original DWARF.

The DIE tree pruning is slightly different. We no longer add back-edges
pointing to namespace DIEs or the root DIE, which previously caused some
DIEs to be reachable when they should not have been. In particular,
this affects DW_TAG_variable DIEs for global variables. Wasmtime can't
currently translate the location for globals, so they were added without
a valid DW_AT_location. These DIEs are now omitted from the transformed
DWARF. In the future when global variables can be translated correctly,
they can be included by calling `ReserveUnitSection::require_entry`.

Performance measurements for `wasmtime compile -D debug-info=y` show
minimal change.

show more ...


Revision tags: v40.0.3, v41.0.0, v36.0.4, v39.0.2, v40.0.2, v40.0.1
# b5272a5f 29-Dec-2025 Nick Fitzgerald <[email protected]>

Don't use fully-qualified paths for `wasmtime_environ::error::*` (#12221)

* Don't use fully-qualified paths for `wasmtime_environ::error::*`

Use the types via the `wasmtime_environ::prelude` instea

Don't use fully-qualified paths for `wasmtime_environ::error::*` (#12221)

* Don't use fully-qualified paths for `wasmtime_environ::error::*`

Use the types via the `wasmtime_environ::prelude` instead.

Follow up to https://github.com/bytecodealliance/wasmtime/pull/12204

* Fix unwinder build without cranelift feature

show more ...


# c7cab275 22-Dec-2025 Nick Fitzgerald <[email protected]>

wasmtime-cranelift: Use `wasmtime_environ::error` instead of `anyhow` (#12204)


Revision tags: v40.0.0, v39.0.1, v39.0.0, v38.0.4, v37.0.3, v36.0.3, v24.0.5, v38.0.3, v38.0.2, v38.0.1
# bd7b59da 19-Oct-2025 Philip Craig <[email protected]>

Delete DWARF `Reader` trait, also use `gimli::UnitRef` (#11883)

* Delete DWARF Reader trait

Use the existing Reader type alias instead. Most places were already
using this.

* Use `gimli::UnitRef`

Delete DWARF `Reader` trait, also use `gimli::UnitRef` (#11883)

* Delete DWARF Reader trait

Use the existing Reader type alias instead. Most places were already
using this.

* Use `gimli::UnitRef`

This reduces parameter counts and makes it harder to use the
wrong DWARF sections for split DWARF.

A drawback is that `UnitRef<'a, R>` is invariant over `R`,
so additional lifetime annotations are needed in some places.

This probably also fixes a bug with the parsing of
`AttributeValue::LocationListsRef`, but I didn't try to test this.

show more ...


Revision tags: v37.0.2, v37.0.1, v37.0.0, v36.0.2, v36.0.1, v36.0.0
# cfc05638 12-Aug-2025 Nick Fitzgerald <[email protected]>

Make Wasmtime's `FuncKey` one-to-one with Cranelift's `ir::UserExternalName` (#11415)

* Make Wasmtime's `FuncKey` one-to-one with Cranelift's `ir::UserExternalName`

`FuncKey`, which used to be call

Make Wasmtime's `FuncKey` one-to-one with Cranelift's `ir::UserExternalName` (#11415)

* Make Wasmtime's `FuncKey` one-to-one with Cranelift's `ir::UserExternalName`

`FuncKey`, which used to be called `CompileKey`, is now one-to-one with
`cranelift_codegen::ir::UserExternalName`, and is used for not just identifying
compilation objects but also relocations and call-graph edges. This allows us to
determine the `StaticModuleIndex` and `DefinedFuncIndex` pair for any
`cranelift_codegen::ir::FuncRef`, regardless of inlining depth, which fixes some
fuzz bugs on OSS-Fuzz.

This continues pushing on the idea that Wasmtime's compilation orchestration and
linking should be relatively agnostic to the kinds of things it is actually
compiling and linking, allowing us to tweak, add, and remove new kinds of
`FuncKey`s more easily. Adding a new `FuncKey` should not require modifying
relocation resolution, for example, just a little bit of code to run the
associated compilation and optionally some code to extract metadata into our
final artifacts for querying at runtime. Everything in between should Just
Continue Working. We still aren't all the way there yet, but this does bring us
a little bit closer.

Finally, in Cranelift's inlining pass, this adds a check that a block is
inserted in the layout before attempting to remove it from the layout, which
would otherwise cause panics. This was triggered by multi-level inlining and
now-unreachable blocks in the inner callees.

I'll note that this does update basically all of the disas tests, or at least
nearly all of them that make function calls. This is because the namespace/index
numbering pair changed slightly to align with `FuncKey`, but that should pretty
much be the only changes.

* remove debug info from panic message, it is only available in some `cfg`s

* fill out module doc comment

* Fix compilation without `component-model` feature

* Fix some more cfg compilations

* cargo fmt

* fix a wrong `&dyn Any` auto coercion; add helpful debug logging and assertions for this kind of thing

show more ...


# 4a722b89 29-Jul-2025 Philip Craig <[email protected]>

Fix calculation of reachable DWARF (#11338)

A single dependency graph indexed by `gimli::UnitSectionOffset` was used
to contain the dependencies from every `gimli::Dwarf`. However, this is not
corre

Fix calculation of reachable DWARF (#11338)

A single dependency graph indexed by `gimli::UnitSectionOffset` was used
to contain the dependencies from every `gimli::Dwarf`. However, this is not
correct because a `gimli::UnitSectionOffset` is only unique within its
associated `gimli::Dwarf`.

Fix by using one graph per `gimli::Dwarf`.

show more ...


Revision tags: v35.0.0, v24.0.4, v33.0.2, v34.0.2
# 2bac6574 07-Jul-2025 Alex Crichton <[email protected]>

Update the `log` dependency (#11197)

* Update the `log` dependency

This enables getting warnings about formatting strings in the `log`
crate directives which are then additionally fixed here as wel

Update the `log` dependency (#11197)

* Update the `log` dependency

This enables getting warnings about formatting strings in the `log`
crate directives which are then additionally fixed here as well.

* Update dependency directive in `Cargo.toml`

show more ...


Revision tags: v34.0.1, v33.0.1, v24.0.3, v32.0.1, v34.0.0, v33.0.0
# 90ac295e 19-May-2025 Alex Crichton <[email protected]>

Update Wasmtime to the 2024 Rust Edition (#10806)

* Update Wasmtime to the 2024 Rust Edition

Now that our MSRV supports the 2024 edition it's possible to make this
switch. This commit moves Wasmtim

Update Wasmtime to the 2024 Rust Edition (#10806)

* Update Wasmtime to the 2024 Rust Edition

Now that our MSRV supports the 2024 edition it's possible to make this
switch. This commit moves Wasmtime to the 2024 Edition to keep
up-to-date with Rust idioms and access many of the edition features
exclusive to the 2024 edition.

prtest:full

* Reformat with the 2024 edition

show more ...


Revision tags: v32.0.0, v31.0.0, v30.0.2, v30.0.1, v30.0.0, v29.0.1, v29.0.0, v28.0.1
# 0b2c9d72 27-Dec-2024 SingleAccretion <[email protected]>

[DWARF] Transform instance methods into static methods with a `__this` parameter (#9898)

* Add an instance method test

* Transform instance methods into static methods with a '__this' parameter


Revision tags: v28.0.0
# af476a51 02-Dec-2024 SingleAccretion <[email protected]>

Synthetic type centralization (#9700)


Revision tags: v27.0.0, v26.0.1, v25.0.3, v24.0.2
# 92cc0ad7 04-Nov-2024 SingleAccretion <[email protected]>

Add very basic logging to the debug info transform (#9526)

* Add very basic logging to the debug info transform

The DI transform is a kind of compiler and logging
is a very good way to gain insight

Add very basic logging to the debug info transform (#9526)

* Add very basic logging to the debug info transform

The DI transform is a kind of compiler and logging
is a very good way to gain insight into compilers.

* Fix C&P

* Bubble the "trace-log" feature up the dependency tree

And switch logging macros to always be enabled in debug.

Verified "trace-log" **does not** show up when running
'cargo tree -f "{p} {f}" -e features,normal,build'

* Fix dead code warnings

show more ...


Revision tags: v26.0.0, v21.0.2, v22.0.1, v23.0.3, v25.0.2, v24.0.1, v25.0.1, v25.0.0, v24.0.0
# 7e15d87b 16-Aug-2024 Philip Craig <[email protected]>

Handle more split DWARF attributes and forms (#9134)

This includes GNU split support for DWARF version 4.


# c7756bd2 15-Aug-2024 Philip Craig <[email protected]>

Use the correct DWARF sections and unit for parsing split DWARF (#9132)

The DWARF sections in `DebugInputContext` were always set to the DWARF sections
from the .wasm file. However, when parsing spl

Use the correct DWARF sections and unit for parsing split DWARF (#9132)

The DWARF sections in `DebugInputContext` were always set to the DWARF sections
from the .wasm file. However, when parsing split DWARF, most of the time we
want to be using the sections from the .dwp file instead. We were already
passing `gimli::Dwarf` to most places already so having the sections in
`DebugInputContext` was no benefit. So a lot of this commit is replacing
`context` with `dwarf`.

Next, sometimes we were using the wrong `gimli::Dwarf`. In general, we want
to use the skeleton unit for parsing line info, and the split unit for
everything else. `clone_unit` was wrongly using the DWARF associated with
the skeleton unit in many places. Instead of changing all of those places,
I've kept the variable names `dwarf` and `unit`, but changed which DWARF they
refer to. This also fits better with the non-split operation. So some of
the changes in this commit are updating places that were already correct
to use the new variable meanings.

Finally, this commit adds a call to `copy_relocated_attributes`. This copies
some info from the skeleton unit that is needed when parsing the split unit.

show more ...


Revision tags: v23.0.2, v23.0.1, v23.0.0, v22.0.0
# dd8c48b3 05-Jun-2024 Alex Crichton <[email protected]>

Add basic support for DWARF processing with components (#8693)

This commit updates the native-DWARF processing (the `-D debug-info` CLI
flag) to support components. Previously component support was

Add basic support for DWARF processing with components (#8693)

This commit updates the native-DWARF processing (the `-D debug-info` CLI
flag) to support components. Previously component support was not
implemented and if there was more than one core wasm module within a
component then dwarf would be ignored entirely.

This commit contains a number of refactorings to plumb a more full
compilation context throughout the dwarf processing pipeline. Previously
the data structures used only were able to support a single module. A
new `Compilation` structure is used to represent the results of an
entire compilation and is plumbed through the various locations. Most of
the refactorings in this commit were then to extend loops to loop over
more things and handle the case where there is more than one core wasm
module.

I'll admit I'm not expert on DWARF but basic examples appear to work
locally and most of the additions here seemed relatively straightforward
in terms of "add another loop to iterate over more things" but I'm not
100% sure how well this will work. In theory this now supports
concatenating DWARF sections across multiple core wasm modules, but
that's not super well tested.

show more ...


# f676c176 30-May-2024 Alex Crichton <[email protected]>

Enable rustc's `unused-lifetimes` lint (#8711)

* Enable rustc's `unused-lifetimes` lint

This is allow-by-default doesn't seem to have any false positives in
Wasmtime's codebase so enable it by defa

Enable rustc's `unused-lifetimes` lint (#8711)

* Enable rustc's `unused-lifetimes` lint

This is allow-by-default doesn't seem to have any false positives in
Wasmtime's codebase so enable it by default to help clean up vestiges of
old refactorings.

* Remove another unused lifetime

* Remove another unused lifetime

show more ...


Revision tags: v21.0.1, v21.0.0, v20.0.2, v20.0.1
# fb4f4cd3 24-Apr-2024 yowl <[email protected]>

Add initial support for DWARF Fission (#8055)

* add cloning for String attributes

* use into_owned instead of to_vec to avoid a clone if possible.

* runs, but does not substitute

* show vars from

Add initial support for DWARF Fission (#8055)

* add cloning for String attributes

* use into_owned instead of to_vec to avoid a clone if possible.

* runs, but does not substitute

* show vars from c program, start cleanup

* tiday

* resolve conflicts

* remove WASI folder

* Add module_builder

add dwarf_package to state for cache

* move dwarf loading to module_environ.rs

pass the dwarf as binary as low as module_environ.rs

* pass dwarf package rather than add to debug_info

* tidy option/result nested if

* revert some toml and whitespace.

* add features cranelift,winch to module_builder and compute_artifacts

remove some `use`s

* address some feedback

remove unused 'use's

* address some feedback

remove unused 'use's

* move wat feature condition to cover whole method.

* More feedback

Another try at wat feature move

* Another try at wat feature move

* change gimli exemption version

add typed-arena exemption

* add None for c-api

* move `use` to #cfg

* fix another config build

* revert unwanted code deletion

* move inner function closer to use

* revert extra param to Module::new

* workaround object crate bug.

* add missing parameter

* add missing parameter

* Merge remote-tracking branch 'origin/main' into dwarf-att-string

# Conflicts:
# crates/wasmtime/src/engine.rs
# crates/wasmtime/src/runtime/module.rs
# src/common.rs

* remove moduke

* use common gimli version of 28.1

* remove wasm feature, revert gimli version

* remove use of object for wasm dwarf

* remove NativeFile workaround, add feature for dwp loading

* sync winch signature

* revert bench api change

* add dwarf for no cache feature

* put back merge loss of module kind

* remove param from docs

* add dwarf fission lldb test

* simplify and include test source

* clang-format

* address feedback, remove packages

add docs
simplify return type

* remove Default use on ModuleTypesBuilder

* Remove an `unwrap()` and use `if let` instead

* Use `&[u8]` instead of `&Vec<u8>`

* Remove an `unwrap()` and return `None` instead

* Clean up some code in `transform_dwarf`

* Clean up some code in `replace_unit_from_split_dwarf`

* Clean up some code in `split_unit`

* Minor refactorings and documentation in `CodeBuilder`

* Restrict visibility of `dwarf_package_binary`

* Revert supply-chain folder changes

* Fix compile error on nightly

* prtest:full

* prtest:full

* prtest:full

* prtest:full

* prtest:full

* prtest:full

* prtest:full

* prtest:full

* use lldb 15

* prtest:full

* prtest:full

* load dwp when loading wasm bytes with path

* correct source file name

* remove debug

---------

Co-authored-by: Alex Crichton <[email protected]>

show more ...


Revision tags: v20.0.0, v17.0.3, v19.0.2, v18.0.4, v19.0.1, v19.0.0, v18.0.3, v18.0.2, v17.0.2, v18.0.1, v18.0.0, v17.0.1, v17.0.0, v16.0.0, v15.0.1, v15.0.0, v14.0.4, v14.0.3, v14.0.2, v13.0.1, v14.0.1, v14.0.0, minimum-viable-wasi-proxy-serve, v13.0.0, v12.0.2, v11.0.2, v10.0.2, v12.0.1, v12.0.0, v11.0.1, v11.0.0, v10.0.1, v10.0.0, v9.0.4, v9.0.3, v9.0.2, v9.0.1, v9.0.0
# 1cbca5a5 02-May-2023 Saúl Cabrera <[email protected]>

winch: Handle relocations and traps (#6298)

* winch: Handle relocations and traps

This change introduces handling of traps and relocations in Winch, which
was left out in https://github.com/bytecod

winch: Handle relocations and traps (#6298)

* winch: Handle relocations and traps

This change introduces handling of traps and relocations in Winch, which
was left out in https://github.com/bytecodealliance/wasmtime/pull/6119.

In order to so, this change moves the `CompiledFunction` struct to the
`wasmtime-cranelift-shared` crate, allowing Cranelift and Winch to
operate on a single, shared representation, following some of the ideas
discussed in https://github.com/bytecodealliance/wasmtime/pull/5944.

Even though Winch doesn't rely on all the fields of `CompiledFunction`,
it eventually will. With the addition of relocations and traps it
started to be more evident that even if we wanted to have different
representations of a compiled function, they would end up being very
similar.

This change also consolidates where the `traps` and `relocations` of the
`CompiledFunction` get created, by introducing a constructor that
operates on a `MachBufferFinalized<Final>`, esentially encapsulating
this process in a single place for both Winch and Cranelift.

* Rework the shared `CompiledFunction`

This commit reworks the shared `CompiledFunction` struct. The compiled
function now contains the essential pieces to derive all the information
to create the final object file and to derive the debug information for
the function.

This commit also decouples the dwarf emission process by introducing
a `metadata` field in the `CompiledFunction` struct, which is used as
the central structure for dwarf emission.

show more ...


Revision tags: v6.0.2, v7.0.1, v8.0.1, v8.0.0, v7.0.0, v6.0.1, v5.0.1, v4.0.1, v6.0.0, v5.0.0, v4.0.0, v3.0.1, v3.0.0, v1.0.2, v2.0.2, v2.0.1, v2.0.0, v1.0.1, v1.0.0, v0.40.1, v0.40.0, v0.39.1, v0.38.3, v0.38.2, v0.39.0, v0.38.1, v0.38.0, v0.37.0, v0.36.0, v0.35.3, v0.34.2, v0.35.2, v0.35.1, v0.35.0, v0.33.1, v0.34.1, v0.34.0, v0.33.0, v0.32.1, v0.32.0, v0.31.0, v0.30.0
# eb21ae14 23-Aug-2021 Alex Crichton <[email protected]>

Move definition of ModuleMemoryOffset (#3228)

This was historically defined in `wasmtime-environ` but it's only used
in `wasmtime-cranelift`, so this commit moves the definition to the
`debug` mod

Move definition of ModuleMemoryOffset (#3228)

This was historically defined in `wasmtime-environ` but it's only used
in `wasmtime-cranelift`, so this commit moves the definition to the
`debug` module where it's primarily used.

show more ...


# 87c33c29 18-Aug-2021 Alex Crichton <[email protected]>

Remove `wasmtime-environ`'s dependency on `cranelift-codegen` (#3199)

* Move `CompiledFunction` into wasmtime-cranelift

This commit moves the `wasmtime_environ::CompiledFunction` type into the
`

Remove `wasmtime-environ`'s dependency on `cranelift-codegen` (#3199)

* Move `CompiledFunction` into wasmtime-cranelift

This commit moves the `wasmtime_environ::CompiledFunction` type into the
`wasmtime-cranelift` crate. This type has lots of Cranelift-specific
pieces of compilation and doesn't need to be generated by all Wasmtime
compilers. This replaces the usage in the `Compiler` trait with a
`Box<Any>` type that each compiler can select. Each compiler must still
produce a `FunctionInfo`, however, which is shared information we'll
deserialize for each module.

The `wasmtime-debug` crate is also folded into the `wasmtime-cranelift`
crate as a result of this commit. One possibility was to move the
`CompiledFunction` commit into its own crate and have `wasmtime-debug`
depend on that, but since `wasmtime-debug` is Cranelift-specific at this
time it didn't seem like it was too too necessary to keep it separate.
If `wasmtime-debug` supports other backends in the future we can
recreate a new crate, perhaps with it refactored to not depend on
Cranelift.

* Move wasmtime_environ::reference_type

This now belongs in wasmtime-cranelift and nowhere else

* Remove `Type` reexport in wasmtime-environ

One less dependency on `cranelift-codegen`!

* Remove `types` reexport from `wasmtime-environ`

Less cranelift!

* Remove `SourceLoc` from wasmtime-environ

Change the `srcloc`, `start_srcloc`, and `end_srcloc` fields to a custom
`FilePos` type instead of `ir::SourceLoc`. These are only used in a few
places so there's not much to lose from an extra abstraction for these
leaf use cases outside of cranelift.

* Remove wasmtime-environ's dep on cranelift's `StackMap`

This commit "clones" the `StackMap` data structure in to
`wasmtime-environ` to have an independent representation that that
chosen by Cranelift. This allows Wasmtime to decouple this runtime
dependency of stack map information and let the two evolve
independently, if necessary.

An alternative would be to refactor cranelift's implementation into a
separate crate and have wasmtime depend on that but it seemed a bit like
overkill to do so and easier to clone just a few lines for this.

* Define code offsets in wasmtime-environ with `u32`

Don't use Cranelift's `binemit::CodeOffset` alias to define this field
type since the `wasmtime-environ` crate will be losing the
`cranelift-codegen` dependency soon.

* Commit to using `cranelift-entity` in Wasmtime

This commit removes the reexport of `cranelift-entity` from the
`wasmtime-environ` crate and instead directly depends on the
`cranelift-entity` crate in all referencing crates. The original reason
for the reexport was to make cranelift version bumps easier since it's
less versions to change, but nowadays we have a script to do that.
Otherwise this encourages crates to use whatever they want from
`cranelift-entity` since we'll always depend on the whole crate.

It's expected that the `cranelift-entity` crate will continue to be a
lean crate in dependencies and suitable for use at both runtime and
compile time. Consequently there's no need to avoid its usage in
Wasmtime at runtime, since "remove Cranelift at compile time" is
primarily about the `cranelift-codegen` crate.

* Remove most uses of `cranelift-codegen` in `wasmtime-environ`

There's only one final use remaining, which is the reexport of
`TrapCode`, which will get handled later.

* Limit the glob-reexport of `cranelift_wasm`

This commit removes the glob reexport of `cranelift-wasm` from the
`wasmtime-environ` crate. This is intended to explicitly define what
we're reexporting and is a transitionary step to curtail the amount of
dependencies taken on `cranelift-wasm` throughout the codebase. For
example some functions used by debuginfo mapping are better imported
directly from the crate since they're Cranelift-specific. Note that
this is intended to be a temporary state affairs, soon this reexport
will be gone entirely.

Additionally this commit reduces imports from `cranelift_wasm` and also
primarily imports from `crate::wasm` within `wasmtime-environ` to get a
better sense of what's imported from where and what will need to be
shared.

* Extract types from cranelift-wasm to cranelift-wasm-types

This commit creates a new crate called `cranelift-wasm-types` and
extracts type definitions from the `cranelift-wasm` crate into this new
crate. The purpose of this crate is to be a shared definition of wasm
types that can be shared both by compilers (like Cranelift) as well as
wasm runtimes (e.g. Wasmtime). This new `cranelift-wasm-types` crate
doesn't depend on `cranelift-codegen` and is the final step in severing
the unconditional dependency from Wasmtime to `cranelift-codegen`.

The final refactoring in this commit is to then reexport this crate from
`wasmtime-environ`, delete the `cranelift-codegen` dependency, and then
update all `use` paths to point to these new types.

The main change of substance here is that the `TrapCode` enum is
mirrored from Cranelift into this `cranelift-wasm-types` crate. While
this unfortunately results in three definitions (one more which is
non-exhaustive in Wasmtime itself) it's hopefully not too onerous and
ideally something we can patch up in the future.

* Get lightbeam compiling

* Remove unnecessary dependency

* Fix compile with uffd

* Update publish script

* Fix more uffd tests

* Rename cranelift-wasm-types to wasmtime-types

This reflects the purpose a bit more where it's types specifically
intended for Wasmtime and its support.

* Fix publish script

show more ...