debug.getinfo
Example
Let's find out information about net.Receive, such as which file it's defined in, the line it starts and the line it ends, and if it's defined in Lua, or C plus additional information.
Output: currentline = -1
func = function: 0x2430a158
isvararg = false
lastlinedefined = 13
linedefined = 9
namewhat =
nparams = 2
nups = 0
short_src = lua/includes/extensions/net.lua
source = @lua/includes/extensions/net.lua
what = Lua