summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2015-11-13 13:11:31 +0100
committerantirez <antirez@gmail.com>2015-11-17 15:43:23 +0100
commit01636435fae33d3c43b23bd376f0d4634a7294a8 (patch)
tree5f6d1d36f343c2b6075df59fa5e49339dbfc2a97
parentd99ce09343a4abe99aa4c3b6f18a349adea42196 (diff)
downloadredis-01636435fae33d3c43b23bd376f0d4634a7294a8.tar.gz
Lua debugger: abort implemented.
-rw-r--r--src/scripting.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/scripting.c b/src/scripting.c
index 3c69111ed..8ab603a2f 100644
--- a/src/scripting.c
+++ b/src/scripting.c
@@ -2153,6 +2153,8 @@ ldbLog(sdsnew("[b]reak -<line> Remove breakpoint from the specified line.")
ldbLog(sdsnew("[b]reak 0 Remove all breakpoints."));
ldbLog(sdsnew("[e]eval <code> Execute some Lua code (in a different callframe)."));
ldbLog(sdsnew("[r]edis <cmd> Execute a Redis command."));
+ldbLog(sdsnew("[a]abort Stop the execution of the script. In sync"));
+ldbLog(sdsnew(" mode dataset changes will be retained."));
ldbLog(sdsnew(""));
ldbLog(sdsnew("Debugger functions you can call from Lua scripts:"));
ldbLog(sdsnew("redis.debug() Produce logs in the debugger console."));
@@ -2171,6 +2173,9 @@ ldbLog(sdsnew(" in the next line of code."));
} else if (!strcasecmp(argv[0],"e") || !strcasecmp(argv[0],"eval")) {
ldbEval(lua,argv,argc);
ldbSendLogs();
+ } else if (!strcasecmp(argv[0],"a") || !strcasecmp(argv[0],"abort")) {
+ lua_pushstring(lua, "script aborted for user request");
+ lua_error(lua);
} else if (argc > 1 &&
(!strcasecmp(argv[0],"r") || !strcasecmp(argv[0],"redis"))) {
ldbRedis(lua,argv,argc);