You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently trying to implement source <-> bytecode mapping for compiler-explorer integration and noticed that the generated debug info (both DWARF and json) is quite limited. This is calling the debug build with forc build using OptLevel::Opt0.
For example:
script;fnget_num() -> u64{5}fnmain(){let x = 5;let y = get_num();let res = x + y;}
The generated symbols.json only contains mappings for the main function entry point:
Looking at the bytecode, we have operations like ADD, MOVE etc that should map to specific source locations (e.g. res = x + y on line 10), but these mappings are missing. This seems to be because many AllocatedOps aren't getting their owning_span populated which is required for them to be inserted into the sourcemap.
See #5511 (comment). Even at -O0, we remove some dead code, and that's why res here (and consequently x and y) get eliminated, thus not seen in the output. If you return res from main, you should see the instructions as well as its debug info.
I'm currently trying to implement source <-> bytecode mapping for compiler-explorer integration and noticed that the generated debug info (both DWARF and json) is quite limited. This is calling the debug build with
forc build
usingOptLevel::Opt0
.For example:
The generated symbols.json only contains mappings for the
main
function entry point:DWARF output shows the same limited info:
Looking at the bytecode, we have operations like ADD, MOVE etc that should map to specific source locations (e.g. res = x + y on line 10), but these mappings are missing. This seems to be because many
AllocatedOp
s aren't getting theirowning_span
populated which is required for them to be inserted into the sourcemap.The text was updated successfully, but these errors were encountered: