Returns a table describing a function or a running stack frame.
debug.getinfo accepts either a function or a number. Hand it a function and the returned table describes that function. Hand it a number and it is read as a stack level - 0 is the call you are in right now, 1 is the caller above it, and so on - and the returned table describes whichever frame is running at that level.
Most commonly used while reversing a game script: you find an unknown closure with getgc and call debug.getinfo on it to learn what it is, where it came from, and how many arguments it takes before you decide what to do with it.
Parameters
Returns
table - a single table with the same fields for both forms:
Aliases
Example
While reversing a script in a Roblox game, sweep getgc for an unknown 2-arg Luau closure and identify it before you decide to hook or read it.
Standard fields match Lua’s debug library specifications.