TOPLLab / WARDuino

📟 A dynamic WebAssembly VM for embedded systems
https://topllab.github.io/WARDuino/
Mozilla Public License 2.0
72 stars 7 forks source link

Move address util functions into Module struct #239

Open MaartenS11 opened 3 months ago

MaartenS11 commented 3 months ago

Currently the debugger uses a lambda

auto toVA = [m](uint8_t *addr) { return toVirtualAddress(addr, m); };

and then later the code uses

toVA(m->pc_ptr)

It's just a short way of writing toVirtualAddress(m->pc_ptr, m). By moving the virtual adress conversion into a module function we can do something like m->toVirtualAddress(addr) which is a bit better and doesn't use the lambda.