Skip to content

Instantly share code, notes, and snippets.

@csfrancis
Created December 5, 2013 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save csfrancis/7808541 to your computer and use it in GitHub Desktop.
Save csfrancis/7808541 to your computer and use it in GitHub Desktop.
Python gdb to count number of entries in a memcached item linked list
c = 0
v = head = gdb.parse_and_eval('it')
while v.dereference() != None and c < 100:
if c > 0 and v == head:
break
c += 1
v = v.dereference()['h_next']
print c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment