-
Notifications
You must be signed in to change notification settings - Fork 66
feat: add DWARF debugging support and source mapping infrastructure #943
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
Draft
chirino
wants to merge
6
commits into
dylibso:main
Choose a base branch
from
chirino:debug
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7ef57c4
feat: add debugging support and source mapping infrastructure
chirino 12b368d
Don’t include the dwarf-rust parser in the project. It will be hoste…
chirino 5f35feb
Store the SMAP in a resource to avoid string size limits in class files.
chirino b0a077d
Applying PR suggestions
chirino c331f4d
Simplify stratum API.
chirino a8799e0
Improvements based PR suggestions
chirino File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| runtime/src/test/resources/example.smap eol=lf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,8 +3,11 @@ | |
| import com.dylibso.chicory.build.time.compiler.Config; | ||
| import com.dylibso.chicory.build.time.compiler.Generator; | ||
| import com.dylibso.chicory.compiler.InterpreterFallback; | ||
| import com.dylibso.chicory.runtime.DebugParser; | ||
| import java.io.File; | ||
| import java.io.IOException; | ||
| import java.util.ServiceConfigurationError; | ||
| import java.util.ServiceLoader; | ||
| import java.util.Set; | ||
| import org.apache.maven.model.Resource; | ||
| import org.apache.maven.plugin.AbstractMojo; | ||
|
|
@@ -76,6 +79,19 @@ public class ChicoryCompilerGenMojo extends AbstractMojo { | |
|
|
||
| @Override | ||
| public void execute() throws MojoExecutionException { | ||
|
|
||
| DebugParser debugParser = null; | ||
| // Use the DebugParser if it's on the classpath. | ||
| try { | ||
| for (var service : ServiceLoader.load(DebugParser.class)) { | ||
| debugParser = service; | ||
| getLog().info("Using debug parser: " + debugParser.getClass().getName()); | ||
| break; | ||
| } | ||
| } catch (ServiceConfigurationError ignore) { | ||
| debugParser = null; | ||
| } | ||
|
|
||
| getLog().info("Generating AOT classes for " + name + " from " + wasmFile); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unrelated - note to self(or anyone else) - remove |
||
|
|
||
| var config = | ||
|
|
@@ -87,6 +103,7 @@ public void execute() throws MojoExecutionException { | |
| .withTargetWasmFolder(targetWasmFolder.toPath()) | ||
| .withInterpreterFallback(interpreterFallback) | ||
| .withInterpretedFunctions(interpretedFunctions) | ||
| .withDebugParser(debugParser) | ||
| .build(); | ||
|
|
||
| var generator = new Generator(config); | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe let's add a comment describing what's going on here.
also, since this is a text file we could also just save it as a resource and load it as such at run-time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this eventually needs to be loaded by the CompilerInterpreterMachine. So it would need to know at least the class name to figure out the right resource name. I was jus trying to avoid changing that interface.