|
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 |
|
| #
7ee620a5 |
| 24-Jan-2026 |
Philip Craig <[email protected]> |
Update gimli and addr2line dependencies (#12424)
* Update gimli and addr2line dependencies
gimli has a significant number of breaking changes to adapt to.
* Add vets
---------
Co-authored-by: Al
Update gimli and addr2line dependencies (#12424)
* Update gimli and addr2line dependencies
gimli has a significant number of breaking changes to adapt to.
* Add vets
---------
Co-authored-by: Alex Crichton <[email protected]>
show more ...
|
|
Revision tags: v41.0.0, v36.0.4, v39.0.2, v40.0.2, v40.0.1 |
|
| #
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 ...
|
| #
557cc2d6 |
| 10-Oct-2025 |
Alex Crichton <[email protected]> |
Another batch of dependency updates (#11832)
* Another batch of dependency updates
Bringing some deps in `Cargo.toml` up-to-date with their latest versions along the same lines as #11820 to avoid d
Another batch of dependency updates (#11832)
* Another batch of dependency updates
Bringing some deps in `Cargo.toml` up-to-date with their latest versions along the same lines as #11820 to avoid deps getting too stale/old.
Code-wise this updates `anyhow` which enables preexisting Clippy warnings to check more code, so those warnings are fixed here as well.
prtest:full
* Run rustfmt
show more ...
|
|
Revision tags: v37.0.2, v37.0.1, v37.0.0, v36.0.2, v36.0.1, v36.0.0, v35.0.0, v24.0.4, v33.0.2, v34.0.2, 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 |
|
| #
d2c9d2a2 |
| 17-Mar-2025 |
SingleAccretion <[email protected]> |
[DWARF] Fix the loclist to exprloc optimization (#10400)
* Add a test
* Fix the loclist -> exprloc optimization
The expression must be valid over the entire parent scope.
|
|
Revision tags: 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, v27.0.0, v26.0.1, v25.0.3, v24.0.2, v26.0.0, v21.0.2, v22.0.1, v23.0.3, v25.0.2, v24.0.1 |
|
| #
eb07b15e |
| 30-Sep-2024 |
Alex Crichton <[email protected]> |
Handle another DWARF attribute when rewriting DWARF (#9335)
I don't know what `Data8` is, but it looks a lot like `Data4`, so process it in the same way as `Data4`.
Closes #9333
|
|
Revision tags: v25.0.1, v25.0.0, v24.0.0 |
|
| #
1ef3eecf |
| 19-Aug-2024 |
Philip Craig <[email protected]> |
Cleanup some DWARF transform code (#9139)
* Remove unneeded `cu_low_pc` parameter
`unit.low_pc` is the same value.
* Simplify `clone_line_program`
We were parsing things that had already been par
Cleanup some DWARF transform code (#9139)
* Remove unneeded `cu_low_pc` parameter
`unit.low_pc` is the same value.
* Simplify `clone_line_program`
We were parsing things that had already been parsed into `gimli::Unit`, such as `DW_AT_comp_dir`, `DW_AT_name`, and `DW_AT_stmt_list`.
* Use `gimli::Dwarf` methods in more places
show more ...
|
| #
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 |
|
| #
e4fe8182 |
| 08-Jul-2024 |
Alex Crichton <[email protected]> |
Fix panic with invalid DWARF file indices (#8913)
I'm not entirely sure what causes this but Wasmtime shouldn't panic with invalid DWARF. In general (#5537) Wasmtime's support for DWARF needs to be
Fix panic with invalid DWARF file indices (#8913)
I'm not entirely sure what causes this but Wasmtime shouldn't panic with invalid DWARF. In general (#5537) Wasmtime's support for DWARF needs to be rewritten, but in the meantime let's play whack-a-mole with panics and try to paper over issues.
Closes #8884 Closes #8904
show more ...
|
|
Revision tags: v22.0.0, 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 |
|
| #
02d10056 |
| 05-Feb-2024 |
yowl <[email protected]> |
Add cloning for DWARF String attributes (#7858)
* add cloning for String attributes
* use into_owned instead of to_vec to avoid a clone if possible.
|
|
Revision tags: 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 |
|
| #
7b16eccd |
| 05-Sep-2023 |
SingleAccretion <[email protected]> |
Support referencing stack slots in the DWARF debug info (#6960)
* Add a test
* Disable test
* Add support for specifying stack locations in debug info
Always emit SysV-style CFI unwind info if we
Support referencing stack slots in the DWARF debug info (#6960)
* Add a test
* Disable test
* Add support for specifying stack locations in debug info
Always emit SysV-style CFI unwind info if we need debug info, and reference it in the debug info using DW_OP_call_frame_cfa.
* Add toolchain comment to the test
* Add a comment and assert
show more ...
|
| #
d4a4d4f9 |
| 01-Sep-2023 |
SingleAccretion <[email protected]> |
Two fixes for the `-g` (debug info) option (#6931)
* Fix up a debug info transform bug
"Block"s in DWARF are arbitrary-sized constants.
They are used for e. g. __int128 constants in C/C++, which i
Two fixes for the `-g` (debug info) option (#6931)
* Fix up a debug info transform bug
"Block"s in DWARF are arbitrary-sized constants.
They are used for e. g. __int128 constants in C/C++, which is how this was hit.
* Add the ".vs" folder to ".gitignore"
This is generated by VS when using its "open folder feature".
* Monotonize instructon offsets after code emission
Turns out that this is easier then fixing them in-place when removing the branch because a bunch of ambient state needs to be passed through to the MachBuffer for that to become possible.
Testing: tested to fix the issue on both one of the reported samples as well as my own.
* Move the last optimize_branches earlier
It is more obviously correct this way that the code which is using buffer.cur_offset() is not reading stale values.
* Fix the zero-offset problem with NO_INST_OFFSET
Also delete EmitResult::inst_offsets, it was not used.
* Add a test
* Check both sides of the range for NO_INST_OFFSET
If either is unknown, err on the safe side.
show more ...
|
|
Revision tags: 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, 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 |
|
| #
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 ...
|