9ae3a8
From 6d5a6268d535d641147f16a5d0343beadaaab3d9 Mon Sep 17 00:00:00 2001
9ae3a8
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>
9ae3a8
Date: Wed, 13 Dec 2017 13:39:11 +0100
9ae3a8
Subject: [PATCH 40/41] dump-guest-memory.py: fix No symbol "vmcoreinfo_find"
9ae3a8
MIME-Version: 1.0
9ae3a8
Content-Type: text/plain; charset=UTF-8
9ae3a8
Content-Transfer-Encoding: 8bit
9ae3a8
9ae3a8
RH-Author: Marc-André Lureau <marcandre.lureau@redhat.com>
9ae3a8
Message-id: <20171213133912.26176-41-marcandre.lureau@redhat.com>
9ae3a8
Patchwork-id: 78390
9ae3a8
O-Subject: [RHEL-7.5 qemu-kvm PATCH v3 40/41] dump-guest-memory.py: fix No symbol "vmcoreinfo_find"
9ae3a8
Bugzilla: 1411490
9ae3a8
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
9ae3a8
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
9ae3a8
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
9ae3a8
When qemu is compiled without debug, the dump gdb python script can fail with:
9ae3a8
9ae3a8
Error occurred in Python command: No symbol "vmcoreinfo_find" in current context.
9ae3a8
9ae3a8
Because vmcoreinfo_find() is inlined and not exported.
9ae3a8
9ae3a8
Use the underlying object_resolve_path_type() to get the instance instead.
9ae3a8
9ae3a8
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
9ae3a8
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
9ae3a8
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
9ae3a8
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9ae3a8
9ae3a8
(cherry picked from commit d36d0a9d152316a41e02c2613a71f5859f407da1)
9ae3a8
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 scripts/dump-guest-memory.py | 12 +++++++-----
9ae3a8
 1 file changed, 7 insertions(+), 5 deletions(-)
9ae3a8
9ae3a8
diff --git a/scripts/dump-guest-memory.py b/scripts/dump-guest-memory.py
9ae3a8
index 471aa73..12b9b7d 100644
9ae3a8
--- a/scripts/dump-guest-memory.py
9ae3a8
+++ b/scripts/dump-guest-memory.py
9ae3a8
@@ -546,13 +546,15 @@ shape and this command should mostly work."""
9ae3a8
         return None
9ae3a8
 
9ae3a8
     def add_vmcoreinfo(self):
9ae3a8
-        if not gdb.parse_and_eval("vmcoreinfo_find()") \
9ae3a8
-           or not gdb.parse_and_eval("vmcoreinfo_find()->has_vmcoreinfo"):
9ae3a8
+        vmci = '(VMCoreInfoState *)' + \
9ae3a8
+               'object_resolve_path_type("", "vmcoreinfo", 0)'
9ae3a8
+        if not gdb.parse_and_eval("%s" % vmci) \
9ae3a8
+           or not gdb.parse_and_eval("(%s)->has_vmcoreinfo" % vmci):
9ae3a8
             return
9ae3a8
 
9ae3a8
-        fmt = gdb.parse_and_eval("vmcoreinfo_find()->vmcoreinfo.guest_format")
9ae3a8
-        addr = gdb.parse_and_eval("vmcoreinfo_find()->vmcoreinfo.paddr")
9ae3a8
-        size = gdb.parse_and_eval("vmcoreinfo_find()->vmcoreinfo.size")
9ae3a8
+        fmt = gdb.parse_and_eval("(%s)->vmcoreinfo.guest_format" % vmci)
9ae3a8
+        addr = gdb.parse_and_eval("(%s)->vmcoreinfo.paddr" % vmci)
9ae3a8
+        size = gdb.parse_and_eval("(%s)->vmcoreinfo.size" % vmci)
9ae3a8
 
9ae3a8
         fmt = le16_to_cpu(fmt)
9ae3a8
         addr = le64_to_cpu(addr)
9ae3a8
-- 
9ae3a8
1.8.3.1
9ae3a8