bcfc686d |
1 | # Build a symbol table for static symbols of redis.c |
2 | # Useful to get stack traces on segfault without a debugger. See redis.c |
3 | # for more information. |
4 | # |
5 | # Copyright(C) 2009 Salvatore Sanfilippo, under the BSD license. |
6 | |
7 | set fd [open redis.c] |
8 | set symlist {} |
9 | while {[gets $fd line] != -1} { |
10 | if {[regexp {^static +[A-z0-9]+[ *]+([A-z0-9]*)\(} $line - sym]} { |
11 | lappend symlist $sym |
12 | } |
13 | } |
14 | set symlist [lsort -unique $symlist] |
15 | puts "static struct redisFunctionSym symsTable\[\] = {" |
16 | foreach sym $symlist { |
17 | puts "{\"$sym\",(unsigned long)$sym}," |
18 | } |
19 | puts "{NULL,0}" |
20 | puts "};" |
21 | |
22 | close $fd |