Goal: port wasmito instrumentation to WARDuino main branch (see fork: carllocos/WARDuino)
Overview of the API (hook messages):
Implementation strategy:
- program counter: replace op code at program counter with magic constant
0xFF
- events: hijack existing ifs
- call fidx: copy block for
fidx in functions map to the new index N, replace the first instruction of the old function block with the magic constant 0xFF and index 0xN. Replace fidx with N in hook, and add return at end.
0xFF replaces instruction with the hook encoded as an array of bytes, each element of the hook is of type:
Structure of each building block:
DBG = I8 + I8
WASM = I8 + N x I8
Goal: port wasmito instrumentation to WARDuino main branch (see fork: carllocos/WARDuino)
Overview of the API (hook messages):
Implementation strategy:
0xFFfidxinfunctionsmap to the new indexN, replace the first instruction of the old function block with the magic constant0xFFand index0xN. Replace fidx withNin hook, and add return at end.0xFF replaces instruction with the hook encoded as an array of bytes, each element of the hook is of type:
0x010x02Structure of each building block: