mirror of https://github.com/rusefi/lua.git
'getline' renamed to 'getfuncline' (to avoid problems with POSIX)
This commit is contained in:
parent
2598138ece
commit
2258ec6bc9
4
ldebug.c
4
ldebug.c
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** $Id: ldebug.c,v 2.50 2009/05/04 18:26:21 roberto Exp roberto $
|
** $Id: ldebug.c,v 2.51 2009/06/01 19:09:26 roberto Exp roberto $
|
||||||
** Debug Interface
|
** Debug Interface
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
|
@ -44,7 +44,7 @@ static int currentline (CallInfo *ci) {
|
||||||
if (pc < 0)
|
if (pc < 0)
|
||||||
return -1; /* only active lua functions have current-line information */
|
return -1; /* only active lua functions have current-line information */
|
||||||
else
|
else
|
||||||
return getline(ci_func(ci)->l.p, pc);
|
return getfuncline(ci_func(ci)->l.p, pc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
4
ldebug.h
4
ldebug.h
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** $Id: ldebug.h,v 2.3 2005/04/25 19:24:10 roberto Exp roberto $
|
** $Id: ldebug.h,v 2.4 2009/04/30 17:42:21 roberto Exp roberto $
|
||||||
** Auxiliary functions from Debug Interface module
|
** Auxiliary functions from Debug Interface module
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
#define pcRel(pc, p) (cast(int, (pc) - (p)->code) - 1)
|
#define pcRel(pc, p) (cast(int, (pc) - (p)->code) - 1)
|
||||||
|
|
||||||
#define getline(f,pc) (((f)->lineinfo) ? (f)->lineinfo[pc] : 0)
|
#define getfuncline(f,pc) (((f)->lineinfo) ? (f)->lineinfo[pc] : 0)
|
||||||
|
|
||||||
#define resethookcount(L) (L->hookcount = L->basehookcount)
|
#define resethookcount(L) (L->hookcount = L->basehookcount)
|
||||||
|
|
||||||
|
|
4
ltests.c
4
ltests.c
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** $Id: ltests.c,v 2.62 2009/04/17 22:00:01 roberto Exp roberto $
|
** $Id: ltests.c,v 2.63 2009/06/01 19:09:26 roberto Exp roberto $
|
||||||
** Internal Module for Debugging of the Lua Implementation
|
** Internal Module for Debugging of the Lua Implementation
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
|
@ -402,7 +402,7 @@ static char *buildop (Proto *p, int pc, char *buff) {
|
||||||
Instruction i = p->code[pc];
|
Instruction i = p->code[pc];
|
||||||
OpCode o = GET_OPCODE(i);
|
OpCode o = GET_OPCODE(i);
|
||||||
const char *name = luaP_opnames[o];
|
const char *name = luaP_opnames[o];
|
||||||
int line = getline(p, pc);
|
int line = getfuncline(p, pc);
|
||||||
sprintf(buff, "(%4d) %4d - ", line, pc);
|
sprintf(buff, "(%4d) %4d - ", line, pc);
|
||||||
switch (getOpMode(o)) {
|
switch (getOpMode(o)) {
|
||||||
case iABC:
|
case iABC:
|
||||||
|
|
6
lvm.c
6
lvm.c
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** $Id: lvm.c,v 2.89 2009/05/27 17:11:27 roberto Exp roberto $
|
** $Id: lvm.c,v 2.90 2009/06/01 19:09:26 roberto Exp roberto $
|
||||||
** Lua virtual machine
|
** Lua virtual machine
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
|
@ -67,10 +67,10 @@ static void traceexec (lua_State *L) {
|
||||||
if (mask & LUA_MASKLINE) {
|
if (mask & LUA_MASKLINE) {
|
||||||
Proto *p = ci_func(ci)->l.p;
|
Proto *p = ci_func(ci)->l.p;
|
||||||
int npc = pcRel(ci->u.l.savedpc, p);
|
int npc = pcRel(ci->u.l.savedpc, p);
|
||||||
int newline = getline(p, npc);
|
int newline = getfuncline(p, npc);
|
||||||
if (npc == 0 || /* call linehook when enter a new function, */
|
if (npc == 0 || /* call linehook when enter a new function, */
|
||||||
ci->u.l.savedpc <= L->oldpc || /* when jump back (loop), or when */
|
ci->u.l.savedpc <= L->oldpc || /* when jump back (loop), or when */
|
||||||
newline != getline(p, pcRel(L->oldpc, p))) /* enter a new line */
|
newline != getfuncline(p, pcRel(L->oldpc, p))) /* enter a new line */
|
||||||
luaD_callhook(L, LUA_HOOKLINE, newline);
|
luaD_callhook(L, LUA_HOOKLINE, newline);
|
||||||
}
|
}
|
||||||
L->oldpc = ci->u.l.savedpc;
|
L->oldpc = ci->u.l.savedpc;
|
||||||
|
|
Loading…
Reference in New Issue