diff mbox series

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

Message ID 20220221164948.2873713-2-david.edmondson@oracle.com (mailing list archive)
State New, archived
Headers show
Series Minor fixes for the Python GDB plugins | expand

Commit Message

David Edmondson Feb. 21, 2022, 4:49 p.m. UTC
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(-)

Comments

David Edmondson March 29, 2022, 12:02 p.m. UTC | #1
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.
diff mbox series

Patch

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'''