TOPLLab / WARDuino

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

On arithmetic exceptions, the stack should be restored prior to the exception #163

Open carllocos opened 1 year ago

carllocos commented 1 year ago

When a division by zero is triggered and a snapshot of the state would be dumped. The tool client would not be able to see the 2 arguments of the division operation since the stack pointer is modified prior on raising the exception.

tolauwae commented 1 year ago

I don't see this as a bug but rather a different way of doing things or a new feature. Maybe we can put this one commit on its own branch with a PR to develop and include it in the next version as well?

It does seems like technically in the spec the values are removed from the stack: image

But perhaps since this is too useful for our debugger tools, we can depart from the spec here.

Probably something we want to discuss with @chscholl.