qemu-gdb.py 894 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/usr/bin/python
  2. # GDB debugging support
  3. #
  4. # Copyright 2012 Red Hat, Inc. and/or its affiliates
  5. #
  6. # Authors:
  7. # Avi Kivity <avi@redhat.com>
  8. #
  9. # This work is licensed under the terms of the GNU GPL, version 2. See
  10. # the COPYING file in the top-level directory.
  11. #
  12. # Contributions after 2012-01-13 are licensed under the terms of the
  13. # GNU GPL, version 2 or (at your option) any later version.
  14. import gdb
  15. import os, sys
  16. # Annoyingly, gdb doesn't put the directory of scripts onto the
  17. # module search path. Do it manually.
  18. sys.path.append(os.path.dirname(__file__))
  19. from qemugdb import mtree, coroutine
  20. class QemuCommand(gdb.Command):
  21. '''Prefix for QEMU debug support commands'''
  22. def __init__(self):
  23. gdb.Command.__init__(self, 'qemu', gdb.COMMAND_DATA,
  24. gdb.COMPLETE_NONE, True)
  25. QemuCommand()
  26. coroutine.CoroutineCommand()
  27. mtree.MtreeCommand()