[PATCH 1/2] scripts/qemu-gdb/mtree.py: Int128 are decimal rather than hex

David Edmondson posted 2 patches 3 years, 11 months ago
[PATCH 1/2] scripts/qemu-gdb/mtree.py: Int128 are decimal rather than hex
Posted by David Edmondson 3 years, 11 months ago
When parsing QEMU's native Int128 type, do not attempt to convert from
hexadecimal.

Fixes: 8037fa55ac ("scripts/qemugdb/mtree.py: fix up mtree dump")
Signed-off-by: David Edmondson <david.edmondson@oracle.com>
---
 scripts/qemugdb/mtree.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/qemugdb/mtree.py b/scripts/qemugdb/mtree.py
index 8fe42c3c12..c1557d44fa 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)
 
 class MtreeCommand(gdb.Command):
     '''Display the memory tree hierarchy'''
-- 
2.34.1


Re: [PATCH 1/2] scripts/qemu-gdb/mtree.py: Int128 are decimal rather than hex
Posted by David Edmondson 3 years, 10 months ago
Ping?

On Monday, 2022-02-21 at 16:49:47 GMT, David Edmondson wrote:

> When parsing QEMU's native Int128 type, do not attempt to convert from
> hexadecimal.
>
> Fixes: 8037fa55ac ("scripts/qemugdb/mtree.py: fix up mtree dump")
> Signed-off-by: David Edmondson <david.edmondson@oracle.com>
> ---
>  scripts/qemugdb/mtree.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/qemugdb/mtree.py b/scripts/qemugdb/mtree.py
> index 8fe42c3c12..c1557d44fa 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)
>
>  class MtreeCommand(gdb.Command):
>      '''Display the memory tree hierarchy'''

dme.
-- 
The band is just fantastic, that is really what I think.