[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 24/25] dump-guest-memory.py: fix "You can't do that w
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 24/25] dump-guest-memory.py: fix "You can't do that without a process to debug" |
Date: |
Thu, 21 Dec 2017 16:31:04 +0200 |
From: Marc-André Lureau <address@hidden>
If the script is run with a core (no running process), it produces an
error:
(gdb) dump-guest-memory /tmp/vmcore X86_64
guest RAM blocks:
target_start target_end host_addr message count
---------------- ---------------- ---------------- ------- -----
0000000000000000 00000000000a0000 00007f7935800000 added 1
00000000000a0000 00000000000b0000 00007f7934200000 added 2
00000000000c0000 00000000000ca000 00007f79358c0000 added 3
00000000000ca000 00000000000cd000 00007f79358ca000 joined 3
00000000000cd000 00000000000e8000 00007f79358cd000 joined 3
00000000000e8000 00000000000f0000 00007f79358e8000 joined 3
00000000000f0000 0000000000100000 00007f79358f0000 joined 3
0000000000100000 0000000080000000 00007f7935900000 joined 3
00000000fd000000 00000000fe000000 00007f7934200000 added 4
00000000fffc0000 0000000100000000 00007f7935600000 added 5
Python Exception <class 'gdb.error'> You can't do that without a process to
debug.:
Error occurred in Python command: You can't do that without a process
to debug.
Replace the object_resolve_path_type() function call call with a
local volatile variable.
Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/misc/vmcoreinfo.c | 3 +++
scripts/dump-guest-memory.py | 3 +--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/hw/misc/vmcoreinfo.c b/hw/misc/vmcoreinfo.c
index 31db57a..a280552 100644
--- a/hw/misc/vmcoreinfo.c
+++ b/hw/misc/vmcoreinfo.c
@@ -35,6 +35,8 @@ static void vmcoreinfo_realize(DeviceState *dev, Error **errp)
{
VMCoreInfoState *s = VMCOREINFO(dev);
FWCfgState *fw_cfg = fw_cfg_find();
+ /* for gdb script dump-guest-memory.py */
+ static VMCoreInfoState * volatile vmcoreinfo_state G_GNUC_UNUSED;
/* Given that this function is executing, there is at least one VMCOREINFO
* device. Check if there are several.
@@ -56,6 +58,7 @@ static void vmcoreinfo_realize(DeviceState *dev, Error **errp)
&s->vmcoreinfo, sizeof(s->vmcoreinfo), false);
qemu_register_reset(vmcoreinfo_reset, dev);
+ vmcoreinfo_state = s;
}
static const VMStateDescription vmstate_vmcoreinfo = {
diff --git a/scripts/dump-guest-memory.py b/scripts/dump-guest-memory.py
index 1af26c1..09bec92 100644
--- a/scripts/dump-guest-memory.py
+++ b/scripts/dump-guest-memory.py
@@ -546,8 +546,7 @@ shape and this command should mostly work."""
return None
def add_vmcoreinfo(self):
- vmci = '(VMCoreInfoState *)' + \
- 'object_resolve_path_type("", "vmcoreinfo", 0)'
+ vmci = 'vmcoreinfo_realize::vmcoreinfo_state'
if not gdb.parse_and_eval("%s" % vmci) \
or not gdb.parse_and_eval("(%s)->has_vmcoreinfo" % vmci):
return
--
MST
- [Qemu-devel] [PULL 15/25] hw/block/nvme: QOM'ify PCI NVME, (continued)
- [Qemu-devel] [PULL 15/25] hw/block/nvme: QOM'ify PCI NVME, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 16/25] hw/pci-host/piix: QOM'ify the IGD Passthrough host bridge, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 17/25] hw/pci-host/xilinx: QOM'ify the AXI-PCIe host bridge, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 18/25] hw/pci: remove obsolete PCIDevice->init(), Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 19/25] vhost-user: fix indentation in protocol specification, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 20/25] vhost-user: document memory accesses, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 23/25] virtio-pci: Don't force Subsystem Vendor ID = Vendor ID, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 25/25] smbus: do not immediately complete commands, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 24/25] dump-guest-memory.py: fix "You can't do that without a process to debug",
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 21/25] intel_iommu: remove X86_IOMMU_PCI_DEVFN_MAX, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 22/25] intel_iommu: fix error param in string, Michael S. Tsirkin, 2017/12/21
- Re: [Qemu-devel] [PULL 00/25] pc, pci, virtio: features, fixes, cleanups, Peter Maydell, 2017/12/21
- Re: [Qemu-devel] [PULL 00/25] pc, pci, virtio: features, fixes, cleanups, Michael S. Tsirkin, 2017/12/21
- Re: [Qemu-devel] [PULL 00/25] pc, pci, virtio: features, fixes, cleanups, Peter Maydell, 2017/12/21
- Re: [Qemu-devel] [PULL 00/25] pc, pci, virtio: features, fixes, cleanups, Michael S. Tsirkin, 2017/12/21
- Re: [Qemu-devel] [PULL 00/25] pc, pci, virtio: features, fixes, cleanups, Philippe Mathieu-Daudé, 2017/12/21
- Re: [Qemu-devel] [PULL 00/25] pc, pci, virtio: features, fixes, cleanups, Philippe Mathieu-Daudé, 2017/12/21
- Re: [Qemu-devel] [PULL 00/25] pc, pci, virtio: features, fixes, cleanups, Michael S. Tsirkin, 2017/12/21