code: func SetDebugHook(l *State, f Hook, mask byte, count int) {
  	if f == nil || mask == 0 {
  		f, mask = nil, 0
  	}
  	if ci := l.callInfo; ci.isLua() {
  		l.oldPC = ci.savedPC
  	}
  	l.hooker, l.baseHookCount = f, count
  	l.resetHookCount()
  	l.hookMask = mask
  	l.internalHook = false
  }
docs: // SetDebugHook sets the debugging hook function.
  //
  // f is the hook function. mask specifies on which events the hook will be
  // called: it is formed by a bitwise or of the constants MaskCall, MaskReturn,
  // MaskLine, and MaskCount. The count argument is only meaningful when the
  // mask includes MaskCount. For each event, the hook is called as explained
  // below:
  //
  // Call hook is called when the interpreter calls a function. The hook is
  // called just after Lua enters the new function, before the function gets
  // its arguments.
  //
  // Return hook is called when the interpreter returns from a function. The
  // hook is called just before Lua leaves the function. There is no standard
  // way to access the values to be returned by the function.
  //
  // Line hook is called when the interpreter is about to start the execution
  // of a new line of code, or when it jumps back in the code (even to the same
  // line). (This event only happens while Lua is executing a Lua function.)
  //
  // Count hook is called after the interpreter executes every count
  // instructions. (This event only happens while Lua is executing a Lua
  // function.)
  //
  // A hook is disabled by setting mask to zero.