Le 25/09/2010 18:03, hank williams a écrit :
Nicolas,
We have designed a language for which we have also developed a poor/
starter VM. Now that everything works, we are thinking about how to
optimize it. One of the things we are considering is using Neko in
place of our current VM.
The one issue is that we have designed our VM to be able to operate in
debug mode so that we can go to a particular line of code, single
step, jump over, etc. I am wondering how/if it might be possible to do
such a thing with Neko. If it is possible, it might be an ideal
solution.
Hank
Hi Hank,
Adding interactive debugging to NekoVM should not be that hard.
Basically you need to open a socket at VM startup so the debugger can
connect to it, and then check for network events on a regular basis in
the interp loop (you'll have to disable JIT in debug mode).
Setting a breakpoint can be done by mutating the bytecode in memory so
that the interp loop block until it get a debugger answer. The VM can
then send the callstack / values stack / globals upon debugger request.
Tell me if you try to implement this, I can give some tips for it.
Best,
Nicolas
--
Neko : One VM to run them all
(http://nekovm.org)