Garry's Mod Wiki

Revision Difference

Structures/DebugInfo#516866

<cat>struct</cat> {{Structure⤶ |Description=Table returned by <page>debug.getinfo</page>.⤶ <structure>⤶ <description>⤶ Table returned by <page>debug.getinfo</page>.⤶ <note>If a filter is applied to <page>debug.getinfo</page>, some members may not exist!</note> For functions defined in C/C++, the following members will always have the given values: * what = "C" * source = "[C]" * nparams = 0 * isvararg = true * namewhat = "" * short_src = "[C]" * linedefined = -1 * currentline = -1 * lastlinedefined = -1 |Fields={{StructureField|function|func|Reference to the function that was passed in. If a stack level was specified, this will be the function at that stack level. 0 = debug.getinfo, 1 = function that called debug.getinfo, etc.⤶ </description>⤶ <fields>⤶ {{StructureField|function|func|Reference to the function that was passed in. If a stack level was specified, this will be the function at that stack level. 0 = debug.getinfo, 1 = function that called debug.getinfo, etc.⤶ **Option: f** }}{{StructureField|number|linedefined|The line where the function definiton starts (where "function" is located).⤶ </fields>⤶ ⤶ </structure>⤶ ⤶ {{StructureField|number|linedefined|The line where the function definiton starts (where "function" is located).⤶ **Option: S** }}{{StructureField|number|lastlinedefined|The line the function definition ended (where "end" is located). **Option: S** }}{{StructureField|string|source|The path to the file where the passed function is defined prepended by an @ (ex. "@lua/autorun/mytestfile.lua"). This will be the <page>Global.CompileString</page> or <page>Global.RunString</page> identifier if the function wasn't defined in a file, also prepended by an @. **Option: S** }}{{StructureField|string|short_src|The shortened name of the source (without the @). May be truncated if the source path is long. **Option: S** }}{{StructureField|string|what|The language used. Either "Lua" or "C". **Option: S** }}{{StructureField|number|currentline|The current line. This will be -1 if the code is not executed from a file. **Option: l** (lowercase L) }}{{StructureField|string|name|The function name. This will be nil if the name cannot be found. Only works if stack level is passed rather than function pointer. **Option: n** }}{{StructureField|string|namewhat|The function "type". This will be "global", "local", "method", "field". Can also be an empty string if the function name could not be found. Only works if stack level is passed rather than function pointer. **Option: n** }}{{StructureField|boolean|isvararg|Whether the function is variadic (has a &lt;kbd&gt;...&lt;/kbd&gt; argument). **Option: u** }}{{StructureField|number|nparams|The number of arguments the function uses excluding varargs. **Option: u** }}{{StructureField|number|nups|Upvalue count. Max index that can be used with <page>debug.getupvalue</page>. C functions can have upvalues but they cannot be accessed from Lua. **Option: u** }}{{StructureField|table|activelines|A table of all the active lines in the function - that is, lines with code that actually does something (not blank lines or lines with comments only). The table keys will be line numbers, and their values will all be true. Lines that are inactive are simply not included in the table - they have the value nil. It doesn't check for activeline in subfunctions. **Option: L** }} }}