]> git.proxmox.com Git - mirror_qemu.git/commitdiff
dump-guest-memory.py: fix No symbol "vmcoreinfo_find"
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Fri, 1 Dec 2017 11:37:44 +0000 (12:37 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 1 Dec 2017 17:05:58 +0000 (19:05 +0200)
When qemu is compiled without debug, the dump gdb python script can fail with:

Error occurred in Python command: No symbol "vmcoreinfo_find" in current context.

Because vmcoreinfo_find() is inlined and not exported.

Use the underlying object_resolve_path_type() to get the instance instead.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
scripts/dump-guest-memory.py

index 69dd5efadf9e3252ff14db3329d251fa4fcbe87c..1af26c1a45d69e2486791e2f76415ec73e07acdf 100644 (file)
@@ -546,13 +546,15 @@ shape and this command should mostly work."""
         return None
 
     def add_vmcoreinfo(self):
-        if not gdb.parse_and_eval("vmcoreinfo_find()") \
-           or not gdb.parse_and_eval("vmcoreinfo_find()->has_vmcoreinfo"):
+        vmci = '(VMCoreInfoState *)' + \
+               'object_resolve_path_type("", "vmcoreinfo", 0)'
+        if not gdb.parse_and_eval("%s" % vmci) \
+           or not gdb.parse_and_eval("(%s)->has_vmcoreinfo" % vmci):
             return
 
-        fmt = gdb.parse_and_eval("vmcoreinfo_find()->vmcoreinfo.guest_format")
-        addr = gdb.parse_and_eval("vmcoreinfo_find()->vmcoreinfo.paddr")
-        size = gdb.parse_and_eval("vmcoreinfo_find()->vmcoreinfo.size")
+        fmt = gdb.parse_and_eval("(%s)->vmcoreinfo.guest_format" % vmci)
+        addr = gdb.parse_and_eval("(%s)->vmcoreinfo.paddr" % vmci)
+        size = gdb.parse_and_eval("(%s)->vmcoreinfo.size" % vmci)
 
         fmt = le16_to_cpu(fmt)
         addr = le64_to_cpu(addr)