MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / luaG_getfuncline

Function luaG_getfuncline

lib/lua/src/ldebug.c:83–95  ·  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

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

Callers 6

luaV_executeFunction · 0.85
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