From 94a6c517bae664e14f97d3aa6296fbc06154f80c Mon Sep 17 00:00:00 2001 From: Mathieu Rene Date: Tue, 24 Feb 2009 22:01:10 +0000 Subject: [PATCH] GDB goodies git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12265 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- support-d/.gdbinit | 56 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/support-d/.gdbinit b/support-d/.gdbinit index 94bbb48c6f..fc652e6669 100644 --- a/support-d/.gdbinit +++ b/support-d/.gdbinit @@ -1,5 +1,6 @@ # FreeSWITCH Custom GDB commands define list_sessions + dont-repeat printf "Listing sessions: \n" set $i = 0 set $x=session_manager.session_table->table->first @@ -9,4 +10,57 @@ define list_sessions set $i = $i + 1 end printf "Found %d sessions.\n", $i -end \ No newline at end of file +end +document list_sessions Print a list of session uuid and pointers + +define hash_it_str + dont-repeat + set $i = 0 + set $x=$arg0->table->first + while($x != 0x0) + printf "key: %s valueptr: %p\n", $x->pKey, $x->data + set $x = $x->next + set $i = $i + 1 + end +end +document hash_it_str Prints the content of a hashtable displaying the key as a string and the value as pointer + +define hash_it_int + dont-repeat + set $i = 0 + set $x=$arg0->table->first + while($x != 0x0) + printf "key: %d valueptr: %p\n", $x->pKey, $x->data + set $x = $x->next + set $i = $i + 1 + end +end +document hash_it_int Prints the content of a hashtable displaying the key as an int and the value as pointer + +define hash_it_str_x + dont-repeat + set $i = 0 + set $x=$arg0->table->first + while($x != 0x0) + printf "key: %s\n", $x->pKey + print (($arg1)$x->data)->$arg2 + printf "\n\n" + set $x = $x->next + set $i = $i + 1 + end +end +document hash_it_str_x 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 + +define hash_it_int_x + dont-repeat + set $i = 0 + set $x=$arg0->table->first + while($x != 0x0) + printf "key: %d\n", $x->pKey + print (($arg1)$x->data)->$arg2 + printf "\n\n" + set $x = $x->next + set $i = $i + 1 + end +end +document hash_it_int_x 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