Lines Matching refs:ldb

77 } ldb;  variable
213 if (ldb.active && ldb.step) { in luaPushError()
440 if (ldb.active && ldb.step) { in luaRedisGenericCommand()
579 if (ldb.active && ldb.step) in luaRedisGenericCommand()
718 if (ldb.active) { in luaRedisBreakpointCommand()
719 ldb.luabp = 1; in luaRedisBreakpointCommand()
733 if (!ldb.active) return 0; in luaRedisDebugCommand()
735 sds log = sdscatprintf(sdsempty(),"<debug> line %d: ", ldb.currentline); in luaRedisDebugCommand()
1307 ldb.active == 0) in evalGenericCommand()
1311 } else if (ldb.active) { in evalGenericCommand()
1496 ldb.fd = -1; in ldbInit()
1497 ldb.active = 0; in ldbInit()
1498 ldb.logs = listCreate(); in ldbInit()
1499 listSetFreeMethod(ldb.logs,(void (*)(void*))sdsfree); in ldbInit()
1500 ldb.children = listCreate(); in ldbInit()
1501 ldb.src = NULL; in ldbInit()
1502 ldb.lines = 0; in ldbInit()
1503 ldb.cbuf = sdsempty(); in ldbInit()
1517 ldbFlushLog(ldb.logs); in ldbEnable()
1518 ldb.fd = c->fd; in ldbEnable()
1519 ldb.step = 1; in ldbEnable()
1520 ldb.bpcount = 0; in ldbEnable()
1521 ldb.luabp = 0; in ldbEnable()
1522 sdsfree(ldb.cbuf); in ldbEnable()
1523 ldb.cbuf = sdsempty(); in ldbEnable()
1524 ldb.maxlen = LDB_MAX_LEN_DEFAULT; in ldbEnable()
1525 ldb.maxlen_hint_sent = 0; in ldbEnable()
1537 listAddNodeTail(ldb.logs,entry); in ldbLog()
1546 if (ldb.maxlen && sdslen(entry) > ldb.maxlen) { in ldbLogWithMaxLen()
1547 sdsrange(entry,0,ldb.maxlen-1); in ldbLogWithMaxLen()
1552 if (trimmed && ldb.maxlen_hint_sent == 0) { in ldbLogWithMaxLen()
1553 ldb.maxlen_hint_sent = 1; in ldbLogWithMaxLen()
1564 proto = sdscatfmt(proto,"*%i\r\n", (int)listLength(ldb.logs)); in ldbSendLogs()
1565 while(listLength(ldb.logs)) { in ldbSendLogs()
1566 listNode *ln = listFirst(ldb.logs); in ldbSendLogs()
1571 listDelNode(ldb.logs,ln); in ldbSendLogs()
1573 if (write(ldb.fd,proto,sdslen(proto)) == -1) { in ldbSendLogs()
1594 ldb.forked = (c->flags & CLIENT_LUA_DEBUG_SYNC) == 0; in ldbStartSession()
1595 if (ldb.forked) { in ldbStartSession()
1616 listAddNodeTail(ldb.children,(void*)(unsigned long)cp); in ldbStartSession()
1626 anetBlock(NULL,ldb.fd); in ldbStartSession()
1627 anetSendTimeout(NULL,ldb.fd,5000); in ldbStartSession()
1628 ldb.active = 1; in ldbStartSession()
1640 ldb.src = sdssplitlen(srcstring,sdslen(srcstring),"\n",1,&ldb.lines); in ldbStartSession()
1653 if (ldb.forked) { in ldbEndSession()
1663 anetNonBlock(NULL,ldb.fd); in ldbEndSession()
1664 anetSendTimeout(NULL,ldb.fd,0); in ldbEndSession()
1671 sdsfreesplitres(ldb.src,ldb.lines); in ldbEndSession()
1672 ldb.lines = 0; in ldbEndSession()
1673 ldb.active = 0; in ldbEndSession()
1680 listNode *ln = listSearchKey(ldb.children,(void*)(unsigned long)pid); in ldbRemoveChild()
1682 listDelNode(ldb.children,ln); in ldbRemoveChild()
1691 return listLength(ldb.children); in ldbPendingChildren()
1699 listRewind(ldb.children,&li); in ldbKillForkedSessions()
1705 listRelease(ldb.children); in ldbKillForkedSessions()
1706 ldb.children = listCreate(); in ldbKillForkedSessions()
1724 if (idx < 0 || idx >= ldb.lines) return "<out of range source code line>"; in ldbGetSourceLine()
1725 return ldb.src[idx]; in ldbGetSourceLine()
1732 for (j = 0; j < ldb.bpcount; j++) in ldbIsBreakpoint()
1733 if (ldb.bp[j] == line) return 1; in ldbIsBreakpoint()
1741 if (line <= 0 || line > ldb.lines) return 0; in ldbAddBreakpoint()
1742 if (!ldbIsBreakpoint(line) && ldb.bpcount != LDB_BREAKPOINTS_MAX) { in ldbAddBreakpoint()
1743 ldb.bp[ldb.bpcount++] = line; in ldbAddBreakpoint()
1754 for (j = 0; j < ldb.bpcount; j++) { in ldbDelBreakpoint()
1755 if (ldb.bp[j] == line) { in ldbDelBreakpoint()
1756 ldb.bpcount--; in ldbDelBreakpoint()
1757 memmove(ldb.bp+j,ldb.bp+j+1,ldb.bpcount-j); in ldbDelBreakpoint()
1770 if (sdslen(ldb.cbuf) == 0) return NULL; in ldbReplParseCommand()
1774 sds copy = sdsdup(ldb.cbuf); in ldbReplParseCommand()
1818 int current = ldb.currentline == lnum; in ldbLogSourceLine()
1840 for (j = 1; j <= ldb.lines; j++) { in ldbList()
2095 if (ldb.bpcount == 0) { in ldbBreak()
2099 ldbLog(sdscatfmt(sdsempty(),"%i breakpoints set:",ldb.bpcount)); in ldbBreak()
2101 for (j = 0; j < ldb.bpcount; j++) in ldbBreak()
2102 ldbLogSourceLine(ldb.bp[j]); in ldbBreak()
2113 ldb.bpcount = 0; in ldbBreak()
2116 if (ldb.bpcount == LDB_BREAKPOINTS_MAX) { in ldbBreak()
2178 ldb.step = 1; /* Force redis.call() to log. */ in ldbRedis()
2181 ldb.step = 0; /* Disable logging. */ in ldbRedis()
2212 ldb.maxlen_hint_sent = 1; /* User knows about this command. */ in ldbMaxlen()
2214 ldb.maxlen = newval; in ldbMaxlen()
2216 if (ldb.maxlen) { in ldbMaxlen()
2217 … ldbLog(sdscatprintf(sdsempty(),"<value> replies are truncated at %d bytes.",(int)ldb.maxlen)); in ldbMaxlen()
2235 int nread = read(ldb.fd,buf,sizeof(buf)); in ldbRepl()
2239 ldb.step = 0; in ldbRepl()
2240 ldb.bpcount = 0; in ldbRepl()
2243 ldb.cbuf = sdscatlen(ldb.cbuf,buf,nread); in ldbRepl()
2247 sdsfree(ldb.cbuf); in ldbRepl()
2248 ldb.cbuf = sdsempty(); in ldbRepl()
2285 ldb.step = 1; in ldbRepl()
2315 int around = ldb.currentline, ctx = 5; in ldbRepl()
2346 ldb.currentline = ar->currentline; in luaLdbLineHook()
2348 int bp = ldbIsBreakpoint(ldb.currentline) || ldb.luabp; in luaLdbLineHook()
2355 if (ar->event == LUA_HOOKCOUNT && ldb.step == 0 && bp == 0) { in luaLdbLineHook()
2361 ldb.step = 1; in luaLdbLineHook()
2367 if (ldb.step || bp) { in luaLdbLineHook()
2369 if (bp) reason = ldb.luabp ? "redis.breakpoint() called" : in luaLdbLineHook()
2372 ldb.step = 0; in luaLdbLineHook()
2373 ldb.luabp = 0; in luaLdbLineHook()
2376 ldb.currentline, reason)); in luaLdbLineHook()
2377 ldbLogSourceLine(ldb.currentline); in luaLdbLineHook()