DEBUG OBJECT implemented

This commit is contained in:
antirez 2009-06-04 17:13:33 +02:00
parent b5ff27084f
commit 333298dac3
3 changed files with 30 additions and 1 deletions

View File

@ -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

View 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}
};

16
redis.c
View File

@ -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"));
}
}