Need to update dwarf debugging post instrumentation to make it consistent with updated wasm binary. User must not see any debugging information related to injected code. Any debugging information present before injection must translate and give identical outcomes.
When it comes to individual debug sections:
debug_info: Copy it across but information related to debug_line must be updated.
debug_line: Update the addresses with the new locations in the wasm binary. Will need to store metadata for this.
- All other sections: just copy
In order to generate dwarf data for handwritten .wat files, can use wasm-tools parse --generate-dwarf full
Need to update dwarf debugging post instrumentation to make it consistent with updated wasm binary. User must not see any debugging information related to injected code. Any debugging information present before injection must translate and give identical outcomes.
When it comes to individual
debugsections:debug_info: Copy it across but information related todebug_linemust be updated.debug_line: Update the addresses with the new locations in the wasm binary. Will need to store metadata for this.In order to generate dwarf data for handwritten
.watfiles, can usewasm-tools parse --generate-dwarf full