[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 07/18] scripts/dump-guest-memory.py: fix int128_get64
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 07/18] scripts/dump-guest-memory.py: fix int128_get64 on recent gcc |
Date: |
Tue, 14 Mar 2017 17:18:09 +0100 |
From: Marc-André Lureau <address@hidden>
The Int128 is no longer a struct, reaching a python exception:
Python Exception <class 'gdb.error'> Attempt to extract a component of a value
that is not a (null).:
Replace struct access with a cast to uint64[] instead.
Fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=1427466
Signed-off-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
scripts/dump-guest-memory.py | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/scripts/dump-guest-memory.py b/scripts/dump-guest-memory.py
index 9956fc0..f7c6635 100644
--- a/scripts/dump-guest-memory.py
+++ b/scripts/dump-guest-memory.py
@@ -314,8 +314,18 @@ def get_arch_phdr(endianness, elfclass):
def int128_get64(val):
"""Returns low 64bit part of Int128 struct."""
- assert val["hi"] == 0
- return val["lo"]
+ try:
+ assert val["hi"] == 0
+ return val["lo"]
+ except gdb.error:
+ u64t = gdb.lookup_type('uint64_t').array(2)
+ u64 = val.cast(u64t)
+ if sys.byteorder == 'little':
+ assert u64[1] == 0
+ return u64[0]
+ else:
+ assert u64[0] == 0
+ return u64[1]
def qlist_foreach(head, field_str):
--
1.8.3.1
- [Qemu-devel] [PULL 00/18] Misc patches for QEMU 2.9 hard freeze, Paolo Bonzini, 2017/03/14
- [Qemu-devel] [PULL 02/18] docs: Add a note about mixing bootindex with "-boot order", Paolo Bonzini, 2017/03/14
- [Qemu-devel] [PULL 04/18] exec: add cpu_synchronize_state to cpu_memory_rw_debug, Paolo Bonzini, 2017/03/14
- [Qemu-devel] [PULL 05/18] kvm: Print MSR information if KVM_{GET, SET}_MSRS failed, Paolo Bonzini, 2017/03/14
- [Qemu-devel] [PULL 03/18] mem-prealloc: reduce large guest start-up and migration time., Paolo Bonzini, 2017/03/14
- [Qemu-devel] [PULL 06/18] kvmclock: Don't crash QEMU if KVM is disabled, Paolo Bonzini, 2017/03/14
- [Qemu-devel] [PULL 01/18] memory_region: Fix name comments, Paolo Bonzini, 2017/03/14
- [Qemu-devel] [PULL 08/18] configure: add the missing help output for optional features, Paolo Bonzini, 2017/03/14
- [Qemu-devel] [PULL 07/18] scripts/dump-guest-memory.py: fix int128_get64 on recent gcc,
Paolo Bonzini <=
- [Qemu-devel] [PULL 09/18] util: Removed unneeded header from path.c, Paolo Bonzini, 2017/03/14
- [Qemu-devel] [PULL 12/18] qemu-timer: fix off-by-one, Paolo Bonzini, 2017/03/14
- [Qemu-devel] [PULL 13/18] qemu-timer: do not include sysemu/cpus.h from util/qemu-timer.h, Paolo Bonzini, 2017/03/14
- [Qemu-devel] [PULL 14/18] cpus: define QEMUTimerListNotifyCB for QEMU system emulation, Paolo Bonzini, 2017/03/14
- [Qemu-devel] [PULL 16/18] icount: process QEMU_CLOCK_VIRTUAL timers in vCPU thread, Paolo Bonzini, 2017/03/14
- [Qemu-devel] [PULL 18/18] nbd/client: fix drop_sync [CVE-2017-2630], Paolo Bonzini, 2017/03/14
- [Qemu-devel] [PULL 11/18] target/nios2: take BQL around interrupt check, Paolo Bonzini, 2017/03/14
- [Qemu-devel] [PULL 10/18] scsi: mptsas: fix the wrong reading size in fetch request, Paolo Bonzini, 2017/03/14
- [Qemu-devel] [PULL 17/18] memory: info mtree check mr range overflow, Paolo Bonzini, 2017/03/14