xref: /openbmc/qemu/scripts/qemu-gdb.py (revision 191590f0)
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
17import gdb
18
19import os, sys
20
21# Annoyingly, gdb doesn't put the directory of scripts onto the
22# module search path. Do it manually.
23
24sys.path.append(os.path.dirname(__file__))
25
26from qemugdb import mtree, coroutine
27
28class 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
34QemuCommand()
35coroutine.CoroutineCommand()
36mtree.MtreeCommand()
37