提交 9b4b157e 编写于 作者: M Marc-André Lureau 提交者: Paolo Bonzini

scripts/dump-guest-memory.py: fix int128_get64 on recent gcc

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=1427466Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20170310112819.16760-1-marcandre.lureau@redhat.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 ca2edcd3
......@@ -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):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册