From: Andrey Drobyshev Date: Thu, 4 Dec 2025 10:50:16 +0000 (+0200) Subject: scripts/qemugdb: mtree: Fix OverflowError in mtree with 128-bit addresses X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=33a0e3c75577f3677590f03a7f28647d57c4de27;p=thirdparty%2Fqemu.git scripts/qemugdb: mtree: Fix OverflowError in mtree with 128-bit addresses 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 Reviewed-by: Stefan Hajnoczi Message-id: 20251204105019.455060-2-andrey.drobyshev@virtuozzo.com Signed-off-by: Stefan Hajnoczi --- diff --git a/scripts/qemugdb/mtree.py b/scripts/qemugdb/mtree.py index 8fe42c3c12..77603c04b1 100644 --- a/scripts/qemugdb/mtree.py +++ b/scripts/qemugdb/mtree.py @@ -25,7 +25,7 @@ def int128(p): 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'''