MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / luaG_getfuncline

Function luaG_getfuncline

extlibs/lua/src/ldebug.c:89–101  ·  view source on GitHub ↗

** Get the line corresponding to instruction 'pc' in function 'f'; ** first gets a base line and from there does the increments until ** the desired instruction. */

Source from the content-addressed store, hash-verified

87** the desired instruction.
88*/
89int luaG_getfuncline (const Proto *f, int pc) {
90 if (f->lineinfo == NULL) /* no debug information? */
91 return -1;
92 else {
93 int basepc;
94 int baseline = getbaseline(f, pc, &basepc);
95 while (basepc++ < pc) { /* walk until given instruction */
96 lua_assert(f->lineinfo[basepc] != ABSLINEINFO);
97 baseline += f->lineinfo[basepc]; /* correct line */
98 }
99 return baseline;
100 }
101}
102
103
104static int getcurrentline (CallInfo *ci) {

Callers 5

PrintCodeFunction · 0.85
getcurrentlineFunction · 0.85
nextlineFunction · 0.85
changedlineFunction · 0.85
luaG_traceexecFunction · 0.85

Calls 1

getbaselineFunction · 0.85

Tested by

no test coverage detected