forked from ironbee/ironbee
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gdbinit
More file actions
72 lines (69 loc) · 2 KB
/
.gdbinit
File metadata and controls
72 lines (69 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# GDB Macros for easier debugging
#
# vim: set expandtab tabstop=4 shiftwidth=4 autoindent smartindent:
#
define dump_ib_list_t
set $node = (ib_list_node_t *)((ib_list_t *)$arg0)->head
set $n = ((ib_list_t *)$arg0)->nelts
set $i = 0
printf "LIST: %p length=%u\n", $arg0, $n
while $i < $n
printf "[%u] %p\n", $i, $node->data
set $node = $node->next
set $i = $i + 1
end
end
document dump_ib_list_t
dump_ib_list_t <ib_list_t *>
end
define dump_ib_stream_t
set $node = (ib_sdata_t *)((ib_stream_t *)$arg0)->head
set $n = ((ib_stream_t *)$arg0)->nelts
set $i = 0
printf "STREAM: %p chunks=%u length=%u\n", $arg0, $n, ((ib_stream_t *)$arg0)->slen
while $i < $n
if $node->dlen > 0
eval "printf \"[%%u] len=%%-5u %%.%us\\n\", $i, $node->dlen, (char *)$node->data", $node->dlen
else
printf "[%u] len=%-5u <NULL>\n", $i, $node->dlen
end
set $node = $node->next
set $i = $i + 1
end
end
document dump_ib_stream_t
dump_ib_stream_t <ib_stream_t *>
end
define dump_ib_tx_t
set $tx = (ib_tx_t *)$arg0
printf "TX: id=%s\n", $tx->id
printf "request_line: "
if $tx->request_line && $tx->request_line->raw
eval "printf \"%%.%us\\n\", (char *)$tx->request_line->raw->data", $tx->request_line->raw->length
else
printf "\n"
end
printf "request_headers:"
if $tx->request_header
set $node = $tx->request_header->head
set $n = $tx->request_header->size
set $i = 0
printf " num=%u\n", $n
while $i < $n
eval "printf \" %%.%us: %%.%us\\n\", (char *)$node->name->data, (char *)$node->value->data", $node->name->length, $node->value->length
set $node = $node->next
set $i = $i + 1
end
else
printf "\n"
end
printf "request_body: "
if $tx->request_body
dump_ib_stream_t $tx->request_body
else
printf "\n"
end
end
document dump_ib_tx_t
dump_ib_tx_t <ib_tx_t *>
end