Avi Kivity | 4daa187 | 2012-03-18 16:48:44 +0200 | [diff] [blame] | 1 | #!/usr/bin/python |
| 2 | |
| 3 | # GDB debugging support |
| 4 | # |
| 5 | # Copyright 2012 Red Hat, Inc. and/or its affiliates |
| 6 | # |
| 7 | # Authors: |
| 8 | # Avi Kivity <avi@redhat.com> |
| 9 | # |
| 10 | # This work is licensed under the terms of the GNU GPL, version 2. See |
| 11 | # the COPYING file in the top-level directory. |
| 12 | # |
| 13 | # Contributions after 2012-01-13 are licensed under the terms of the |
| 14 | # GNU GPL, version 2 or (at your option) any later version. |
| 15 | |
| 16 | |
| 17 | import gdb |
| 18 | |
Peter Maydell | 93b1b36 | 2015-08-14 18:46:29 +0100 | [diff] [blame] | 19 | import os, sys |
Avi Kivity | 4daa187 | 2012-03-18 16:48:44 +0200 | [diff] [blame] | 20 | |
Peter Maydell | 93b1b36 | 2015-08-14 18:46:29 +0100 | [diff] [blame] | 21 | # Annoyingly, gdb doesn't put the directory of scripts onto the |
| 22 | # module search path. Do it manually. |
| 23 | |
| 24 | sys.path.append(os.path.dirname(__file__)) |
| 25 | |
Peter Maydell | 191590f | 2015-08-14 18:46:30 +0100 | [diff] [blame^] | 26 | from qemugdb import mtree, coroutine |
Stefan Hajnoczi | 9eddd6a | 2015-03-26 22:42:34 +0000 | [diff] [blame] | 27 | |
Avi Kivity | 4daa187 | 2012-03-18 16:48:44 +0200 | [diff] [blame] | 28 | class QemuCommand(gdb.Command): |
| 29 | '''Prefix for QEMU debug support commands''' |
| 30 | def __init__(self): |
| 31 | gdb.Command.__init__(self, 'qemu', gdb.COMMAND_DATA, |
| 32 | gdb.COMPLETE_NONE, True) |
| 33 | |
Avi Kivity | 4daa187 | 2012-03-18 16:48:44 +0200 | [diff] [blame] | 34 | QemuCommand() |
Peter Maydell | 191590f | 2015-08-14 18:46:30 +0100 | [diff] [blame^] | 35 | coroutine.CoroutineCommand() |
Peter Maydell | 93b1b36 | 2015-08-14 18:46:29 +0100 | [diff] [blame] | 36 | mtree.MtreeCommand() |