[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 0/3] scripts/qemu-gdb: Add event tracing support
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH 0/3] scripts/qemu-gdb: Add event tracing support |
Date: |
Fri, 15 May 2015 14:18:16 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Peter Maydell <address@hidden> writes:
> On 15 May 2015 at 08:58, Markus Armbruster <address@hidden> wrote:
>> Since you're touching qemu-gdb.py anyway, could you stick in a brief
>> comment explaining how to put it to use?
>
> Good idea. It turns out the answer is just "source it from gdb",
> but it took me a little while to find that out, so worth commenting.
> I also have a patch which makes it do the 'ignore SIGUSR1' bit
> by doing 'handle SIGUSR1 pass noprint nostop' for you.
Here's how to load scripts/qemu-gdb.py automatically:
* Apply the appended patch to turn it into a gdb init file
That's what it is, after all. It's not a standalone Python program.
* Tell gdb to trust it
Add a line like
add-auto-load-safe-path ~/work/qemu/scripts/qemu-gdb.py
to your ~/.gdbinit
* Link it into the directory where you run gdb --args qemu...
* Verify it works:
$ gdb
[...]
(gdb) help qemu
Prefix for QEMU debug support commands
List of qemu subcommands:
qemu coroutine -- Display coroutine backtrace
qemu mtree -- Display the memory tree hierarchy
Type "help qemu" followed by qemu subcommand name for full documentation.
Type "apropos word" to search for commands related to "word".
Command name abbreviations are allowed if unambiguous.
(gdb)
If you know a better way to do this, please post it.
diff --git a/scripts/qemu-gdb.py b/scripts/qemu-gdb.py
index 6c7f4fb..ac3087c 100644
--- a/scripts/qemu-gdb.py
+++ b/scripts/qemu-gdb.py
@@ -1,5 +1,3 @@
-#!/usr/bin/python
-
# GDB debugging support
#
# Copyright 2012 Red Hat, Inc. and/or its affiliates
@@ -13,7 +11,7 @@
# Contributions after 2012-01-13 are licensed under the terms of the
# GNU GPL, version 2 or (at your option) any later version.
-
+python
import gdb
def isnull(ptr):
Re: [Qemu-devel] [PATCH 0/3] scripts/qemu-gdb: Add event tracing support, Stefan Hajnoczi, 2015/05/18
Re: [Qemu-devel] [PATCH 0/3] scripts/qemu-gdb: Add event tracing support, Stefan Hajnoczi, 2015/05/18