Package com.prineside.luaj
Class Print
java.lang.Object
com.prineside.luaj.Lua
com.prineside.luaj.Print
Debug helper class to pretty-print lua bytecodes.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String[]
String names for each lua opcode value.static PrintStream
Fields inherited from class com.prineside.luaj.Lua
_LUAJ_VERSION, _VERSION, BITRK, iABC, iABx, iAsBx, iAx, LFIELDS_PER_FLUSH, LUA_MULTRET, luaP_opmodes, MASK_A, MASK_Ax, MASK_B, MASK_Bx, MASK_C, MASK_NOT_A, MASK_NOT_B, MASK_NOT_Bx, MASK_NOT_C, MASK_NOT_OP, MASK_OP, MAX_CALL_STACK, MAX_OP, MAXARG_A, MAXARG_Ax, MAXARG_B, MAXARG_Bx, MAXARG_C, MAXARG_sBx, MAXINDEXRK, NO_REG, NUM_OPCODES, OP_ADD, OP_AND, OP_CALL, OP_CLOSURE, OP_CONCAT, OP_DIV, OP_EQ, OP_EXTRAARG, OP_FORLOOP, OP_FORPREP, OP_GE, OP_GETTABLE, OP_GETTABUP, OP_GETUPVAL, OP_GT, OP_JMP, OP_LE, OP_LEN, OP_LOADBOOL, OP_LOADK, OP_LOADKX, OP_LOADNIL, OP_LT, OP_MOD, OP_MOVE, OP_MUL, OP_NEQ, OP_NEWTABLE, OP_NOT, OP_OR, OP_POW, OP_RETURN, OP_SELF, OP_SETLIST, OP_SETTABLE, OP_SETTABUP, OP_SETUPVAL, OP_SUB, OP_TAILCALL, OP_TEST, OP_TESTSET, OP_TFORCALL, OP_TFORLOOP, OP_UNM, OP_VARARG, OpArgK, OpArgN, OpArgR, OpArgU, OPCODE_NAMES, POS_A, POS_Ax, POS_B, POS_Bx, POS_C, POS_OP, SIZE_A, SIZE_Ax, SIZE_B, SIZE_Bx, SIZE_C, SIZE_OP
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Pretty-prints contents of a Prototype.static void
Print the code in a prototypestatic void
printFunction
(Prototype prototype, boolean full) Pretty-prints contents of a Prototype in short or long form.static int
printOpCode
(Prototype f, int pc) Print an opcode in a prototypestatic int
printOpCode
(PrintStream ps, Prototype f, int pc) Print an opcode in a prototypestatic void
printStack
(LuaValue[] stack, int top, Varargs varargs) static void
printState
(LuaClosure cl, int pc, LuaValue[] stack, int top, Varargs varargs) Print the state of aLuaClosure
that is being executed
-
Field Details
-
ps
-
OPNAMES
String names for each lua opcode value.
-
-
Constructor Details
-
Print
public Print()
-
-
Method Details
-
printCode
Print the code in a prototype- Parameters:
f
- thePrototype
-
printOpCode
Print an opcode in a prototype- Parameters:
f
- thePrototype
pc
- the program counter to look up and print- Returns:
- pc same as above or changed
-
printOpCode
Print an opcode in a prototype- Parameters:
ps
- thePrintStream
to print tof
- thePrototype
pc
- the program counter to look up and print- Returns:
- pc same as above or changed
-
print
Pretty-prints contents of a Prototype.- Parameters:
prototype
- Prototype to print.
-
printFunction
Pretty-prints contents of a Prototype in short or long form.- Parameters:
prototype
- Prototype to print.full
- true to print all fields, false to print short form.
-
printState
Print the state of aLuaClosure
that is being executed- Parameters:
cl
- theLuaClosure
pc
- the program counterstack
- the stack ofLuaValue
top
- the top of the stackvarargs
- anyVarargs
value that may apply
-
printStack
-