Back to home page

Redis cross reference

 
 

    


0001 # Build a symbol table for static symbols of redis.c
0002 # Useful to get stack traces on segfault without a debugger. See redis.c
0003 # for more information.
0004 #
0005 # Copyright(C) 2009 Salvatore Sanfilippo, under the BSD license.
0006 
0007 set fd [open redis.c]
0008 set symlist {}
0009 while {[gets $fd line] != -1} {
0010     if {[regexp {^static +[A-z0-9]+[ *]+([A-z0-9]*)\(} $line - sym]} {
0011         lappend symlist $sym
0012     }
0013 }
0014 set symlist [lsort -unique $symlist]
0015 puts "static struct redisFunctionSym symsTable\[\] = {"
0016 foreach sym $symlist {
0017     puts "{\"$sym\",(unsigned long)$sym},"
0018 }
0019 puts "{NULL,0}"
0020 puts "};"
0021 
0022 close $fd