]> git.saurik.com Git - redis.git/commitdiff
DEBUG OBJECT implemented
authorantirez <antirez@gmail.com>
Thu, 4 Jun 2009 15:13:33 +0000 (17:13 +0200)
committerantirez <antirez@gmail.com>
Thu, 4 Jun 2009 15:13:33 +0000 (17:13 +0200)
Changelog
redis-cli.c
redis.c

index 124053eb50b4e1f2dfb90bc167b6c911f497cf13..a70cce365f150330e74323f0e0c6e19d9723e7e1 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -1,3 +1,17 @@
+2009-06-04 backtrace support removed: unreliable stack trace :(
+2009-06-04 initial backtrace dumping on sigsegv/sigbus + debug command
+2009-06-03 Python lib updated
+2009-06-03 shareobjectspoolsize implemented in reds.conf, in order to control the pool size when object sharing is on
+2009-05-30 Erlang client updated
+2009-05-30 Python client library updated
+2009-05-29 Redis-rb minor bool convertion fix
+2009-05-29 ruby library client is not Redis-rb merged with RubyRedis "engine" by Brian McKinney
+2009-05-28 __P completely removed from pqsort.c/h
+2009-05-28 another minor fix for Solaris boxes
+2009-05-28 minor fix for Solaris boxes
+2009-05-28 minor fix for Solaris boxes
+2009-05-27 maxmemory implemented
+2009-05-26 Redis git version modified to 0.101 in order to distinguish that from the latest tar.gz via INFO ;)
 2009-05-26 Redis 0.100 released
 2009-05-26 client libraries synched in git
 2009-05-26 ignore gcc warning about write() return code not checked. It is esplicitily this way since the "max number of clients reached" is a best-effort error
index 9dc0ae5a0cdd1ae4b9c85d8b87be983abb0967a0..343ee0a144a7e07d65c75013f71ed52f055e7f9b 100644 (file)
@@ -111,6 +111,7 @@ static struct redisCommand cmdTable[] = {
     {"expire",3,REDIS_CMD_INLINE},
     {"ttl",2,REDIS_CMD_INLINE},
     {"slaveof",3,REDIS_CMD_INLINE},
+    {"debug",-2,REDIS_CMD_INLINE},
     {NULL,0,0}
 };
 
diff --git a/redis.c b/redis.c
index a8b5e2f2cffaffb78ca05ed9d54801ba3cf74295..39d45a2ddc7f1467f1d6574be80e2b16dba5f2e1 100644 (file)
--- a/redis.c
+++ b/redis.c
@@ -4056,8 +4056,22 @@ static void freeMemoryIfNeeded(void) {
 static void debugCommand(redisClient *c) {
     if (!strcasecmp(c->argv[1]->ptr,"segfault")) {
         *((char*)-1) = 'x';
+    } else if (!strcasecmp(c->argv[1]->ptr,"object") && c->argc == 3) {
+        dictEntry *de = dictFind(c->db->dict,c->argv[2]);
+        robj *key, *val;
+
+        if (!de) {
+            addReply(c,shared.nokeyerr);
+            return;
+        }
+        key = dictGetEntryKey(de);
+        val = dictGetEntryVal(de);
+        addReplySds(c,sdscatprintf(sdsempty(),
+            "+Key at:%p refcount:%d, value at:%p refcount:%d\r\n",
+                key, key->refcount, val, val->refcount));
     } else {
-        addReplySds(c,sdsnew("-ERR Syntax error, try DEBUG SEGFAULT\r\n"));
+        addReplySds(c,sdsnew(
+            "-ERR Syntax error, try DEBUG [SEGFAULT|OBJECT <key>]\r\n"));
     }
 }