DebugInfo

getinfo and getcallstack entries expose source, short_src, what, linedefined, currentline, nups, is_vararg, numparams, name, and func. what identifies Lua/C; is_vararg is a numeric VM field in this implementation. Missing or optimized metadata can be empty or less informative.

Levels, slots, and prototype values

Most function-or-level selectors require a positive level. validlevel checks a native count starting at zero. getstack/setstack use their own visible-frame resolver, skip selected executor frames, and use zero-based frame levels with 1-based register indexes. These numbering systems are not interchangeable. Prefer an explicit function for constants/upvalues/prototypes. Use pairs when enumerating returned slot tables: nil constants and upvalues may leave holes. Changing a prototype constant can affect other closures sharing that prototype. getproto(fn, index, true) searches for existing matching closures. getprotos(fn, true) constructs new closures instead. getprotos(fn) returns lightuserdata, whereas getproto(fn, index) returns a cloned closure. Neither newly constructed form guarantees valid captured upvalues for execution. The native registration copies the main Roblox debug table into Byte’s table after installing custom entries. A copied key with the same name can overwrite a custom entry. The reference describes custom implementations and global aliases; runtime debug table contents should be feature-probed. Standard debug.info/profilebegin/profileend depend on the host table and are documented by Roblox, rather than promised as Byte exports.