Utility methods for artificial debug types in the generated DWARF#1482
Merged
yurydelendik merged 12 commits intobytecodealliance:masterfrom Apr 10, 2020
Merged
Utility methods for artificial debug types in the generated DWARF#1482yurydelendik merged 12 commits intobytecodealliance:masterfrom
yurydelendik merged 12 commits intobytecodealliance:masterfrom
Conversation
Subscribe to Label ActionThis issue or pull request has been labeled: "wasmtime:api" Users Subscribed to "wasmtime:api"To subscribe or unsubscribe from this label, edit the |
fitzgen
approved these changes
Apr 9, 2020
| /// Ensures that set_vmctx_memory and resolve_vmctx_memory_ptr are linked and | ||
| /// exported as symbols. It is a workaround: the executable normally ignores | ||
| /// `pub extern "C"`, see rust-lang/rust#25057. | ||
| pub fn ensure_exported() { |
Member
There was a problem hiding this comment.
If this module is pub (can also be #[doc(hidden)] to avoid "really" making it public) then I think we don't need this hack.
Contributor
There was a problem hiding this comment.
Or use #[doc(hidden)] pub use crate::debug_builtins::{set_vmctx_memory, resolve_vmctx_memory_ptr}; in the crate root.
Contributor
Author
There was a problem hiding this comment.
If you are suggesting to remove ensure_exported, then it does not work. See rust-lang/rust#25057
4 tasks
Co-Authored-By: Nick Fitzgerald <fitzgen@gmail.com>
dac2835 to
ba304fb
Compare
This was referenced Jul 29, 2020
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Currently, artificial "wrapper" types are created for pointer types. These wrappers display Wasm pointers as i32. To dereference such wrapper/pointer the function's vmctx is needed. This PR is an attempt to provide overrides for artificial type for
operator*andoperator->.The runtime/host has to have
set_vmctx_memoryandresolve_vmctx_memory_ptrbuiltins. The former sets current context and the former derefernces the Wasm pointer using current context's memory base.During LLDB session, a user has to call
__vmctx.set()to set the current context before calling any dereference operators. It can be automated via e.g.command regex pp 's/(.+)/p __vmctx->set(),%1/'.Example of the LLDB session (see also gist):
TODO:
_set_vmctx_memory/_resolve_vmctx_memory_ptrexported (Unable to export not mangled symbol in an executable as libraries can do rust-lang/rust#25057 ?)