6.10 – The Debug Library

This library provides the functionality of the debug interface (§4.9) to Lua programs. You should exert care when using this library. Several of its functions violate basic assumptions about Lua code (e.g., that variables local to a function cannot be accessed from outside; that userdata metatables cannot be changed by Lua code; that Lua programs do not crash) and therefore can compromise otherwise secure code. Moreover, some functions in this library may be slow.

All functions in this library are provided inside the debug table. All functions that operate over a thread have an optional first argument which is the thread to operate over. The default is always the current thread.

debug.setlocal()

debug.setlocal ([thread,] level, local, value) This function assigns the value value to the local variable with index local of the function at level

2017-02-21 04:10:45
debug.getinfo()

debug.getinfo ([thread,] f [, what]) Returns a table with information about a function. You can give the function directly or you can give a number as the value of f

2017-02-21 04:10:40
debug.setmetatable()

debug.setmetatable (value, table) Sets the metatable for the given value to the given table (which can be nil). Returns value.

2017-02-21 04:10:46
debug.sethook()

debug.sethook ([thread,] hook, mask [, count]) Sets the given function as a hook. The string mask and the number count describe when the hook will be

2017-02-21 04:10:44
debug.getlocal()

debug.getlocal ([thread,] f, local) This function returns the name and the value of the local variable with index local of the function at level f of

2017-02-21 04:10:41
debug.debug()

debug.debug () Enters an interactive mode with the user, running each string that the user enters. Using simple commands and other debug facilities, the user can inspect global

2017-02-21 04:10:38