The 'qemu mtree' command fails with "OverflowError: int too big to
convert" when memory regions have 128-bit addresses.
Fix by changing conversion base from 16 to 0 (automatic detection based
on string prefix). This works more reliably in GDB's embedded
Python.
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id:
20251204105019.455060-2-andrey.drobyshev@virtuozzo.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
if p.type.code == gdb.TYPE_CODE_STRUCT:
return int(p['lo']) + (int(p['hi']) << 64)
else:
- return int(("%s" % p), 16)
+ return int(("%s" % p), 0)
class MtreeCommand(gdb.Command):
'''Display the memory tree hierarchy'''