Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic support for DWARF processing with components #8693

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

alexcrichton
Copy link
Member

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.

@alexcrichton alexcrichton requested a review from a team as a code owner May 25, 2024 19:55
@alexcrichton alexcrichton requested review from elliottt and removed request for a team May 25, 2024 19:55
@github-actions github-actions bot added wasmtime:api Related to the API of the `wasmtime` crate itself winch Winch issues or pull requests labels May 25, 2024
Copy link

Subscribe to Label Action

cc @saulecabrera

This issue or pull request has been labeled: "wasmtime:api", "winch"

Thus the following users have been cc'd because of the following labels:

  • saulecabrera: winch

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

Copy link
Member

@elliottt elliottt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

target_pointer_width = "64"
))]
fn dwarf_simple() -> Result<()> {
for wasm in [DWARF_SIMPLE, DWARF_SIMPLE_COMPONENT] {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@alexcrichton alexcrichton added this pull request to the merge queue Jun 5, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 5, 2024
@alexcrichton alexcrichton added this pull request to the merge queue Jun 5, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 5, 2024
@alexcrichton alexcrichton added this pull request to the merge queue Jun 5, 2024
@alexcrichton alexcrichton removed this pull request from the merge queue due to a manual request Jun 5, 2024
@alexcrichton alexcrichton added this pull request to the merge queue Jun 5, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 5, 2024
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.
@alexcrichton alexcrichton added this pull request to the merge queue Jun 5, 2024
Merged via the queue into bytecodealliance:main with commit dd8c48b Jun 5, 2024
36 checks passed
@alexcrichton alexcrichton deleted the component-dwarf branch June 5, 2024 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasmtime:api Related to the API of the `wasmtime` crate itself winch Winch issues or pull requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants