alexcrichton opened PR #5358 from fix-component-dwarf
to main
:
This commit fixes a bug with components by changing how DWARF information from a wasm binary is copied over to the final compiled artifact. Note that this is not the Wasmtime-generated DWARF but rather the native wasm DWARF itself used in backtraces.
Previously the wasm dwarf was inserted into sections
.*.wasm
where*
wasdebug_info
,debug_str
, etc -- one pergimli::SectionId
as found in the original wasm module. This does not work with components, however, where modules did not correctly separate their debug information into separate sections or otherwise disambiguate. The fix in this commit is to instead smash all the debug information together into one large section and store offsets into that giant section. This is similar to thename
-section scraping or the trap metadata section where one section contains all the data for all the modules in a component.This simplifies the object file parsing by only looking for one section name and doesn't add all that much complexity to serializing and looking up dwarf information as well.
<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
alexcrichton requested pchickey for a review on PR #5358.
pchickey submitted PR review.
alexcrichton merged PR #5358.
Last updated: Dec 23 2024 at 12:05 UTC