luaG_inithooks
function · lua · boundary
- Address
0x6fb9e0· 40 bytes, up to0x6fba07- Meaning
- Saves the pc of every call record above the base and marks the hooks initialized
- Confidence
- verified, proof two
- Finding
- lua/runtime#hooks-and-locals
Finding: Hooks and locals in lua: calls, states and the collector
lua_sethook stores the hook function, its event mask and its count, which also restarts the
running count, clearing the function and the mask when either is empty, and marks the hooks
uninitialized; luaG_inithooks then saves the pc of every call record above the base
(cmp esi,[edi+0x28], 0x6fb9e7, 0x6fb9fd) before the first line
event and marks them initialized. lua_getlocal pushes local n of a call level and returns its
name; lua_setlocal pops the top value into it unless the name begins with (, the internal
locals. info_tailcall describes a level lost to a tail call: what tail, source =(tail call),
lines -1, no upvalues, and nil at the stack top.
| function | name | decided by |
|---|---|---|
0x6fb9e0 | luaG_inithooks | call records from the current down to, not including, the base record (0x6fb9e4..0x6fb9ff), currentpc each (0x6fb9f2); the loop stops at the base without visiting it (0x6fb9e7, 0x6fb9ea, 0x6fb9ff), flag set (0x6fba01) |
0x6fba40 | lua_sethook | empty function or mask clears both (0x6fba43..0x6fba51), count twice (0x6fba56, 0x6fba59), mask (0x6fba5c), function (0x6fba5f), flag cleared (0x6fba62) |
0x6fba70 | lua_gethook | [L+0x3c] (0x6fba70) |
0x6fba80 | lua_gethookmask | byte [L+0x30] (0x6fba80) |
0x6fba90 | lua_gethookcount | [L+0x34] (0x6fba90) |
0x6fbb20 | lua_getlocal | call record of the level (0x6fbb24..0x6fbb32), getluaproto (0x6fbb3a), currentpc (0x6fbb47), luaF_getlocalname (0x6fbb54), luaA_pushobject (0x6fbb6b) |
0x6fbbb0 | lua_setlocal | call record (0x6fbbb4..0x6fbbc1), top lowered (0x6fbbce..0x6fbbd9), luaF_getlocalname (0x6fbbf2), ( refused (0x6fbbfb), the copy (0x6fbc0c..0x6fbc4c) |
0x6fbd20 | info_tailcall | empty names (0x6fbd23..0x6fbd2c), tail (0x6fbd3e), -1 lines (0x6fbd45, 0x6fbd48), luaO_chunkid (0x6fbd4e), no upvalues (0x6fbd53), nil (0x6fbd5d) |
The derivation is in the doc.
Callers 1
- traceexec lua
Callees 1
- currentpc lua
Calls and jumps by a bare address, from tables/calls.tsv.