** 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. */
| 87 | ** the desired instruction. |
| 88 | */ |
| 89 | int 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 | |
| 104 | static int getcurrentline (CallInfo *ci) { |
no test coverage detected