MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / ldbLogSourceLine

Function ldbLogSourceLine

src/scripting.cpp:2192–2208  ·  view source on GitHub ↗

Log the specified line in the Lua debugger output. */

Source from the content-addressed store, hash-verified

2190
2191/* Log the specified line in the Lua debugger output. */
2192void 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

Callers 4

ldbListFunction · 0.85
ldbBreakFunction · 0.85
ldbTraceFunction · 0.85
luaLdbLineHookFunction · 0.85

Calls 5

ldbGetSourceLineFunction · 0.85
ldbIsBreakpointFunction · 0.85
sdscatprintfFunction · 0.85
sdsemptyFunction · 0.85
ldbLogFunction · 0.85

Tested by

no test coverage detected