Skip to content

Commit

Permalink
Added gdbmacro for msg queues
Browse files Browse the repository at this point in the history
  • Loading branch information
edenhill committed Nov 21, 2018
1 parent c2de1a6 commit 76e08df
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .gdbmacros
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

# Print rd_kafka_msgq_t
define dump_msgq
set $rkmq = $arg0
set $rkm = $rkmq.rkmq_msgs.tqh_first
set $exp_msgid = 0
set $cnt = 0
while $rkm != 0
set $msgid = $rkm.rkm_u.producer.msgid
printf "#%d ((rd_kafka_msgq_t *)%p) msgid %llu\n", $cnt, $rkm, $msgid
if $exp_msgid != 0 && $exp_msgid != $msgid
printf " ^ WARNING: expected msgid %llu, not %llu\n", $exp_msgid, $msgid
end
set $exp_msgid = $msgid + 1
set $rkm = $rkm.rkm_link.tqe_next
set $cnt++
end
end

0 comments on commit 76e08df

Please sign in to comment.