.gdbinit revision 5e76c0a474af3d8f511ae9c59062e191a3ff4d6f
dfd7798d8b870abf03795d8095297a4b982ab6e9Mark Andrews# gdb macros which may be useful for folks using gdb to debug
dfd7798d8b870abf03795d8095297a4b982ab6e9Mark Andrews# apache. Delete it if it bothers you.
19ff7edc1a6388085193f5487e1599f45aa62648Mark Andrewsdefine dump_table
19ff7edc1a6388085193f5487e1599f45aa62648Mark Andrews set $t = (apr_table_entry_t *)((apr_array_header_t *)$arg0)->elts
19ff7edc1a6388085193f5487e1599f45aa62648Mark Andrews set $n = ((apr_array_header_t *)$arg0)->nelts
8a0ff6c15cb20c903f9e16a3d5c2cab603478bc3Mark Andrews while $i < $n
8a0ff6c15cb20c903f9e16a3d5c2cab603478bc3Mark Andrews if $t[$i].val == (void *)0L
8a0ff6c15cb20c903f9e16a3d5c2cab603478bc3Mark Andrews printf "[%u] '%s'=>NULL\n", $i, $t[$i].key
42928d936e79dbda7ea00bbcab6e5d8034a95bf8Andreas Gustafsson printf "[%u] '%s'='%s' [%p]\n", $i, $t[$i].key, $t[$i].val, $t[$i].val
0c0619cc1983ff58e855c5159d8892e46dddac5eBrian Wellington set $i = $i + 1
c472ead4a932f93251eddaa41e120c3bfc4f95a4Andreas Gustafssondocument dump_table
c472ead4a932f93251eddaa41e120c3bfc4f95a4Andreas Gustafsson Print the key/value pairs in a table.
a6dbd6b6604e27ae3c7190de20dbcaaa6e5a1fd8Andreas Gustafssondefine dump_skiplist
a6dbd6b6604e27ae3c7190de20dbcaaa6e5a1fd8Andreas Gustafsson set $sl = (apr_skiplist *)$arg0
383665e42ad838046472e847b16c4e0d3f1aaf76Bob Halley set $m = $sl->bottom
383665e42ad838046472e847b16c4e0d3f1aaf76Bob Halley printf "skiplist@%p: size=%lu: height=%d\n", $sl, $sl->size, $sl->height
383665e42ad838046472e847b16c4e0d3f1aaf76Bob Halley printf "(%p,%.12lx)", $m, $m->data
383665e42ad838046472e847b16c4e0d3f1aaf76Bob Halley set $u = $m->up
383665e42ad838046472e847b16c4e0d3f1aaf76Bob Halley printf " (%p,%.12lx)", $u, $u->data
6b5a6fbe1cc0ceb7e2b516aaada596b79360a5b8Bob Halley set $u = $u->up
5bbed85a33186db4e629e98f45ca702ac6b09127Brian Wellington set $m = $m->next
ba6fd2580863759baedd9c47153602b19006a324Andreas Gustafssondocument dump_skiplist
ba6fd2580863759baedd9c47153602b19006a324Andreas Gustafsson Print the nodes/values in a skiplist
86a4d80e0624a10b1824d25018246e1ea63f55d2Andreas Gustafssondefine dump_string_hash
86a4d80e0624a10b1824d25018246e1ea63f55d2Andreas Gustafsson set $h = $arg0->array
850d70818503ca1b0f98c9c70b16b51e789fd705Andreas Gustafsson set $n = $arg0->max
dd16d9d9e77c2d906ee5ffa3dd9f71cacfbcb081Brian Wellington while $i < $n
d3a86da2e8f09e2c3f55721aae537b9cacc7e537Andreas Gustafsson set $ent = $h[$i]
d3a86da2e8f09e2c3f55721aae537b9cacc7e537Andreas Gustafsson while $ent != (void *)0L
d3a86da2e8f09e2c3f55721aae537b9cacc7e537Andreas Gustafsson printf "'%s' => '%p'\n", $ent->key, $ent->val
d3a86da2e8f09e2c3f55721aae537b9cacc7e537Andreas Gustafsson set $ent = $ent->next
850d70818503ca1b0f98c9c70b16b51e789fd705Andreas Gustafsson set $i = $i + 1
3c82f274bd880a33fdaf211af4fe8f6b3d6ca556David Lawrencedocument dump_string_hash
3c82f274bd880a33fdaf211af4fe8f6b3d6ca556David Lawrence Print the entries in a hash table indexed by strings
3c82f274bd880a33fdaf211af4fe8f6b3d6ca556David Lawrencedefine dump_string_shash
3c82f274bd880a33fdaf211af4fe8f6b3d6ca556David Lawrence set $h = $arg0->array
3c82f274bd880a33fdaf211af4fe8f6b3d6ca556David Lawrence set $n = $arg0->max
3c82f274bd880a33fdaf211af4fe8f6b3d6ca556David Lawrence while $i < $n
3c82f274bd880a33fdaf211af4fe8f6b3d6ca556David Lawrence set $ent = $h[$i]
3c82f274bd880a33fdaf211af4fe8f6b3d6ca556David Lawrence while $ent != (void *)0L
3c82f274bd880a33fdaf211af4fe8f6b3d6ca556David Lawrence printf "'%s' => '%s'\n", $ent->key, $ent->val
5afc10d6d8278c9ab34b9f6c82ef7bb3bfefd0efAndreas Gustafsson set $ent = $ent->next
78d78f05d91205cbde33ca87d24b8d13aa2d8d66Brian Wellington set $i = $i + 1
5afc10d6d8278c9ab34b9f6c82ef7bb3bfefd0efAndreas Gustafssondocument dump_string_shash
5afc10d6d8278c9ab34b9f6c82ef7bb3bfefd0efAndreas Gustafsson Print the entries in a hash table indexed by strings with string values
3f01dde0bd24561fc3a6c2f7e259a58af4457a86Brian Wellington run -DONE_PROCESS
626b221f7113479a0709f0bb0a8193c0ab0dcf84Andreas Gustafssondefine dump_string_array
626b221f7113479a0709f0bb0a8193c0ab0dcf84Andreas Gustafsson set $a = (char **)((apr_array_header_t *)$arg0)->elts
626b221f7113479a0709f0bb0a8193c0ab0dcf84Andreas Gustafsson set $n = (int)((apr_array_header_t *)$arg0)->nelts
733e928f714c848aa394c2d12b6239bc7780101bMark Andrews while $i < $n
c379c1bddb2d84c9219ab6c394b33aa866b9f3bfAndreas Gustafsson printf "[%u] '%s'\n", $i, $a[$i]
febaa091847ab004f40500cc475a819f2c73fcddAndreas Gustafsson set $i = $i + 1
ebfcb6cf66283096ebda1503b6cc042ce86b6bedBrian Wellingtondocument dump_string_array
c379c1bddb2d84c9219ab6c394b33aa866b9f3bfAndreas Gustafsson Print all of the elements in an array of strings.
066faef1195d539f575816ccab87ff3e85b1b13eBrian Wellingtondefine printmemn
17442ccc2b2e9c3b3bfc337f0fdfad6186fbb123Mark Andrews while $i < $arg1
17442ccc2b2e9c3b3bfc337f0fdfad6186fbb123Mark Andrews if $arg0[$i] < 0x20 || $arg0[$i] > 0x7e
61b0df9eb522f13aef13cc2704728e799cbc251aMichael Sawyer printf "%c", $arg0[$i]
369bb68c2c7709c7fd8b0d6c1d1f8abc6422a7e2Michael Sawyer set $i = $i + 1
3dcb97b199693012d12e978b8f577a339e434361Andreas Gustafssondefine print_bkt_datacol
3dcb97b199693012d12e978b8f577a339e434361Andreas Gustafsson # arg0 == column name
4ec1a96d90784f70380bdec66f8a0bd6718a5b71Mark Andrews # arg1 == format
4ec1a96d90784f70380bdec66f8a0bd6718a5b71Mark Andrews # arg2 == value
fa3cbea8bfba19d1c11f9a6ad20f40a2c15377f0Brian Wellington # arg3 == suppress header?
fa3cbea8bfba19d1c11f9a6ad20f40a2c15377f0Brian Wellington set $suppressheader = $arg3
0fc89c4ee660e825ac66774f2d4912cfc396386aMark Andrews if !$suppressheader
533df4efdafcf7a8b7292a298f45df9ab7f7f7f9Mark Andrews printf " | "
04c22ceaf2d3812eaab69d79958d0e0d62048cd2Mark Andrews printf $arg1, $arg2
04c22ceaf2d3812eaab69d79958d0e0d62048cd2Mark Andrewsdefine dump_bucket_ex
04c22ceaf2d3812eaab69d79958d0e0d62048cd2Mark Andrews # arg0 == bucket
04c22ceaf2d3812eaab69d79958d0e0d62048cd2Mark Andrews # arg1 == suppress header?
04c22ceaf2d3812eaab69d79958d0e0d62048cd2Mark Andrews set $bucket = (struct apr_bucket *)$arg0
6ef15459b8fd3fc8b5672da4ad72c19a755dbe45Mark Andrews set $sh = $arg1
b65f2ab14abb4b6ef906d7d02064fba158f07b1eDavid Lawrence set $refcount = -1
b65f2ab14abb4b6ef906d7d02064fba158f07b1eDavid Lawrence print_bkt_datacol "bucket" "%-9s" $bucket->type->name $sh
b65f2ab14abb4b6ef906d7d02064fba158f07b1eDavid Lawrence printf "(0x%08lx)", (unsigned long)$bucket
b65f2ab14abb4b6ef906d7d02064fba158f07b1eDavid Lawrence print_bkt_datacol "length" "%-6ld" (long)($bucket->length) $sh
b65f2ab14abb4b6ef906d7d02064fba158f07b1eDavid Lawrence print_bkt_datacol "data" "0x%08lx" $bucket->data $sh
c03bb27f0675a6e60ceea66b451548e8481bc05cMark Andrews printf "\n "
c03bb27f0675a6e60ceea66b451548e8481bc05cMark Andrews if (($bucket->type == &apr_bucket_type_eos) || \
c03bb27f0675a6e60ceea66b451548e8481bc05cMark Andrews ($bucket->type == &apr_bucket_type_flush))
389c749a5ee18f1c0d6278ae49f2aae5d5f0d2dcMark Andrews # metadata buckets, no content
389c749a5ee18f1c0d6278ae49f2aae5d5f0d2dcMark Andrews print_bkt_datacol "contents" "%c" ' ' $sh
72fa265baa3d138b43427bcb5c0838740f807045Mark Andrews print_bkt_datacol "rc" "n/%c" 'a' $sh
4b6d5b2312d1482cc406fe58fa3269dd7a915b3fMark Andrews if ($bucket->type == &ap_bucket_type_error)
4b6d5b2312d1482cc406fe58fa3269dd7a915b3fMark Andrews # metadata bucket, no content but it does have an error code in it
29c818c7d40fc8898b062903ec703851328a4deaMark Andrews print_bkt_datacol "contents" "%c" ' ' $sh
29c818c7d40fc8898b062903ec703851328a4deaMark Andrews set $status = ((ap_bucket_error *)$bucket->data)->status
b1cde6bf3a8e3a77eb77caf97df0d7ec5c8450dfBrian Wellington printf " (status=%3d) ", $status
b1cde6bf3a8e3a77eb77caf97df0d7ec5c8450dfBrian Wellington print_bkt_datacol "rc" "n/%c" 'a' $sh
b55c30f2de6e1baaa3a9ba69b92f428f2c255ac3Mark Andrews if (($bucket->type == &apr_bucket_type_file) || \
b55c30f2de6e1baaa3a9ba69b92f428f2c255ac3Mark Andrews ($bucket->type == &apr_bucket_type_pipe) || \
b55c30f2de6e1baaa3a9ba69b92f428f2c255ac3Mark Andrews ($bucket->type == &apr_bucket_type_socket))
37d1c8ee546ae89720c3e17e57ee3a05e9cdc7b9Brian Wellington # buckets that contain data not in memory (ie not printable)
37d1c8ee546ae89720c3e17e57ee3a05e9cdc7b9Brian Wellington print_bkt_datacol "contents" "[**unprintable**%c" ']' $sh
28b7844ee93231da831ba3c090e1677bb1be5f18Andreas Gustafsson if $bucket->type == &apr_bucket_type_file
28b7844ee93231da831ba3c090e1677bb1be5f18Andreas Gustafsson set $refcount = ((apr_bucket_refcount *)$bucket->data)->refcount
28b7844ee93231da831ba3c090e1677bb1be5f18Andreas Gustafsson print_bkt_datacol "rc" "%d" $refcount $sh
78db9e8f4b686fde6dfa0ec85a68c06cc9d4bf28Brian Wellington if (($bucket->type == &apr_bucket_type_heap) || \
78db9e8f4b686fde6dfa0ec85a68c06cc9d4bf28Brian Wellington ($bucket->type == &apr_bucket_type_pool) || \
78db9e8f4b686fde6dfa0ec85a68c06cc9d4bf28Brian Wellington ($bucket->type == &apr_bucket_type_mmap) || \
78db9e8f4b686fde6dfa0ec85a68c06cc9d4bf28Brian Wellington ($bucket->type == &apr_bucket_type_transient) || \
b20ee662a7c847c9ef7b96ab9e5e34543efe5c0dMark Andrews ($bucket->type == &apr_bucket_type_immortal))
b20ee662a7c847c9ef7b96ab9e5e34543efe5c0dMark Andrews # in-memory buckets
450995b90c8cb66d82c2377d4f9bd9812a132c30Andreas Gustafsson if $bucket->type == &apr_bucket_type_heap
450995b90c8cb66d82c2377d4f9bd9812a132c30Andreas Gustafsson set $refcount = ((apr_bucket_refcount *)$bucket->data)->refcount
f90fe7c8b9a3eef8968fac74905e868c8ab583a3Brian Wellington set $p = (apr_bucket_heap *)$bucket->data
190fbe9738bd0c1b9b13732bb8bd56b2b7c71640David Lawrence set $data = $p->base+$bucket->start
190fbe9738bd0c1b9b13732bb8bd56b2b7c71640David Lawrence if $bucket->type == &apr_bucket_type_pool
190fbe9738bd0c1b9b13732bb8bd56b2b7c71640David Lawrence set $refcount = ((apr_bucket_refcount *)$bucket->data)->refcount
190fbe9738bd0c1b9b13732bb8bd56b2b7c71640David Lawrence set $p = (apr_bucket_pool *)$bucket->data
c40085afa75a5eae732ec1198384dd5cb24400b6Bob Halley set $p = (apr_bucket_heap *)$bucket->data
7b438bdb9b821f9f1c96443762072e137716048dBrian Wellington set $data = $p->base+$bucket->start
c40085afa75a5eae732ec1198384dd5cb24400b6Bob Halley if $bucket->type == &apr_bucket_type_mmap
7b438bdb9b821f9f1c96443762072e137716048dBrian Wellington # is this safe if not APR_HAS_MMAP?
c40085afa75a5eae732ec1198384dd5cb24400b6Bob Halley set $refcount = ((apr_bucket_refcount *)$bucket->data)->refcount
c40085afa75a5eae732ec1198384dd5cb24400b6Bob Halley set $p = (apr_bucket_mmap *)$bucket->data
c40085afa75a5eae732ec1198384dd5cb24400b6Bob Halley set $data = ((char *)$p->mmap->mm)+$bucket->start
c40085afa75a5eae732ec1198384dd5cb24400b6Bob Halley if (($bucket->type == &apr_bucket_type_transient) || \
86c270cbb24117976d6cd3098c3010e067915c24Andreas Gustafsson ($bucket->type == &apr_bucket_type_immortal))
86c270cbb24117976d6cd3098c3010e067915c24Andreas Gustafsson set $data = ((char *)$bucket->data)+$bucket->start
588b63e1a86fb707172830e14897da624ed380edMark Andrews printf " | ["
588b63e1a86fb707172830e14897da624ed380edMark Andrews printf " contents=["
bb17aa91c14de959b191a200df61afb6a68f110fBrian Wellington set $datalen = $bucket->length
bb17aa91c14de959b191a200df61afb6a68f110fBrian Wellington if $datalen > 17
452d75b18f9d050086964fa39c326cf388517396Mark Andrews printmem $data 17
452d75b18f9d050086964fa39c326cf388517396Mark Andrews printf "..."
2b4db0b6d4b5a0307cecbafdd1d34d6f61b7dbadMark Andrews set $datalen = 20
6850cdd4497424c9d42ade487edfde9fb9a47de9Brian Wellington printmemn $data $datalen
6850cdd4497424c9d42ade487edfde9fb9a47de9Brian Wellington while $datalen < 20
2a37aa188c2297e0c0856c3e5740c43dd426a432Mark Andrews set $datalen = $datalen + 1
6c87cf19970a9eef43c1e38227cd23b3a2f6151aMark Andrews if $refcount != -1
7869b99dc815e3b863351b8095d1b71b3f583541Brian Wellington print_bkt_datacol "rc" "%d" $refcount $sh
df1e829dde71ab960545453e4ae439ae601d5a9eMark Andrews print_bkt_datacol "rc" "n/%c" 'a' $sh
df1e829dde71ab960545453e4ae439ae601d5a9eMark Andrews # 3rd-party bucket type
df1e829dde71ab960545453e4ae439ae601d5a9eMark Andrews print_bkt_datacol "contents" "[**unknown**%c" ']' $sh
fb04db11ee6aad3ac3e023ab89b5f9d8a4d5674dMichael Sawyer print_bkt_datacol "rc" "n/%c" 'a' $sh
fb04db11ee6aad3ac3e023ab89b5f9d8a4d5674dMichael Sawyerdefine dump_bucket
fb04db11ee6aad3ac3e023ab89b5f9d8a4d5674dMichael Sawyer dump_bucket_ex $arg0 0
e65fe7af00935a0a81d4b0b0ed51c7f6c89f5c3bAndreas Gustafssondocument dump_bucket
e65fe7af00935a0a81d4b0b0ed51c7f6c89f5c3bAndreas Gustafsson Print bucket info
4bb3a1a63d7943564f30bf9efd312283141439a2Andreas Gustafssondefine dump_brigade
4bb3a1a63d7943564f30bf9efd312283141439a2Andreas Gustafsson set $bb = (apr_bucket_brigade *)$arg0
4bb3a1a63d7943564f30bf9efd312283141439a2Andreas Gustafsson set $bucket = $bb->list.next
cef18335b7f37bf02bc9e9f2c8750a3a9dcd718aAndreas Gustafsson set $sentinel = ((char *)((&($bb->list)) \
e2b52099918681498136fc82df192d256cc3cdd3Brian Wellington - ((size_t) &((struct apr_bucket *)0)->link)))
cef18335b7f37bf02bc9e9f2c8750a3a9dcd718aAndreas Gustafsson printf "dump of brigade 0x%lx\n", (unsigned long)$bb
e549eb1242b69ee050440e7205a5633cb56199b3Mark Andrews printf " | type (address) | length | "
e549eb1242b69ee050440e7205a5633cb56199b3Mark Andrews printf "data addr | contents | rc\n"
88cef4408ab6b4c48702ed1b3ae27e20f485d864Mark Andrews printf "----------------------------------------"
88cef4408ab6b4c48702ed1b3ae27e20f485d864Mark Andrews printf "----------------------------------------\n"
88cef4408ab6b4c48702ed1b3ae27e20f485d864Mark Andrews if $bucket == $sentinel
88cef4408ab6b4c48702ed1b3ae27e20f485d864Mark Andrews printf "brigade is empty\n"
693ddf84daa745a0ea8ca311a8154dfa03eabc43Andreas Gustafsson while $bucket != $sentinel
93d5a6b95e88f57b7619d9728f06e3aa5e2f0c65Andreas Gustafsson printf "%2d", $j
693ddf84daa745a0ea8ca311a8154dfa03eabc43Andreas Gustafsson dump_bucket_ex $bucket 1
ff7e6f2791cc5ad7c5f401a184b88343fde5ec3cAndreas Gustafsson set $j = $j + 1
ff7e6f2791cc5ad7c5f401a184b88343fde5ec3cAndreas Gustafsson set $bucket = $bucket->link.next
ff7e6f2791cc5ad7c5f401a184b88343fde5ec3cAndreas Gustafsson printf "end of brigade\n"
2bebe117bf96d7e24df4d703d6488d61a5179bcaMark Andrewsdocument dump_brigade
2bebe117bf96d7e24df4d703d6488d61a5179bcaMark Andrews Print bucket brigade info
3f123dcc2fe5d2cd08ca91b732741d86a4036906Brian Wellingtondefine dump_filters
3f123dcc2fe5d2cd08ca91b732741d86a4036906Brian Wellington set $f = $arg0
16ea60d0dbbaf1206f4800cb16744ef568fd7be8Michael Sawyer printf "%s(0x%lx): ctx=0x%lx, r=0x%lx, c=0x%lx\n", \
16ea60d0dbbaf1206f4800cb16744ef568fd7be8Michael Sawyer $f->frec->name, (unsigned long)$f, (unsigned long)$f->ctx, \
85b23709431b1a84924fe2844f5cf657d1689eefMichael Sawyer set $f = $f->next
85b23709431b1a84924fe2844f5cf657d1689eefMichael Sawyerdocument dump_filters
d15f51c600ed29b2dc379c433fb226c3a13ac0bbAndreas Gustafsson Print filter chain info
d15f51c600ed29b2dc379c433fb226c3a13ac0bbAndreas Gustafssondefine dump_filter_chain
d15f51c600ed29b2dc379c433fb226c3a13ac0bbAndreas Gustafsson set $r = $arg0
cef18335b7f37bf02bc9e9f2c8750a3a9dcd718aAndreas Gustafsson set $f = $r->output_filters
aa2c453d3c6e416b56b29247bedd9a0af2721e93Mark Andrews if $f == $r->output_filters
e412ae947df6de858883564b8676a9650df70d9aMark Andrews printf "r->output_filters =>\n"
e412ae947df6de858883564b8676a9650df70d9aMark Andrews if $f == $r->proto_output_filters
cef18335b7f37bf02bc9e9f2c8750a3a9dcd718aAndreas Gustafsson printf "r->proto_output_filters =>\n"
07a926724c0a91d85b85a94441938d0094e88cffMark Andrews if $f == $r->connection->output_filters
07a926724c0a91d85b85a94441938d0094e88cffMark Andrews printf "r->connection->output_filters =>\n"
90023730de34721b8cd8f3b5d059a28b7a65cf04Andreas Gustafsson printf " %s(0x%lx): type=%d, ctx=0x%lx, r=%s(0x%lx), c=0x%lx\n", \
90023730de34721b8cd8f3b5d059a28b7a65cf04Andreas Gustafsson $f->frec->name, (unsigned long)$f, $f->frec->ftype, (unsigned long)$f->ctx, \
922e6a3c2ac4ef900dd9dc99f0cc137f18372583Andreas Gustafsson $f->r == $r ? "r" : ($f->r == 0L ? "null" : \
922e6a3c2ac4ef900dd9dc99f0cc137f18372583Andreas Gustafsson ($f->r == $r->main ? "r->main" : \
922e6a3c2ac4ef900dd9dc99f0cc137f18372583Andreas Gustafsson ($r->main && $f->r == $r->main->main ? "r->main->main" : "????"))), \
280747fa7c1d4597d47f7be8ec5fb7c8980c1952Andreas Gustafsson set $f = $f->next
27d725f2b0f8d176d4625dc8b2ed71269b25c9a7Andreas Gustafssondocument dump_filter_chain
337ca1838428c52bca3c72288342ce3dee550a04Andreas Gustafsson Print filter chain info given a request_rec pointer
337ca1838428c52bca3c72288342ce3dee550a04Andreas Gustafssondefine dump_process_rec
337ca1838428c52bca3c72288342ce3dee550a04Andreas Gustafsson set $p = $arg0
337ca1838428c52bca3c72288342ce3dee550a04Andreas Gustafsson printf "process_rec=0x%lx:\n", (unsigned long)$p
337ca1838428c52bca3c72288342ce3dee550a04Andreas Gustafsson printf " pool=0x%lx, pconf=0x%lx\n", \
6b0ce7d29fac9df84ed34aa2d4634e754aec750dAndreas Gustafsson (unsigned long)$p->pool, (unsigned long)$p->pconf
6b0ce7d29fac9df84ed34aa2d4634e754aec750dAndreas Gustafssondocument dump_process_rec
dc2e45d08d73fdaefd92dbfa4d69b4d3f3b0f249Andreas Gustafsson Print process_rec info
27d725f2b0f8d176d4625dc8b2ed71269b25c9a7Andreas Gustafssondefine dump_server_rec
27d725f2b0f8d176d4625dc8b2ed71269b25c9a7Andreas Gustafsson set $s = $arg0
27d725f2b0f8d176d4625dc8b2ed71269b25c9a7Andreas Gustafsson printf "name=%s:%d\n", \
c89ac488df58cf6a37918cd00236eedf015830f8Andreas Gustafsson $s->server_hostname, $s->port
c89ac488df58cf6a37918cd00236eedf015830f8Andreas Gustafsson dump_process_rec($s->process)
c89ac488df58cf6a37918cd00236eedf015830f8Andreas Gustafssondocument dump_server_rec
46a7e707fee6d7ba6ca6dae200ff6e0230f4d2f1Brian Wellington Print server_rec info
9d3ef72b37c7d23ce3aaaaa5cd0434b4e5ed5c12Mark Andrewsdefine dump_servers
9d3ef72b37c7d23ce3aaaaa5cd0434b4e5ed5c12Mark Andrews set $s = $arg0
a7c76f1924d5fc914c579fd3b0276ffbddd2f65aMark Andrews dump_server_rec($s)
c50a002bd1e36d13e95d74b43ed4a2b5d6fdcec3Mark Andrews set $s = $s->next
c50a002bd1e36d13e95d74b43ed4a2b5d6fdcec3Mark Andrewsdocument dump_servers
c50a002bd1e36d13e95d74b43ed4a2b5d6fdcec3Mark Andrews Print server_rec list info
566155f16e43fe5f1550456e534b31b0cc36d243David Lawrencedefine dump_request_tree
566155f16e43fe5f1550456e534b31b0cc36d243David Lawrence set $r = $arg0
051beeafa6547440da17985665b31952b85ede56Brian Wellington printf "r=(0x%lx): uri=%s, handler=%s, r->main=0x%lx\n", \
07a46d6dca37ef96b6e9c1fc0c2789983d91819cAndreas Gustafsson $r, $r->unparsed_uri, $r->handler ? $r->handler : "(none)", $r->main
07a46d6dca37ef96b6e9c1fc0c2789983d91819cAndreas Gustafsson set $r = $r->main
6d85ebc2d2ccbb8ef01c3ac1659686d3c2be0377Brian Wellingtondefine dump_allocator
4a0b04961653b4153402dabd71dfd8474b6c230dAndreas Gustafsson printf "Allocator current_free_index = %d, max_free_index = %d\n", \
4a0b04961653b4153402dabd71dfd8474b6c230dAndreas Gustafsson ($arg0)->current_free_index, ($arg0)->max_free_index
4a0b04961653b4153402dabd71dfd8474b6c230dAndreas Gustafsson printf "Allocator free list:\n"
98b8d49c0c0bbace27966eed5811bc81255ce297Brian Wellington set $max =(sizeof $arg0->free)/(sizeof $arg0->free[0])
a94948ad5b3b258ce9503b7322bdf82c0baabcabAndreas Gustafsson while $i < $max
e42c402595802edceafbd3e5338dda011fbbcdb6Michael Sawyer set $node = $arg0->free[$i]
8357e90fba97010a86356a41c8a961d5d602d7d0Michael Sawyer printf " #%2d: ", $i
3291587f23b940c986f41cf37b2e531f618ec2bdMichael Sawyer while $node != 0
a94948ad5b3b258ce9503b7322bdf82c0baabcabAndreas Gustafsson printf "%d, ", 4096 << $node->index
a94948ad5b3b258ce9503b7322bdf82c0baabcabAndreas Gustafsson set $kb = $kb + (4 << $node->index)
abb38b673379d6dae7cbb495f814d73a4afe5c8bAndreas Gustafsson set $node = $node->next
b374727d513049b4bfcb9eb021002595fe6a7c63Mark Andrews printf "ends.\n"
b374727d513049b4bfcb9eb021002595fe6a7c63Mark Andrews set $i = $i + 1
d922e82162b4d0d2387a531ebc127abe9fe4cf2bAndreas Gustafsson printf "Sum of free blocks: %dkiB\n", $kb
2868291ab5d4deba4d61c110f92dc397807702c7Mark Andrewsdocument dump_allocator
2868291ab5d4deba4d61c110f92dc397807702c7Mark Andrews Print status of an allocator and its freelists.
b374727d513049b4bfcb9eb021002595fe6a7c63Mark Andrewsdefine dump_one_pool
be1d71fd17c92b0acee36ba43ebe4daa498e8014Mark Andrews set $p = $arg0
8e732de92e9814e3fa54e36d2154939ea6086b16Andreas Gustafsson set $nodes = 0
afd2f40b3cff8c3c307155bdc27e5b60e9115545Andreas Gustafsson set $node = $arg0->active
afd2f40b3cff8c3c307155bdc27e5b60e9115545Andreas Gustafsson while $done == 0
afd2f40b3cff8c3c307155bdc27e5b60e9115545Andreas Gustafsson set $size = $size + (4096 << $node->index)
c605f30cd7d540243509c86cf31b01bdd4fe19feMark Andrews set $free = $free + ($node->endp - $node->first_avail)
c605f30cd7d540243509c86cf31b01bdd4fe19feMark Andrews set $nodes = $nodes + 1
c605f30cd7d540243509c86cf31b01bdd4fe19feMark Andrews set $node = $node->next
3302ed8d6eaef8f598338f5682477c5f6acd583cBob Halley if $node == $arg0->active
3302ed8d6eaef8f598338f5682477c5f6acd583cBob Halley set $done = 1
3302ed8d6eaef8f598338f5682477c5f6acd583cBob Halley printf "Pool '%s' [%p]: %d/%d free (%d blocks)\n", $p->tag, $p, $free, $size, $nodes
cef18335b7f37bf02bc9e9f2c8750a3a9dcd718aAndreas Gustafsson# Set sane defaults for common signals:
d03bffc40e68ddb63d278946fd9f7f1ad784f5bcMichael Sawyerhandle SIGPIPE noprint pass nostop
d03bffc40e68ddb63d278946fd9f7f1ad784f5bcMichael Sawyerhandle SIGUSR1 print pass nostop