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.