use of org.luaj.vm2.LuaThread in project LuaViewSDK by alibaba.
the class DebugLib method onCall.
public void onCall(LuaClosure c, Varargs varargs, LuaValue[] stack) {
LuaThread t = globals.running;
callstack().onCall(c, varargs, stack);
if (t.inhook)
return;
if (t.hookcall && t.hookfunc != null)
callHook(CALL, NIL);
}
use of org.luaj.vm2.LuaThread in project LuaViewSDK by alibaba.
the class DebugLib method onReturn.
public void onReturn() {
LuaThread t = globals.running;
callstack().onReturn();
if (t.inhook)
return;
if (t.hookcall && t.hookfunc != null)
callHook(RETURN, NIL);
}
use of org.luaj.vm2.LuaThread in project LuaViewSDK by alibaba.
the class DebugLib method callHook.
void callHook(LuaValue type, LuaValue arg) {
LuaThread t = globals.running;
t.inhook = true;
try {
t.hookfunc.call(type, arg);
} catch (LuaError e) {
throw e;
} catch (RuntimeException e) {
throw new LuaError(e);
} finally {
t.inhook = false;
}
}
use of org.luaj.vm2.LuaThread in project LuaViewSDK by alibaba.
the class DebugLib method onCall.
public void onCall(LuaFunction f) {
LuaThread t = globals.running;
callstack().onCall(f);
if (t.inhook)
return;
if (t.hookcall && t.hookfunc != null)
callHook(CALL, NIL);
}
use of org.luaj.vm2.LuaThread in project LuaViewSDK by alibaba.
the class DebugLib method onInstruction.
public void onInstruction(int pc, Varargs v, int top) {
LuaThread t = globals.running;
callstack().onInstruction(pc, v, top);
if (t.inhook)
return;
if (t.hookfunc == null)
return;
if (t.hookcount > 0)
if (++t.bytecodes % t.hookcount == 0)
callHook(COUNT, NIL);
if (t.hookline) {
int newline = callstack().currentline();
if (newline != t.lastline) {
t.lastline = newline;
callHook(LINE, LuaValue.valueOf(newline));
}
}
}