* [Qemu-devel] [PATCH v2 1/4] scripts/qemu-gdb: Split MtreeCommand into its own module
2015-08-14 17:46 [Qemu-devel] [PATCH v2 0/4] scripts/qemu-gdb: Split into modules Peter Maydell
@ 2015-08-14 17:46 ` Peter Maydell
2015-08-14 17:46 ` [Qemu-devel] [PATCH v2 2/4] scripts/qemu-gdb: Split CoroutineCommand into its own file Peter Maydell
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Peter Maydell @ 2015-08-14 17:46 UTC (permalink / raw)
To: qemu-devel
Cc: Jan Kiszka, Markus Armbruster, Dr. David Alan Gilbert,
Stefan Hajnoczi, patches
As we add more commands to our Python gdb debugging support, it's
going to get unwieldy to have everything in a single file. Split
the implementation of the 'mtree' command from qemu-gdb.py into
its own module.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
---
scripts/qemu-gdb.py | 70 +++++---------------------------------
scripts/qemugdb/__init__.py | 28 ++++++++++++++++
scripts/qemugdb/mtree.py | 82 +++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 118 insertions(+), 62 deletions(-)
create mode 100644 scripts/qemugdb/__init__.py
create mode 100644 scripts/qemugdb/mtree.py
diff --git a/scripts/qemu-gdb.py b/scripts/qemu-gdb.py
index 6c7f4fb..7b072ad 100644
--- a/scripts/qemu-gdb.py
+++ b/scripts/qemu-gdb.py
@@ -16,11 +16,14 @@
import gdb
-def isnull(ptr):
- return ptr == gdb.Value(0).cast(ptr.type)
+import os, sys
-def int128(p):
- return long(p['lo']) + (long(p['hi']) << 64)
+# 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 mtree
def get_fs_base():
'''Fetch %fs base value using arch_prctl(ARCH_GET_FS)'''
@@ -102,63 +105,6 @@ class CoroutineCommand(gdb.Command):
coroutine_pointer = gdb.parse_and_eval(argv[0]).cast(gdb.lookup_type('CoroutineUContext').pointer())
bt_jmpbuf(coroutine_pointer['env']['__jmpbuf'])
-class MtreeCommand(gdb.Command):
- '''Display the memory tree hierarchy'''
- def __init__(self):
- gdb.Command.__init__(self, 'qemu mtree', gdb.COMMAND_DATA,
- gdb.COMPLETE_NONE)
- self.queue = []
- def invoke(self, arg, from_tty):
- self.seen = set()
- self.queue_root('address_space_memory')
- self.queue_root('address_space_io')
- self.process_queue()
- def queue_root(self, varname):
- ptr = gdb.parse_and_eval(varname)['root']
- self.queue.append(ptr)
- def process_queue(self):
- while self.queue:
- ptr = self.queue.pop(0)
- if long(ptr) in self.seen:
- continue
- self.print_item(ptr)
- def print_item(self, ptr, offset = gdb.Value(0), level = 0):
- self.seen.add(long(ptr))
- addr = ptr['addr']
- addr += offset
- size = int128(ptr['size'])
- alias = ptr['alias']
- klass = ''
- if not isnull(alias):
- klass = ' (alias)'
- elif not isnull(ptr['ops']):
- klass = ' (I/O)'
- elif bool(ptr['ram']):
- klass = ' (RAM)'
- gdb.write('%s%016x-%016x %s%s (@ %s)\n'
- % (' ' * level,
- long(addr),
- long(addr + (size - 1)),
- ptr['name'].string(),
- klass,
- ptr,
- ),
- gdb.STDOUT)
- if not isnull(alias):
- gdb.write('%s alias: %s@%016x (@ %s)\n' %
- (' ' * level,
- alias['name'].string(),
- ptr['alias_offset'],
- alias,
- ),
- gdb.STDOUT)
- self.queue.append(alias)
- subregion = ptr['subregions']['tqh_first']
- level += 1
- while not isnull(subregion):
- self.print_item(subregion, addr, level)
- subregion = subregion['subregions_link']['tqe_next']
-
QemuCommand()
CoroutineCommand()
-MtreeCommand()
+mtree.MtreeCommand()
diff --git a/scripts/qemugdb/__init__.py b/scripts/qemugdb/__init__.py
new file mode 100644
index 0000000..969f552
--- /dev/null
+++ b/scripts/qemugdb/__init__.py
@@ -0,0 +1,28 @@
+#!/usr/bin/python
+
+# GDB debugging support
+#
+# Copyright (c) 2015 Linaro Ltd
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see
+# <http://www.gnu.org/licenses/gpl-2.0.html>
+#
+
+# We don't need to do anything in our init file currently.
+
+"""
+Support routines for debugging QEMU under GDB
+"""
+
+__license__ = "GPL version 2 or (at your option) any later version"
diff --git a/scripts/qemugdb/mtree.py b/scripts/qemugdb/mtree.py
new file mode 100644
index 0000000..06011c3
--- /dev/null
+++ b/scripts/qemugdb/mtree.py
@@ -0,0 +1,82 @@
+#!/usr/bin/python
+
+# 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. See
+# the COPYING file in the top-level directory.
+#
+# Contributions after 2012-01-13 are licensed under the terms of the
+# GNU GPL, version 2 or (at your option) any later version.
+
+# 'qemu mtree' -- display the memory hierarchy
+
+import gdb
+
+def isnull(ptr):
+ return ptr == gdb.Value(0).cast(ptr.type)
+
+def int128(p):
+ return long(p['lo']) + (long(p['hi']) << 64)
+
+class MtreeCommand(gdb.Command):
+ '''Display the memory tree hierarchy'''
+ def __init__(self):
+ gdb.Command.__init__(self, 'qemu mtree', gdb.COMMAND_DATA,
+ gdb.COMPLETE_NONE)
+ self.queue = []
+ def invoke(self, arg, from_tty):
+ self.seen = set()
+ self.queue_root('address_space_memory')
+ self.queue_root('address_space_io')
+ self.process_queue()
+ def queue_root(self, varname):
+ ptr = gdb.parse_and_eval(varname)['root']
+ self.queue.append(ptr)
+ def process_queue(self):
+ while self.queue:
+ ptr = self.queue.pop(0)
+ if long(ptr) in self.seen:
+ continue
+ self.print_item(ptr)
+ def print_item(self, ptr, offset = gdb.Value(0), level = 0):
+ self.seen.add(long(ptr))
+ addr = ptr['addr']
+ addr += offset
+ size = int128(ptr['size'])
+ alias = ptr['alias']
+ klass = ''
+ if not isnull(alias):
+ klass = ' (alias)'
+ elif not isnull(ptr['ops']):
+ klass = ' (I/O)'
+ elif bool(ptr['ram']):
+ klass = ' (RAM)'
+ gdb.write('%s%016x-%016x %s%s (@ %s)\n'
+ % (' ' * level,
+ long(addr),
+ long(addr + (size - 1)),
+ ptr['name'].string(),
+ klass,
+ ptr,
+ ),
+ gdb.STDOUT)
+ if not isnull(alias):
+ gdb.write('%s alias: %s@%016x (@ %s)\n' %
+ (' ' * level,
+ alias['name'].string(),
+ ptr['alias_offset'],
+ alias,
+ ),
+ gdb.STDOUT)
+ self.queue.append(alias)
+ subregion = ptr['subregions']['tqh_first']
+ level += 1
+ while not isnull(subregion):
+ self.print_item(subregion, addr, level)
+ subregion = subregion['subregions_link']['tqe_next']
+
--
1.9.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Qemu-devel] [PATCH v2 2/4] scripts/qemu-gdb: Split CoroutineCommand into its own file
2015-08-14 17:46 [Qemu-devel] [PATCH v2 0/4] scripts/qemu-gdb: Split into modules Peter Maydell
2015-08-14 17:46 ` [Qemu-devel] [PATCH v2 1/4] scripts/qemu-gdb: Split MtreeCommand into its own module Peter Maydell
@ 2015-08-14 17:46 ` Peter Maydell
2015-08-14 17:46 ` [Qemu-devel] [PATCH v2 3/4] scripts/qemu-gdb: Silently pass through SIGUSR1 Peter Maydell
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Peter Maydell @ 2015-08-14 17:46 UTC (permalink / raw)
To: qemu-devel
Cc: Jan Kiszka, Markus Armbruster, Dr. David Alan Gilbert,
Stefan Hajnoczi, patches
Split the implementation of CoroutineCommand into its own file.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
---
scripts/qemu-gdb.py | 78 +------------------------------------
scripts/qemugdb/coroutine.py | 91 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 93 insertions(+), 76 deletions(-)
create mode 100644 scripts/qemugdb/coroutine.py
diff --git a/scripts/qemu-gdb.py b/scripts/qemu-gdb.py
index 7b072ad..1c94b2a 100644
--- a/scripts/qemu-gdb.py
+++ b/scripts/qemu-gdb.py
@@ -23,66 +23,7 @@ import os, sys
sys.path.append(os.path.dirname(__file__))
-from qemugdb import mtree
-
-def get_fs_base():
- '''Fetch %fs base value using arch_prctl(ARCH_GET_FS)'''
- # %rsp - 120 is scratch space according to the SystemV ABI
- old = gdb.parse_and_eval('*(uint64_t*)($rsp - 120)')
- gdb.execute('call arch_prctl(0x1003, $rsp - 120)', False, True)
- fs_base = gdb.parse_and_eval('*(uint64_t*)($rsp - 120)')
- gdb.execute('set *(uint64_t*)($rsp - 120) = %s' % old, False, True)
- return fs_base
-
-def get_glibc_pointer_guard():
- '''Fetch glibc pointer guard value'''
- fs_base = get_fs_base()
- return gdb.parse_and_eval('*(uint64_t*)((uint64_t)%s + 0x30)' % fs_base)
-
-def glibc_ptr_demangle(val, pointer_guard):
- '''Undo effect of glibc's PTR_MANGLE()'''
- return gdb.parse_and_eval('(((uint64_t)%s >> 0x11) | ((uint64_t)%s << (64 - 0x11))) ^ (uint64_t)%s' % (val, val, pointer_guard))
-
-def bt_jmpbuf(jmpbuf):
- '''Backtrace a jmpbuf'''
- JB_RBX = 0
- JB_RBP = 1
- JB_R12 = 2
- JB_R13 = 3
- JB_R14 = 4
- JB_R15 = 5
- JB_RSP = 6
- JB_PC = 7
-
- old_rbx = gdb.parse_and_eval('(uint64_t)$rbx')
- old_rbp = gdb.parse_and_eval('(uint64_t)$rbp')
- old_rsp = gdb.parse_and_eval('(uint64_t)$rsp')
- old_r12 = gdb.parse_and_eval('(uint64_t)$r12')
- old_r13 = gdb.parse_and_eval('(uint64_t)$r13')
- old_r14 = gdb.parse_and_eval('(uint64_t)$r14')
- old_r15 = gdb.parse_and_eval('(uint64_t)$r15')
- old_rip = gdb.parse_and_eval('(uint64_t)$rip')
-
- pointer_guard = get_glibc_pointer_guard()
- gdb.execute('set $rbx = %s' % jmpbuf[JB_RBX])
- gdb.execute('set $rbp = %s' % glibc_ptr_demangle(jmpbuf[JB_RBP], pointer_guard))
- gdb.execute('set $rsp = %s' % glibc_ptr_demangle(jmpbuf[JB_RSP], pointer_guard))
- gdb.execute('set $r12 = %s' % jmpbuf[JB_R12])
- gdb.execute('set $r13 = %s' % jmpbuf[JB_R13])
- gdb.execute('set $r14 = %s' % jmpbuf[JB_R14])
- gdb.execute('set $r15 = %s' % jmpbuf[JB_R15])
- gdb.execute('set $rip = %s' % glibc_ptr_demangle(jmpbuf[JB_PC], pointer_guard))
-
- gdb.execute('bt')
-
- gdb.execute('set $rbx = %s' % old_rbx)
- gdb.execute('set $rbp = %s' % old_rbp)
- gdb.execute('set $rsp = %s' % old_rsp)
- gdb.execute('set $r12 = %s' % old_r12)
- gdb.execute('set $r13 = %s' % old_r13)
- gdb.execute('set $r14 = %s' % old_r14)
- gdb.execute('set $r15 = %s' % old_r15)
- gdb.execute('set $rip = %s' % old_rip)
+from qemugdb import mtree, coroutine
class QemuCommand(gdb.Command):
'''Prefix for QEMU debug support commands'''
@@ -90,21 +31,6 @@ class QemuCommand(gdb.Command):
gdb.Command.__init__(self, 'qemu', gdb.COMMAND_DATA,
gdb.COMPLETE_NONE, True)
-class CoroutineCommand(gdb.Command):
- '''Display coroutine backtrace'''
- def __init__(self):
- gdb.Command.__init__(self, 'qemu coroutine', gdb.COMMAND_DATA,
- gdb.COMPLETE_NONE)
-
- def invoke(self, arg, from_tty):
- argv = gdb.string_to_argv(arg)
- if len(argv) != 1:
- gdb.write('usage: qemu coroutine <coroutine-pointer>\n')
- return
-
- coroutine_pointer = gdb.parse_and_eval(argv[0]).cast(gdb.lookup_type('CoroutineUContext').pointer())
- bt_jmpbuf(coroutine_pointer['env']['__jmpbuf'])
-
QemuCommand()
-CoroutineCommand()
+coroutine.CoroutineCommand()
mtree.MtreeCommand()
diff --git a/scripts/qemugdb/coroutine.py b/scripts/qemugdb/coroutine.py
new file mode 100644
index 0000000..3c54918
--- /dev/null
+++ b/scripts/qemugdb/coroutine.py
@@ -0,0 +1,91 @@
+#!/usr/bin/python
+
+# 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. See
+# the COPYING file in the top-level directory.
+#
+# Contributions after 2012-01-13 are licensed under the terms of the
+# GNU GPL, version 2 or (at your option) any later version.
+
+import gdb
+
+def get_fs_base():
+ '''Fetch %fs base value using arch_prctl(ARCH_GET_FS)'''
+ # %rsp - 120 is scratch space according to the SystemV ABI
+ old = gdb.parse_and_eval('*(uint64_t*)($rsp - 120)')
+ gdb.execute('call arch_prctl(0x1003, $rsp - 120)', False, True)
+ fs_base = gdb.parse_and_eval('*(uint64_t*)($rsp - 120)')
+ gdb.execute('set *(uint64_t*)($rsp - 120) = %s' % old, False, True)
+ return fs_base
+
+def get_glibc_pointer_guard():
+ '''Fetch glibc pointer guard value'''
+ fs_base = get_fs_base()
+ return gdb.parse_and_eval('*(uint64_t*)((uint64_t)%s + 0x30)' % fs_base)
+
+def glibc_ptr_demangle(val, pointer_guard):
+ '''Undo effect of glibc's PTR_MANGLE()'''
+ return gdb.parse_and_eval('(((uint64_t)%s >> 0x11) | ((uint64_t)%s << (64 - 0x11))) ^ (uint64_t)%s' % (val, val, pointer_guard))
+
+def bt_jmpbuf(jmpbuf):
+ '''Backtrace a jmpbuf'''
+ JB_RBX = 0
+ JB_RBP = 1
+ JB_R12 = 2
+ JB_R13 = 3
+ JB_R14 = 4
+ JB_R15 = 5
+ JB_RSP = 6
+ JB_PC = 7
+
+ old_rbx = gdb.parse_and_eval('(uint64_t)$rbx')
+ old_rbp = gdb.parse_and_eval('(uint64_t)$rbp')
+ old_rsp = gdb.parse_and_eval('(uint64_t)$rsp')
+ old_r12 = gdb.parse_and_eval('(uint64_t)$r12')
+ old_r13 = gdb.parse_and_eval('(uint64_t)$r13')
+ old_r14 = gdb.parse_and_eval('(uint64_t)$r14')
+ old_r15 = gdb.parse_and_eval('(uint64_t)$r15')
+ old_rip = gdb.parse_and_eval('(uint64_t)$rip')
+
+ pointer_guard = get_glibc_pointer_guard()
+ gdb.execute('set $rbx = %s' % jmpbuf[JB_RBX])
+ gdb.execute('set $rbp = %s' % glibc_ptr_demangle(jmpbuf[JB_RBP], pointer_guard))
+ gdb.execute('set $rsp = %s' % glibc_ptr_demangle(jmpbuf[JB_RSP], pointer_guard))
+ gdb.execute('set $r12 = %s' % jmpbuf[JB_R12])
+ gdb.execute('set $r13 = %s' % jmpbuf[JB_R13])
+ gdb.execute('set $r14 = %s' % jmpbuf[JB_R14])
+ gdb.execute('set $r15 = %s' % jmpbuf[JB_R15])
+ gdb.execute('set $rip = %s' % glibc_ptr_demangle(jmpbuf[JB_PC], pointer_guard))
+
+ gdb.execute('bt')
+
+ gdb.execute('set $rbx = %s' % old_rbx)
+ gdb.execute('set $rbp = %s' % old_rbp)
+ gdb.execute('set $rsp = %s' % old_rsp)
+ gdb.execute('set $r12 = %s' % old_r12)
+ gdb.execute('set $r13 = %s' % old_r13)
+ gdb.execute('set $r14 = %s' % old_r14)
+ gdb.execute('set $r15 = %s' % old_r15)
+ gdb.execute('set $rip = %s' % old_rip)
+
+
+class CoroutineCommand(gdb.Command):
+ '''Display coroutine backtrace'''
+ def __init__(self):
+ gdb.Command.__init__(self, 'qemu coroutine', gdb.COMMAND_DATA,
+ gdb.COMPLETE_NONE)
+
+ def invoke(self, arg, from_tty):
+ argv = gdb.string_to_argv(arg)
+ if len(argv) != 1:
+ gdb.write('usage: qemu coroutine <coroutine-pointer>\n')
+ return
+
+ coroutine_pointer = gdb.parse_and_eval(argv[0]).cast(gdb.lookup_type('CoroutineUContext').pointer())
+ bt_jmpbuf(coroutine_pointer['env']['__jmpbuf'])
--
1.9.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Qemu-devel] [PATCH v2 3/4] scripts/qemu-gdb: Silently pass through SIGUSR1
2015-08-14 17:46 [Qemu-devel] [PATCH v2 0/4] scripts/qemu-gdb: Split into modules Peter Maydell
2015-08-14 17:46 ` [Qemu-devel] [PATCH v2 1/4] scripts/qemu-gdb: Split MtreeCommand into its own module Peter Maydell
2015-08-14 17:46 ` [Qemu-devel] [PATCH v2 2/4] scripts/qemu-gdb: Split CoroutineCommand into its own file Peter Maydell
@ 2015-08-14 17:46 ` Peter Maydell
2015-08-14 17:46 ` [Qemu-devel] [PATCH v2 4/4] scripts/qemu-gdb: Add brief comment describing usage Peter Maydell
2015-09-02 14:05 ` [Qemu-devel] [PATCH v2 0/4] scripts/qemu-gdb: Split into modules Stefan Hajnoczi
4 siblings, 0 replies; 7+ messages in thread
From: Peter Maydell @ 2015-08-14 17:46 UTC (permalink / raw)
To: qemu-devel
Cc: Jan Kiszka, Markus Armbruster, Dr. David Alan Gilbert,
Stefan Hajnoczi, patches
SIGUSR1 is QEMU's IPI signal, and it gets sent a lot, so is
best silently passed through to the guest without stopping.
Make qemu-gdb.py do this bit of configuration for the user.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
scripts/qemu-gdb.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/scripts/qemu-gdb.py b/scripts/qemu-gdb.py
index 1c94b2a..f98cd21 100644
--- a/scripts/qemu-gdb.py
+++ b/scripts/qemu-gdb.py
@@ -34,3 +34,7 @@ class QemuCommand(gdb.Command):
QemuCommand()
coroutine.CoroutineCommand()
mtree.MtreeCommand()
+
+# Default to silently passing through SIGUSR1, because QEMU sends it
+# to itself a lot.
+gdb.execute('handle SIGUSR1 pass noprint nostop')
--
1.9.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Qemu-devel] [PATCH v2 4/4] scripts/qemu-gdb: Add brief comment describing usage
2015-08-14 17:46 [Qemu-devel] [PATCH v2 0/4] scripts/qemu-gdb: Split into modules Peter Maydell
` (2 preceding siblings ...)
2015-08-14 17:46 ` [Qemu-devel] [PATCH v2 3/4] scripts/qemu-gdb: Silently pass through SIGUSR1 Peter Maydell
@ 2015-08-14 17:46 ` Peter Maydell
2015-09-02 14:05 ` [Qemu-devel] [PATCH v2 0/4] scripts/qemu-gdb: Split into modules Stefan Hajnoczi
4 siblings, 0 replies; 7+ messages in thread
From: Peter Maydell @ 2015-08-14 17:46 UTC (permalink / raw)
To: qemu-devel
Cc: Jan Kiszka, Markus Armbruster, Dr. David Alan Gilbert,
Stefan Hajnoczi, patches
Add a brief comment describing how to use the debug support
from GDB.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
scripts/qemu-gdb.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/scripts/qemu-gdb.py b/scripts/qemu-gdb.py
index f98cd21..d6f2e5a 100644
--- a/scripts/qemu-gdb.py
+++ b/scripts/qemu-gdb.py
@@ -13,6 +13,9 @@
# Contributions after 2012-01-13 are licensed under the terms of the
# GNU GPL, version 2 or (at your option) any later version.
+# Usage:
+# At the (gdb) prompt, type "source scripts/qemu-gdb.py".
+# "help qemu" should then list the supported QEMU debug support commands.
import gdb
--
1.9.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH v2 0/4] scripts/qemu-gdb: Split into modules
2015-08-14 17:46 [Qemu-devel] [PATCH v2 0/4] scripts/qemu-gdb: Split into modules Peter Maydell
` (3 preceding siblings ...)
2015-08-14 17:46 ` [Qemu-devel] [PATCH v2 4/4] scripts/qemu-gdb: Add brief comment describing usage Peter Maydell
@ 2015-09-02 14:05 ` Stefan Hajnoczi
2015-09-11 17:01 ` Peter Maydell
4 siblings, 1 reply; 7+ messages in thread
From: Stefan Hajnoczi @ 2015-09-02 14:05 UTC (permalink / raw)
To: Peter Maydell
Cc: Jan Kiszka, Markus Armbruster, qemu-devel, Dr. David Alan Gilbert,
patches
On Fri, Aug 14, 2015 at 06:46:28PM +0100, Peter Maydell wrote:
> This patch series splits scripts/qemu-gdb into separate
> files for each command, to make it easier to add new
> commands in future without them all going into a single
> huge file.
>
> Patches 1 and 2 do that split, and have been on the list
> before (and reviewed by Stefan).
>
> Patch 3 makes the script tell gdb not to stop on SIGUSR1,
> since that's our SIGIPI and happens all the time.
>
> Patch 4 adds a brief comment explaining how to source the
> script. NB that I haven't attempted to make the script
> work with automatic-sourcing based on the executable
> being debugged. Somebody who uses the script that way
> can do that :-)
>
> I've dropped the script which added support for setting
> breakpoints on QEMU tracepoints for the moment (pending
> investigating static probe point support which might
> render it unnecessary). Mostly I'd like to get these
> into master so that future debug commands can go into
> the right place -- IIRC David Gilbert had a patchset
> which added another command.
>
> thanks
> -- PMM
>
> Peter Maydell (4):
> scripts/qemu-gdb: Split MtreeCommand into its own module
> scripts/qemu-gdb: Split CoroutineCommand into its own file
> scripts/qemu-gdb: Silently pass through SIGUSR1
> scripts/qemu-gdb: Add brief comment describing usage
>
> scripts/qemu-gdb.py | 146 ++++---------------------------------------
> scripts/qemugdb/__init__.py | 28 +++++++++
> scripts/qemugdb/coroutine.py | 91 +++++++++++++++++++++++++++
> scripts/qemugdb/mtree.py | 82 ++++++++++++++++++++++++
> 4 files changed, 212 insertions(+), 135 deletions(-)
> create mode 100644 scripts/qemugdb/__init__.py
> create mode 100644 scripts/qemugdb/coroutine.py
> create mode 100644 scripts/qemugdb/mtree.py
>
> --
> 1.9.1
>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH v2 0/4] scripts/qemu-gdb: Split into modules
2015-09-02 14:05 ` [Qemu-devel] [PATCH v2 0/4] scripts/qemu-gdb: Split into modules Stefan Hajnoczi
@ 2015-09-11 17:01 ` Peter Maydell
0 siblings, 0 replies; 7+ messages in thread
From: Peter Maydell @ 2015-09-11 17:01 UTC (permalink / raw)
To: Stefan Hajnoczi
Cc: Jan Kiszka, Markus Armbruster, QEMU Developers,
Dr. David Alan Gilbert, Patch Tracking
On 2 September 2015 at 15:05, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> On Fri, Aug 14, 2015 at 06:46:28PM +0100, Peter Maydell wrote:
>> This patch series splits scripts/qemu-gdb into separate
>> files for each command, to make it easier to add new
>> commands in future without them all going into a single
>> huge file.
>>
>> Patches 1 and 2 do that split, and have been on the list
>> before (and reviewed by Stefan).
>>
>> Patch 3 makes the script tell gdb not to stop on SIGUSR1,
>> since that's our SIGIPI and happens all the time.
>>
>> Patch 4 adds a brief comment explaining how to source the
>> script. NB that I haven't attempted to make the script
>> work with automatic-sourcing based on the executable
>> being debugged. Somebody who uses the script that way
>> can do that :-)
>>
>> I've dropped the script which added support for setting
>> breakpoints on QEMU tracepoints for the moment (pending
>> investigating static probe point support which might
>> render it unnecessary). Mostly I'd like to get these
>> into master so that future debug commands can go into
>> the right place -- IIRC David Gilbert had a patchset
>> which added another command.
>>
>> thanks
>> -- PMM
>>
>> Peter Maydell (4):
>> scripts/qemu-gdb: Split MtreeCommand into its own module
>> scripts/qemu-gdb: Split CoroutineCommand into its own file
>> scripts/qemu-gdb: Silently pass through SIGUSR1
>> scripts/qemu-gdb: Add brief comment describing usage
>>
>> scripts/qemu-gdb.py | 146 ++++---------------------------------------
>> scripts/qemugdb/__init__.py | 28 +++++++++
>> scripts/qemugdb/coroutine.py | 91 +++++++++++++++++++++++++++
>> scripts/qemugdb/mtree.py | 82 ++++++++++++++++++++++++
>> 4 files changed, 212 insertions(+), 135 deletions(-)
>> create mode 100644 scripts/qemugdb/__init__.py
>> create mode 100644 scripts/qemugdb/coroutine.py
>> create mode 100644 scripts/qemugdb/mtree.py
>>
>> --
>> 1.9.1
>>
>
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Applied, thanks.
-- PMM
^ permalink raw reply [flat|nested] 7+ messages in thread