Log the specified line in the Lua debugger output. */
| 2190 | |
| 2191 | /* Log the specified line in the Lua debugger output. */ |
| 2192 | void ldbLogSourceLine(int lnum) { |
| 2193 | const char *line = ldbGetSourceLine(lnum); |
| 2194 | const char *prefix; |
| 2195 | int bp = ldbIsBreakpoint(lnum); |
| 2196 | int current = ldb.currentline == lnum; |
| 2197 | |
| 2198 | if (current && bp) |
| 2199 | prefix = "->#"; |
| 2200 | else if (current) |
| 2201 | prefix = "-> "; |
| 2202 | else if (bp) |
| 2203 | prefix = " #"; |
| 2204 | else |
| 2205 | prefix = " "; |
| 2206 | sds thisline = sdscatprintf(sdsempty(),"%s%-3d %s", prefix, lnum, line); |
| 2207 | ldbLog(thisline); |
| 2208 | } |
| 2209 | |
| 2210 | /* Implement the "list" command of the Lua debugger. If around is 0 |
| 2211 | * the whole file is listed, otherwise only a small portion of the file |
no test coverage detected