Log the specified line in the Lua debugger output. */
| 2167 | |
| 2168 | /* Log the specified line in the Lua debugger output. */ |
| 2169 | void ldbLogSourceLine(int lnum) { |
| 2170 | char *line = ldbGetSourceLine(lnum); |
| 2171 | char *prefix; |
| 2172 | int bp = ldbIsBreakpoint(lnum); |
| 2173 | int current = ldb.currentline == lnum; |
| 2174 | |
| 2175 | if (current && bp) |
| 2176 | prefix = "->#"; |
| 2177 | else if (current) |
| 2178 | prefix = "-> "; |
| 2179 | else if (bp) |
| 2180 | prefix = " #"; |
| 2181 | else |
| 2182 | prefix = " "; |
| 2183 | sds thisline = sdscatprintf(sdsempty(),"%s%-3d %s", prefix, lnum, line); |
| 2184 | ldbLog(thisline); |
| 2185 | } |
| 2186 | |
| 2187 | /* Implement the "list" command of the Lua debugger. If around is 0 |
| 2188 | * the whole file is listed, otherwise only a small portion of the file |
no test coverage detected