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
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
The text was updated successfully, but these errors were encountered:
In order to get the location information of a function, the following information can be stored.
At the module level, store the start location of the code section.
At a function level, store the start location of the function. This can be: body.range().start - number of bits used to represent function body size.
We must also store the end of the function. This can be from body.range().end
At an instruction level, store the offset in the function.
While encoding:
Update the start location of the code_section.
As you iterate through the injected instructions, calculate the offset to be applied to later instructions and functions.
Now, new location of functions/instructions will just be: code_section_start + injected_delta + original_offset.
Note: Must be careful to update the functions' size and use the updated size of that u32. Note 2: If locals were added to a function, need to take into account the extra space taken by them.
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 todebug_line
must 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
.wat
files, can usewasm-tools parse --generate-dwarf full
The text was updated successfully, but these errors were encountered: