Skip to content

Instantly share code, notes, and snippets.

@ibigbug
Created August 16, 2017 02:02
Show Gist options
  • Save ibigbug/de987e6845cbb7cbf8be2fc0c46d66b1 to your computer and use it in GitHub Desktop.
Save ibigbug/de987e6845cbb7cbf8be2fc0c46d66b1 to your computer and use it in GitHub Desktop.
gdb python extension
import gdb
class HeapdumpCmd(gdb.Command):
"""Do a heap dump"""
def __init__(self):
gdb.Command.__init__(self, "mdump", gdb.COMMAND_STACK, gdb.COMPLETE_NONE)
def invoke(self, _arg, _from_tty):
v = gdb.parse_and_eval("'runtime.mbuckets'")
print(v.address.cast)
HeapdumpCmd()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment