Start tracking the debug information origin for each instruction #67
Comments
|
I'm imagining that each instruction would have something like this associated with it: enum Whatever {
NoDebugInfo,
DebugInfoForFileOffset(u64),
DebugInfo(DebugInfoId),
}We would have methods for providing this info whenever creating new instructions. The As we emit wasm, we read the input DWARF and move from The gimli writer api already has arenas and ids, so we can either newtype all that stuff or just expose and use it directly. This is all pretty half-baked. I also have been meaning to look closer at how llvm structure's its debug info APIs. |
|
I have started playing with walrus + DWARF and while I am now able to obtain the DWARF info for each Is the idea to take the offset at the beginning of decoding a function and make the |
|
Are there any updates? I am curious to hear if this is moving forward and if we can soon start debugging Rust code in Chrome via DWARF debugging information. |
|
I'm still trying to figure out the base address so I can map DWARF offsets to instruction byte addresses. The problem I have is that I don't know enough about it all to be sure that there's always just one section in DWARF for wasm and consequently only one base address. I could just grab the base address by looking at the code section's base address? Or is that just true in my current setup? I'm guessing, but https://webassembly.github.io/spec/core/binary/modules.html#binary-codesec isn't clear on that. I would think that there are multiple DWARF sections, one for each module's code section? Can there even be multiple modules in one |
|
@oli-cosmian the "base address" within the WASM DWARF is basically 0. The offset of the code section is only added when addresses are used an the external interface. So for instance |
This is intended to be a tracking issue for now that's somewhat light on the details, but I wanted to make sure we had one tagged as
sprintfor our first 6 week sprint!@fitzgen do you want to fill in some more particulars here?
The text was updated successfully, but these errors were encountered: