]> git.proxmox.com Git - mirror_qemu.git/blame - scripts/qemu-gdb.py
rbd: Clean up qemu_rbd_create()'s detour through QemuOpts
[mirror_qemu.git] / scripts / qemu-gdb.py
CommitLineData
4daa187d
AK
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
30c38c90
PM
16# Usage:
17# At the (gdb) prompt, type "source scripts/qemu-gdb.py".
18# "help qemu" should then list the supported QEMU debug support commands.
4daa187d
AK
19
20import gdb
21
93b1b365 22import os, sys
4daa187d 23
93b1b365
PM
24# Annoyingly, gdb doesn't put the directory of scripts onto the
25# module search path. Do it manually.
26
27sys.path.append(os.path.dirname(__file__))
28
c900ef86 29from qemugdb import aio, mtree, coroutine
9eddd6a4 30
4daa187d
AK
31class QemuCommand(gdb.Command):
32 '''Prefix for QEMU debug support commands'''
33 def __init__(self):
34 gdb.Command.__init__(self, 'qemu', gdb.COMMAND_DATA,
35 gdb.COMPLETE_NONE, True)
36
4daa187d 37QemuCommand()
191590f0 38coroutine.CoroutineCommand()
93b1b365 39mtree.MtreeCommand()
c900ef86 40aio.HandlersCommand()
5e3c72d4 41
a201b0ff
PB
42coroutine.CoroutineSPFunction()
43coroutine.CoroutinePCFunction()
44
5e3c72d4
PM
45# Default to silently passing through SIGUSR1, because QEMU sends it
46# to itself a lot.
47gdb.execute('handle SIGUSR1 pass noprint nostop')