MCPcopy Index your code
hub / github.com/Shopify/go-lua / SetDebugHook

Function SetDebugHook

debug.go:163–174  ·  view source on GitHub ↗

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 eac

(l *State, f Hook, mask byte, count int)

Source from the content-addressed store, hash-verified

161//
162// A hook is disabled by setting mask to zero.
163func SetDebugHook(l *State, f Hook, mask byte, count int) {
164 if f == nil || mask == 0 {
165 f, mask = nil, 0
166 }
167 if ci := l.callInfo; ci.isLua() {
168 l.oldPC = ci.savedPC
169 }
170 l.hooker, l.baseHookCount = f, count
171 l.resetHookCount()
172 l.hookMask = mask
173 l.internalHook = false
174}
175
176// DebugHook returns the current hook function.
177func DebugHook(l *State) Hook { return l.hooker }

Callers 3

debug.goFile · 0.85
testStringHelperFunction · 0.85
TestProtectedCallFunction · 0.85

Calls 2

isLuaMethod · 0.80
resetHookCountMethod · 0.80

Tested by 2

testStringHelperFunction · 0.68
TestProtectedCallFunction · 0.68