Skip to content

Commit 76e08df

Browse files
committed
Added gdbmacro for msg queues
1 parent c2de1a6 commit 76e08df

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

.gdbmacros

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
# Print rd_kafka_msgq_t
3+
define dump_msgq
4+
set $rkmq = $arg0
5+
set $rkm = $rkmq.rkmq_msgs.tqh_first
6+
set $exp_msgid = 0
7+
set $cnt = 0
8+
while $rkm != 0
9+
set $msgid = $rkm.rkm_u.producer.msgid
10+
printf "#%d ((rd_kafka_msgq_t *)%p) msgid %llu\n", $cnt, $rkm, $msgid
11+
if $exp_msgid != 0 && $exp_msgid != $msgid
12+
printf " ^ WARNING: expected msgid %llu, not %llu\n", $exp_msgid, $msgid
13+
end
14+
set $exp_msgid = $msgid + 1
15+
set $rkm = $rkm.rkm_link.tqe_next
16+
set $cnt++
17+
end
18+
end
19+

0 commit comments

Comments
 (0)