Source
Prints the content of a hashtable displaying the key as a string and a specific member of the value struct. Args: hashtable value_type member
handle SIGPIPE pass noprint nostop
handle SIGTTIN pass noprint nostop
# FreeSWITCH Custom GDB commands
define list_sessions
dont-repeat
printf "Listing sessions: \n"
set $i = 0
set $idx = 0
set $len = session_manager.session_table->tablelength
while($idx < $len)
set $x = session_manager.session_table->table[$idx]
while($x != 0x0)
printf "uuid %s is at %p\n", $x->k, $x->v
set $i = $i + 1
set $x = $x->next
end
set $idx = $idx + 1
end
printf "Found %d sessions.\n", $i
end
document list_sessions
Print a list of session uuid and pointers
end
define hash_it_str
dont-repeat
set $i = 0
set $idx = 0
set $len = $arg0->tablelength
printf "len: %d\n", $arg0->tablelength
while($idx < $len)
set $x = $arg0->table[$idx]
while($x != 0x0)
printf "key: %s valueptr: %p\n", $x->k, $x->v
set $x = $x->next
set $i = $i + 1
end
set $idx = $idx + 1
end
end
document hash_it_str
Usage: hash_it_str [hashtable]
Prints the content of a hashtable displaying the key as a string and the value as pointer
end
define hash_it_str_x
dont-repeat
set $i = 0
set $idx = 0
set $len = $arg0->tablelength
while($idx < $len)
set $x=$arg0->table->[$idx]
while($x != 0x0)
printf "key: %s\n", $x->k
print (($arg1*)$x->v)->$arg2
printf "\n\n"
set $x = $x->next
set $i = $i + 1
end