** 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. */
| 81 | ** the desired instruction. |
| 82 | */ |
| 83 | int 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 | |
| 98 | static int getcurrentline (CallInfo *ci) { |
no test coverage detected