-
Notifications
You must be signed in to change notification settings - Fork 65
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
Coredump: add local/stack value typing #199
Conversation
This change adds typing to local and stack values. Technically the type isn't strictly necessary as DWARF should indicate how to interpret the values. However, using types allows us to represent the lack of value, because it has been optimized out and more complex values like reference types. Closes WebAssembly#198 This change also updates links after switching to a new repo.
4a8587e
to
6fc92e1
Compare
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.
Seems reasonable to me!
As some unrelated comments to this PR itself:
- What is
codeoffset
relative to? The start of the wasm file or the start of the code section? - Right now there's a
reserved:u32
at the end of aframe
but at least elsewhere in the binary encoding for wasm this is typically done with a prefix byte rather than a postfix byte. That way the current frame would be0x00 codeoffset:u32 ...
and that0x00
could be reinterpreted as flags in the future for more fields or as a discriminant for an alternative way to specify a frame.
the start of the code section, as specified by https://yurydelendik.github.io/webassembly-dwarf/#pc. I sometimes found it to be unreliable, I'm using the funcidx as codeoffset for my experiments.
Yeah that's a good point. It's inconsistent and I'll fix it. Thanks |
FWIW I do think that the actual offset within the function is helpful since, as you've linked, it can be used to translate to a filename/line number in a backtrace. If you're unable to get |
@alexcrichton yes, that's actually a good idea; storing both the It has the added benefit of allowing to degrade to a backtrace of func indices if you don't have the source module with debug infos, which is not possible with just code offsets. |
code offsets are pretty important for DWARF because DWARF usually needs to refer to instructions rather than functions per se (I actually can't think of any cases off the top of my head where DWARF needs to refer a function abstractly rather than a particular piece of a function, but I could very well be wrong about that). If the intention is to have information general to the whole function or frame (and the exact path taken from one frame to the next isn't relevant) IMO a funcidx makes more sense. |
oops, I raced with @xtuc |
Oh sorry, so to clarify, I don't mind if it's funcidx, code-section offset, or function offset plus function index. I found it odd that it's specified as codeoffset but is being used as a funcidx right now. I don't personally have a horse in this race so don't have a preference. |
got it @alexcrichton. I like the idea of having both |
@dschuff please merge the change. I'm planning to follow up on |
This change adds typing to local and stack values. Technically the type
isn't strictly necessary as DWARF should indicate how to interpret the values.
However, using types allows us to represent the lack of value, because
it has been optimized out and more complex values like reference types.
Closes #198