diff options
author | Daniel Baumann <mail@daniel-baumann.ch> | 2025-06-06 10:05:23 +0000 |
---|---|---|
committer | Daniel Baumann <mail@daniel-baumann.ch> | 2025-06-06 10:05:23 +0000 |
commit | 755cc582a2473d06f3a2131d506d0311cc70e9f9 (patch) | |
tree | 3efb1ddb8d57bbb4539ac0d229b384871c57820f /scripts/qemu-gdb.py | |
parent | Initial commit. (diff) | |
download | qemu-upstream.tar.xz qemu-upstream.zip |
Adding upstream version 1:7.2+dfsg.upstream/1%7.2+dfsgupstream
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'scripts/qemu-gdb.py')
-rw-r--r-- | scripts/qemu-gdb.py | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/scripts/qemu-gdb.py b/scripts/qemu-gdb.py new file mode 100644 index 00000000..4d2a9f6c --- /dev/null +++ b/scripts/qemu-gdb.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python3 +# +# GDB debugging support +# +# Copyright 2012 Red Hat, Inc. and/or its affiliates +# +# Authors: +# Avi Kivity <avi@redhat.com> +# +# This work is licensed under the terms of the GNU GPL, version 2 or +# later. See the COPYING file in the top-level directory. + +# Usage: +# At the (gdb) prompt, type "source scripts/qemu-gdb.py". +# "help qemu" should then list the supported QEMU debug support commands. + +import gdb + +import os, sys + +# Annoyingly, gdb doesn't put the directory of scripts onto the +# module search path. Do it manually. + +sys.path.append(os.path.dirname(__file__)) + +from qemugdb import aio, mtree, coroutine, tcg, timers + +class QemuCommand(gdb.Command): + '''Prefix for QEMU debug support commands''' + def __init__(self): + gdb.Command.__init__(self, 'qemu', gdb.COMMAND_DATA, + gdb.COMPLETE_NONE, True) + +QemuCommand() +coroutine.CoroutineCommand() +mtree.MtreeCommand() +aio.HandlersCommand() +tcg.TCGLockStatusCommand() +timers.TimersCommand() + +coroutine.CoroutineSPFunction() +coroutine.CoroutinePCFunction() +coroutine.CoroutineBt() + +# Default to silently passing through SIGUSR1, because QEMU sends it +# to itself a lot. +gdb.execute('handle SIGUSR1 pass noprint nostop') |