Debug interface
The hooks a debugger, profiler or coverage tool attaches to.
sq_setdebughook installs a callback that the VM calls as the script runs: when a function is called, when it returns, and, if line hooks are enabled, when execution comes to a new source line. A call or a return also starts a new line, even if the line number stays the same.
This hook is enough to build a stepping debugger. sq_stackinfos gives one frame of the call stack, and a stack trace is made from these frames. Code that the compiler runs to evaluate a constant has no frame for the code that uses the constant; sq_getconstevalpos gives that position.
Line information has a cost and can be turned off.
Retrieve the calls stack informations of a ceratain level in the calls stack.
Retrieves the source position of the constant that the compiler evaluates, while the code that the evaluation runs calls it. Returns SQ_ERROR when no constant is being evaluated.
Pops a closure from the stack and sets it as the debug hook, replacing any hook already set, native or not. A null disables it.
Sets the native debug hook. When a native hook is set it overrides any previously set native or non native hooks. if the hook is NULL the debug hook will be disabled.
Tells the VM how to obtain the current OS thread id, which the thread access checks need.
Sets a callback the compiler calls per source line, for coverage tools.
Makes redefining an existing global constant an error.