debugx

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package debugx implements the `debug` native module. It covers the Lua 5.4 debug surface we can reasonably support given the VM's current frame representation:

  • debug.traceback([msg], [level]) -> string
  • debug.getinfo(level|function) -> table {source, currentline, name, what, nparams, isvararg}
  • debug.sethook(...) -> stub no-op (signature compat only)
  • debug.gethook() -> nil, nil, 0 (matches Lua's "no hook" reply)

Local/upvalue introspection (getlocal/setlocal/getupvalue/setupvalue) would need the bytecode generator to emit a stable local-name table per proto, which it doesn't yet. Leaving those out for now keeps the module honest — every function it exposes does what its Lua-5.4 counterpart does, rather than silently returning nil.

Package name `debugx` avoids colliding with Go's stdlib `runtime/debug`. The Lua-side module name is "debug".

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterDebugPreload

func RegisterDebugPreload(v *vm.VM)

RegisterDebugPreload installs the `debug` module under package.preload.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL