Garry's Mod Wiki

Revision Difference

Structures/DebugInfo#518583

<cat>struct</cat> <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 </description> <fields> <item name="func" type="function">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**</item> <item name="linedefined" type="number">The line where the function definiton starts (where "function" is located). **Option: S**</item> <item name="lastlinedefined" type="number">The line the function definition ended (where "end" is located). **Option: S**</item> <item name="source" type="string">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**</item> <item name="short_src" type="string">The shortened name of the source (without the @). May be truncated if the source path is long. **Option: S**</item> <item name="what" type="string">The language used. Either "Lua" or "C". **Option: S**</item> <item name="currentline" type="number">The current line. This will be -1 if the code is not executed from a file. **Option: l** (lowercase L)</item> <item name="name" type="string">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**</item> <item name="namewhat" type="string">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**</item> <item name="isvararg" type="boolean">Whether the function is variadic (has a &amp;lt;kbd&amp;gt;...&amp;lt;/kbd&amp;gt; argument). <item name="isvararg" type="boolean">Whether the function is variadic (has a &lt;kbd&gt;...&lt;/kbd&gt; argument). **Option: u**</item> <item name="nparams" type="number">The number of arguments the function uses excluding varargs. **Option: u**</item> <item name="nups" type="number">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**</item> <item name="activelines" type="table">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**</item> </fields> </structure>