Re: Stack frame restart

  • From: Elias Hogstvedt <eliashogstvedt@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Sun, 21 Sep 2014 21:43:18 +0200

You can sort of simulate "break" by calling a function which would do an
infinite loop. Using this with debug.sethook and you can step to the next
line.

As for jumping back or restarting you could maybe call the function you're
in again (using debug.getinfo) with the same arguments (using
debug.getlocal) but this sounds very hacky and unreliable. I'm not sure if
the debug library is 100% in luajit but I do know that you need to disable
jit compilation to get an accurate call stack.

On Sun, Sep 21, 2014 at 9:01 PM, Denis Golovan <denis.golovan@xxxxxxxxx>
wrote:

> Hi all
>
> I am wondering, is it possible to create/simulate/force LuaJIT restart
> current stack frame?
>
> What I mean by that is something similar to some Common Lisp/APL
> implementations have.
>
> That is roughly following set of actions:
> - setting a breakpoint inside some function
> - waiting for it to trigger "debugger"
> - change/recompile current function code
> - and finally restart current stack frame using function new body
> without restarting the entire stack/all related functions.
>
> That thing is actually a killer feature...
>
> BR,
> Denis
>
>

Other related posts: