3 # GDB debugging support
5 # Copyright 2012 Red Hat, Inc. and/or its affiliates
8 # Avi Kivity <avi@redhat.com>
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.
14 # At the (gdb) prompt, type "source scripts/qemu-gdb.py".
15 # "help qemu" should then list the supported QEMU debug support commands.
21 # Annoyingly, gdb doesn't put the directory of scripts onto the
22 # module search path. Do it manually.
24 sys
.path
.append(os
.path
.dirname(__file__
))
26 from qemugdb
import aio
, mtree
, coroutine
, tcg
, timers
28 class QemuCommand(gdb
.Command
):
29 '''Prefix for QEMU debug support commands'''
31 gdb
.Command
.__init
__(self
, 'qemu', gdb
.COMMAND_DATA
,
32 gdb
.COMPLETE_NONE
, True)
35 coroutine
.CoroutineCommand()
38 tcg
.TCGLockStatusCommand()
39 timers
.TimersCommand()
41 coroutine
.CoroutineSPFunction()
42 coroutine
.CoroutinePCFunction()
44 # Default to silently passing through SIGUSR1, because QEMU sends it
46 gdb
.execute('handle SIGUSR1 pass noprint nostop')