mirror of https://github.com/rusefi/lua.git
detail
This commit is contained in:
parent
fb9be62f79
commit
62f3b7c472
15
ldebug.c
15
ldebug.c
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** $Id: ldebug.c,v 2.141 2017/11/07 17:20:42 roberto Exp roberto $
|
** $Id: ldebug.c,v 2.142 2017/11/08 14:50:23 roberto Exp roberto $
|
||||||
** Debug Interface
|
** Debug Interface
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
|
@ -754,15 +754,16 @@ void luaG_traceexec (lua_State *L) {
|
||||||
luaD_hook(L, LUA_HOOKCOUNT, -1); /* call count hook */
|
luaD_hook(L, LUA_HOOKCOUNT, -1); /* call count hook */
|
||||||
if (mask & LUA_MASKLINE) {
|
if (mask & LUA_MASKLINE) {
|
||||||
Proto *p = ci_func(ci)->p;
|
Proto *p = ci_func(ci)->p;
|
||||||
int npc = pcRel(ci->u.l.savedpc, p);
|
const Instruction *npc = ci->u.l.savedpc;
|
||||||
if (npc == 0 || /* call linehook when enter a new function, */
|
int npci = pcRel(npc, p);
|
||||||
ci->u.l.savedpc <= L->oldpc || /* when jump back (loop), or when */
|
if (npci == 0 || /* call linehook when enter a new function, */
|
||||||
changedline(p, pcRel(L->oldpc, p), npc)) { /* enter new line */
|
npc <= L->oldpc || /* when jump back (loop), or when */
|
||||||
int newline = luaG_getfuncline(p, npc); /* new line */
|
changedline(p, pcRel(L->oldpc, p), npci)) { /* enter new line */
|
||||||
|
int newline = luaG_getfuncline(p, npci); /* new line */
|
||||||
luaD_hook(L, LUA_HOOKLINE, newline); /* call line hook */
|
luaD_hook(L, LUA_HOOKLINE, newline); /* call line hook */
|
||||||
}
|
}
|
||||||
|
L->oldpc = npc;
|
||||||
}
|
}
|
||||||
L->oldpc = ci->u.l.savedpc;
|
|
||||||
if (L->status == LUA_YIELD) { /* did hook yield? */
|
if (L->status == LUA_YIELD) { /* did hook yield? */
|
||||||
if (counthook)
|
if (counthook)
|
||||||
L->hookcount = 1; /* undo decrement to zero */
|
L->hookcount = 1; /* undo decrement to zero */
|
||||||
|
|
Loading…
Reference in New Issue