Difference between revisions of "Debug"

From GiderosMobile
(Created page with "__NOTOC__ '''Supported platforms:''' <br/> '''Available since:''' Gideros 2011.6<br/> === Description === The debug library does not give you a debugger for Lua, but it offers...")
 
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
'''Supported platforms:''' <br/>
+
'''Supported platforms:''' android, ios, mac, pc<br/>
 
'''Available since:''' Gideros 2011.6<br/>
 
'''Available since:''' Gideros 2011.6<br/>
 
=== Description ===
 
=== Description ===
The debug library does not give you a debugger for Lua, but it offers all the primitives that you need for writing a debugger for Lua. For performance reasons, the official interface to these primitives is through the C API. The debug library in Lua is a way to access these functions directly within Lua code. This library declares all its functions inside the debug table.{|-
+
The debug library does not give you a debugger for Lua, but it offers all the primitives that you need for writing a debugger for Lua. For performance reasons, the official interface to these primitives is through the C API. The debug library in Lua is a way to access these functions directly within Lua code. This library declares all its functions inside the debug table.
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
{|-
 
| style="width: 50%;"|
 
| style="width: 50%;"|
 
=== Methods ===
 
=== Methods ===
 +
[[debug.debug]] - enters interactive debug mode, line with only "cont" terminates<br/>
 +
[[debug.gethook]] - returns current hook function, hook mask, hook count<br/>
 +
[[debug.getinfo]] - returns table with information about a function<br/>
 +
[[debug.getlocal]] - returns name and value of local variable with index local at stack level<br/>
 +
[[debug.getupvalue]] - returns name and value of upvalue with index up of function func<br/>
 +
[[debug.sethook]] - sets given function as a hook, mask="[crl]"<br/>
 +
[[debug.setlocal]] - sets local variable with index local at stack level with value<br/>
 +
[[debug.settypemt]] - Set meta table type<br/>
 +
[[debug.setupvalue]] - sets upvalue with index up of function func with value<br/>
 +
[[debug.traceback]] - returns a string with a traceback of the call stack<br/>
 
| style="width: 50%;"|
 
| style="width: 50%;"|
 
=== Events ===
 
=== Events ===
 
=== Constants ===
 
=== Constants ===
 
|}
 
|}

Revision as of 09:57, 23 August 2018

Supported platforms: android, ios, mac, pc
Available since: Gideros 2011.6

Description

The debug library does not give you a debugger for Lua, but it offers all the primitives that you need for writing a debugger for Lua. For performance reasons, the official interface to these primitives is through the C API. The debug library in Lua is a way to access these functions directly within Lua code. This library declares all its functions inside the debug table.








Methods

debug.debug - enters interactive debug mode, line with only "cont" terminates
debug.gethook - returns current hook function, hook mask, hook count
debug.getinfo - returns table with information about a function
debug.getlocal - returns name and value of local variable with index local at stack level
debug.getupvalue - returns name and value of upvalue with index up of function func
debug.sethook - sets given function as a hook, mask="[crl]"
debug.setlocal - sets local variable with index local at stack level with value
debug.settypemt - Set meta table type
debug.setupvalue - sets upvalue with index up of function func with value
debug.traceback - returns a string with a traceback of the call stack

Events

Constants