MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ldbLogSourceLine

Function ldbLogSourceLine

app/redis-6.2.6/src/scripting.c:2169–2185  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

2167
2168/* Log the specified line in the Lua debugger output. */
2169void 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

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