]> git.proxmox.com Git - mirror_qemu.git/blame - scripts/qemu-gdb.py
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
[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#
328eb60d
PB
10# This work is licensed under the terms of the GNU GPL, version 2 or
11# later. See the COPYING file in the top-level directory.
4daa187d 12
30c38c90
PM
13# Usage:
14# At the (gdb) prompt, type "source scripts/qemu-gdb.py".
15# "help qemu" should then list the supported QEMU debug support commands.
4daa187d
AK
16
17import gdb
18
93b1b365 19import os, sys
4daa187d 20
93b1b365
PM
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
c24999fa 26from qemugdb import aio, mtree, coroutine, tcg, timers
9eddd6a4 27
4daa187d
AK
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
4daa187d 34QemuCommand()
191590f0 35coroutine.CoroutineCommand()
93b1b365 36mtree.MtreeCommand()
c900ef86 37aio.HandlersCommand()
f1cd52d8 38tcg.TCGLockStatusCommand()
c24999fa 39timers.TimersCommand()
5e3c72d4 40
a201b0ff
PB
41coroutine.CoroutineSPFunction()
42coroutine.CoroutinePCFunction()
43
5e3c72d4
PM
44# Default to silently passing through SIGUSR1, because QEMU sends it
45# to itself a lot.
46gdb.execute('handle SIGUSR1 pass noprint nostop')