.gdbinit revision 75ad9d694b36c11047c0b747cf7fc31a4fdbf6e4
50N/A# gdb macros which may be useful for folks using gdb to debug
50N/A# apache. Delete it if it bothers you.
50N/A
50N/Adefine dump_table
50N/A set $t = (apr_table_entry_t *)((apr_array_header_t *)$arg0)->elts
50N/A set $n = ((apr_array_header_t *)$arg0)->nelts
50N/A set $i = 0
50N/A while $i < $n
50N/A printf "[%u] '%s'='%s'\n", $i, $t[$i].key, $t[$i].val
50N/A set $i = $i + 1
50N/A end
50N/Aend
50N/Adocument dump_table
50N/A Print the key/value pairs in a table.
50N/Aend
50N/A
50N/A
50N/Adefine rh
50N/A run -f /home/dgaudet/ap2/conf/mpm.conf
50N/Aend
50N/A
50N/Adefine ro
50N/A run -DONE_PROCESS
50N/Aend
50N/A
50N/Adefine dump_string_array
50N/A set $a = (char **)((apr_array_header_t *)$arg0)->elts
50N/A set $n = (int)((apr_array_header_t *)$arg0)->nelts
50N/A set $i = 0
50N/A while $i < $n
50N/A printf "[%u] '%s'\n", $i, $a[$i]
50N/A set $i = $i + 1
50N/A end
50N/Aend
50N/Adocument dump_string_array
50N/A Print all of the elements in an array of strings.
50N/Aend
50N/A
50N/Adefine dump_bucket
50N/A set $bucket = $arg0
50N/A printf "bucket=%s(0x%lx), length=%ld, data=0x%lx\n", \
50N/A $bucket->type->name, \
50N/A (unsigned long)$bucket, (long)$bucket->length, \
50N/A (unsigned long)$bucket->data
50N/Aend
50N/Adocument dump_bucket
50N/A Print bucket info
50N/Aend
50N/A
50N/Adefine dump_brigade
50N/A set $bb = $arg0
50N/A set $bucket = ((&((ap_bucket_brigade *)$bb)->list))->next
50N/A set $sentinel = ((char *)((&(((ap_bucket_brigade *)$bb)->list)) \
50N/A - ((size_t) &((struct ap_bucket *)0)->link)))
50N/A set $i = 0
50N/A
50N/A printf "dump of brigade 0x%lx\n", (unsigned long)$bb
50N/A if $bucket == $sentinel
50N/A printf "brigade is empty\n"
50N/A end
50N/A
50N/A while $bucket != $sentinel
50N/A printf " %d: bucket=%s(0x%lx), length=%ld, data=0x%lx\n", \
50N/A $i, $bucket->type->name, \
50N/A (unsigned long)$bucket, (long)$bucket->length, \
50N/A (unsigned long)$bucket->data
50N/A set $i = $i + 1
50N/A set $bucket = $bucket->link.next
50N/A end
50N/Aend
50N/Adocument dump_brigade
63N/A Print bucket brigade info
50N/Aend
63N/A