Java Code Examples for org.luaj.vm2.LuaThread#State
The following examples show how to use
org.luaj.vm2.LuaThread#State .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DebugLib.java From XPrivacyLua with GNU General Public License v3.0 | 6 votes |
public Varargs invoke(Varargs args) { int a=1; LuaThread t = args.isthread(a)? args.checkthread(a++): globals.running; LuaValue func = args.optfunction(a++, null); String str = args.optjstring(a++,""); int count = args.optint(a++,0); boolean call=false,line=false,rtrn=false; for ( int i=0; i<str.length(); i++ ) switch ( str.charAt(i) ) { case 'c': call=true; break; case 'l': line=true; break; case 'r': rtrn=true; break; } LuaThread.State s = t.state; s.hookfunc = func; s.hookcall = call; s.hookline = line; s.hookcount = count; s.hookrtrn = rtrn; return NONE; }
Example 2
Source File: DebugLib.java From luaj with MIT License | 6 votes |
public void onInstruction(int pc, Varargs v, int top) { LuaThread.State s = globals.running.state; if (s.inhook) return; callstack().onInstruction(pc, v, top); if (s.hookfunc == null) return; if (s.hookcount > 0) if (++s.bytecodes % s.hookcount == 0) callHook(s, COUNT, NIL); if (s.hookline) { int newline = callstack().currentline(); if ( newline != s.lastline ) { s.lastline = newline; callHook(s, LINE, LuaValue.valueOf(newline)); } } }
Example 3
Source File: DebugLib.java From XPrivacyLua with GNU General Public License v3.0 | 6 votes |
public void onInstruction(int pc, Varargs v, int top) { LuaThread.State s = globals.running.state; if (s.inhook) return; callstack().onInstruction(pc, v, top); if (s.hookfunc == null) return; if (s.hookcount > 0) if (++s.bytecodes % s.hookcount == 0) callHook(s, COUNT, NIL); if (s.hookline) { int newline = callstack().currentline(); if ( newline != s.lastline ) { s.lastline = newline; callHook(s, LINE, LuaValue.valueOf(newline)); } } }
Example 4
Source File: DebugLib.java From HtmlNative with Apache License 2.0 | 6 votes |
public Varargs invoke(Varargs args) { int a=1; LuaThread t = args.isthread(a)? args.checkthread(a++): globals.running; LuaValue func = args.optfunction(a++, null); String str = args.optjstring(a++,""); int count = args.optint(a++,0); boolean call=false,line=false,rtrn=false; for ( int i=0; i<str.length(); i++ ) switch ( str.charAt(i) ) { case 'c': call=true; break; case 'l': line=true; break; case 'r': rtrn=true; break; } LuaThread.State s = t.state; s.hookfunc = func; s.hookcall = call; s.hookline = line; s.hookcount = count; s.hookrtrn = rtrn; return NONE; }
Example 5
Source File: DebugLib.java From luaj with MIT License | 6 votes |
public Varargs invoke(Varargs args) { int a=1; LuaThread t = args.isthread(a)? args.checkthread(a++): globals.running; LuaValue func = args.optfunction(a++, null); String str = args.optjstring(a++,""); int count = args.optint(a++,0); boolean call=false,line=false,rtrn=false; for ( int i=0; i<str.length(); i++ ) switch ( str.charAt(i) ) { case 'c': call=true; break; case 'l': line=true; break; case 'r': rtrn=true; break; } LuaThread.State s = t.state; s.hookfunc = func; s.hookcall = call; s.hookline = line; s.hookcount = count; s.hookrtrn = rtrn; return NONE; }
Example 6
Source File: DebugLib.java From HtmlNative with Apache License 2.0 | 6 votes |
public void onInstruction(int pc, Varargs v, int top) { LuaThread.State s = globals.running.state; if (s.inhook) return; callstack().onInstruction(pc, v, top); if (s.hookfunc == null) return; if (s.hookcount > 0) if (++s.bytecodes % s.hookcount == 0) callHook(s, COUNT, NIL); if (s.hookline) { int newline = callstack().currentline(); if ( newline != s.lastline ) { s.lastline = newline; callHook(s, LINE, LuaValue.valueOf(newline)); } } }
Example 7
Source File: DebugLib.java From XPrivacyLua with GNU General Public License v3.0 | 5 votes |
public Varargs invoke(Varargs args) { LuaThread t = args.narg() > 0 ? args.checkthread(1): globals.running; LuaThread.State s = t.state; return varargsOf( s.hookfunc != null? s.hookfunc: NIL, valueOf((s.hookcall?"c":"")+(s.hookline?"l":"")+(s.hookrtrn?"r":"")), valueOf(s.hookcount)); }
Example 8
Source File: DebugLib.java From HtmlNative with Apache License 2.0 | 5 votes |
public Varargs invoke(Varargs args) { LuaThread t = args.narg() > 0 ? args.checkthread(1): globals.running; LuaThread.State s = t.state; return varargsOf( s.hookfunc != null? s.hookfunc: NIL, valueOf((s.hookcall?"c":"")+(s.hookline?"l":"")+(s.hookrtrn?"r":"")), valueOf(s.hookcount)); }
Example 9
Source File: DebugLib.java From luaj with MIT License | 5 votes |
public Varargs invoke(Varargs args) { LuaThread t = args.narg() > 0 ? args.checkthread(1): globals.running; LuaThread.State s = t.state; return varargsOf( s.hookfunc != null? s.hookfunc: NIL, valueOf((s.hookcall?"c":"")+(s.hookline?"l":"")+(s.hookrtrn?"r":"")), valueOf(s.hookcount)); }
Example 10
Source File: DebugLib.java From luaj with MIT License | 4 votes |
public void onReturn() { LuaThread.State s = globals.running.state; if (s.inhook) return; callstack().onReturn(); if (s.hookrtrn) callHook(s, RETURN, NIL); }
Example 11
Source File: DebugLib.java From luaj with MIT License | 4 votes |
public void onCall(LuaClosure c, Varargs varargs, LuaValue[] stack) { LuaThread.State s = globals.running.state; if (s.inhook) return; callstack().onCall(c, varargs, stack); if (s.hookcall) callHook(s, CALL, NIL); }
Example 12
Source File: DebugLib.java From luaj with MIT License | 4 votes |
public void onCall(LuaFunction f) { LuaThread.State s = globals.running.state; if (s.inhook) return; callstack().onCall(f); if (s.hookcall) callHook(s, CALL, NIL); }
Example 13
Source File: DebugLib.java From HtmlNative with Apache License 2.0 | 4 votes |
public void onReturn() { LuaThread.State s = globals.running.state; if (s.inhook) return; callstack().onReturn(); if (s.hookrtrn) callHook(s, RETURN, NIL); }
Example 14
Source File: DebugLib.java From HtmlNative with Apache License 2.0 | 4 votes |
public void onCall(LuaClosure c, Varargs varargs, LuaValue[] stack) { LuaThread.State s = globals.running.state; if (s.inhook) return; callstack().onCall(c, varargs, stack); if (s.hookcall) callHook(s, CALL, NIL); }
Example 15
Source File: DebugLib.java From HtmlNative with Apache License 2.0 | 4 votes |
public void onCall(LuaFunction f) { LuaThread.State s = globals.running.state; if (s.inhook) return; callstack().onCall(f); if (s.hookcall) callHook(s, CALL, NIL); }
Example 16
Source File: DebugLib.java From XPrivacyLua with GNU General Public License v3.0 | 4 votes |
public void onReturn() { LuaThread.State s = globals.running.state; if (s.inhook) return; callstack().onReturn(); if (s.hookrtrn) callHook(s, RETURN, NIL); }
Example 17
Source File: DebugLib.java From XPrivacyLua with GNU General Public License v3.0 | 4 votes |
public void onCall(LuaClosure c, Varargs varargs, LuaValue[] stack) { LuaThread.State s = globals.running.state; if (s.inhook) return; callstack().onCall(c, varargs, stack); if (s.hookcall) callHook(s, CALL, NIL); }
Example 18
Source File: DebugLib.java From XPrivacyLua with GNU General Public License v3.0 | 4 votes |
public void onCall(LuaFunction f) { LuaThread.State s = globals.running.state; if (s.inhook) return; callstack().onCall(f); if (s.hookcall) callHook(s, CALL, NIL); }