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.traceback()

debug.traceback ([thread,] [message [, level]]) If message is present but is neither a string nor nil, this function returns message without further

2017-02-21 04:10:48
debug.upvaluejoin()

debug.upvaluejoin (f1, n1, f2, n2) Make the n1-th upvalue of the Lua closure f1 refer to the n2-th upvalue of the Lua closure f2

2017-02-21 04:10:49
debug.setupvalue()

debug.setupvalue (f, up, value) This function assigns the value value to the upvalue with index up of the function f. The function returns

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

debug.getmetatable (value) Returns the metatable of the given value or nil if it does not have a metatable.

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

debug.getuservalue (u) Returns the Lua value associated to u. If u is not a full userdata, returns nil.

2017-02-21 04:10:43
debug.getregistry()

debug.getregistry () Returns the registry table (see §4.5).

2017-02-21 04:10:42
debug.gethook()

debug.gethook ([thread]) Returns the current hook settings of the thread, as three values: the current hook function, the current hook mask, and the current hook count (as set

2017-02-21 04:10:39
debug.setuservalue()

debug.setuservalue (udata, value) Sets the given value as the Lua value associated to the given udata. udata must be a full userdata.

2017-02-21 04:10:47
debug.upvalueid()

debug.upvalueid (f, n) Returns a unique identifier (as a light userdata) for the upvalue numbered n from the given function. These unique identifiers allow

2017-02-21 04:10:48
debug.getupvalue()

debug.getupvalue (f, up) This function returns the name and the value of the upvalue with index up of the function f. The function returns nil

2017-02-21 04:10:43