scripts: More Python fixes
v2 cover scripts: More Python fixes
Trivial Python3 fixes, again...
Since v1:
- Added Alex Bennée A-b tags
- Addressed John Snow review comments
- Use /usr/bin/env
- Do not modify os.path (dropped last patch)
Philippe Mathieu-Daudé (3):
MAINTAINERS: Cover the GDB Python scripts in the gdbstub section scripts/qemugdb: Remove shebang header
scripts/qmp: Use Python 3 interpreter
MAINTAINERS | 1 + scripts/qemugdb/__init__.py | 3 +-- scripts/qemugdb/aio.py | 3 +-- scripts/qemugdb/coroutine.py | 3 +-- scripts/qemugdb/mtree.py | 4 +--- scripts/qemugdb/tcg.py | 1 - scripts/qmp/qom-get | 2 +- scripts/qmp/qom-list | 2 +- scripts/qmp/qom-set | 2 +- scripts/qmp/qom-tree | 2 +- 10 files changed, 9 insertions(+), 14 deletions(-)
Signature · 1 line
2.21.1
PATCH v2 1/3 MAINTAINERS: Cover the GDB Python scripts in the gdbstub section
Keep an eye on these "same same, but different" files.
--- MAINTAINERS | 1 + 1 file changed, 1 insertion(+)
MAINTAINERS +1 -0
@@ -2083,6 +2083,7 @@ R: Philippe Mathieu-Daudé <[email protected]> S: Maintained F: gdbstub* F: gdb-xml/ +F: scripts/qemugdb/ Memory API M: Paolo Bonzini <[email protected]>
Signature · 1 line
2.21.1
Re: [PATCH v2 1/3] MAINTAINERS: Cover the GDB Python scripts in the gdbstub section
Am 30.04.2020 um 08:57 hat Philippe Mathieu-Daudé geschrieben:
Quoted 13 lines
Keep an eye on these "same same, but different" files.
Acked-by Alex Bennée <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- MAINTAINERS | 1 + 1 file changed, 1 insertion(+)MAINTAINERS +0
-0
MAINTAINERS R: Philippe Mathieu-Daudé <[email protected]> · line 2086
Quoted 4 lines
MAINTAINERS +1
-0@@ -2083,6 +2083,7 @@ R: Philippe Mathieu-Daudé <[email protected]> S: Maintained F: gdbstub* F: gdb-xml/ +F: scripts/qemugdb/
Wouldn't it make sense to add scripts/qemu-gdb.py as well?
Kevin
Re: [PATCH v2 1/3] MAINTAINERS: Cover the GDB Python scripts in the gdbstub section
Quoted 9 lines · Kevin Wolf
Am 30.04.2020 um 08:57 hat Philippe Mathieu-Daudé geschrieben:
Quoted 8 lines
Keep an eye on these "same same, but different" files.
Acked-by Alex Bennée <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- MAINTAINERS | 1 + 1 file changed, 1 insertion(+)
Quoted 11 lines
MAINTAINERS R: Philippe Mathieu-Daudé <[email protected]> · line 2086
Quoted 9 lines
MAINTAINERS +1
-0@@ -2083,6 +2083,7 @@ R: Philippe Mathieu-Daudé <[email protected]> S: Maintained F: gdbstub* F: gdb-xml/ +F: scripts/qemugdb/Wouldn't it make sense to add
scripts/qemu-gdb.pyas well?
I agree scripts/qemu-gdb.py with scripts/qemugdb/*py, but now looking at the files closely I don't think they belong to the gdbstub section (GDB protocol, with no knowledge of Python), and rather deserve a new section (GDB Python scripts, with no knowledge of GDB protocol).
I am discarding this patch.
Regards,
Phil.
Quoted 3 lines
Kevin
PATCH v2 2/3 scripts/qemugdb: Remove shebang header
In reply to Philippe Mathieu-DaudéThese scripts are loaded as plugin by GDB (and they don't have any __main__ entry point). Remove the shebang header.
--- scripts/qemugdb/__init__.py | 3 +-- scripts/qemugdb/aio.py | 3 +-- scripts/qemugdb/coroutine.py | 3 +-- scripts/qemugdb/mtree.py | 4 +--- scripts/qemugdb/tcg.py | 1 - 5 files changed, 4 insertions(+), 10 deletions(-)
scripts/qemugdb/__init__.py +1 -2
@@ -1,5 +1,4 @@ -#!/usr/bin/python - +# # GDB debugging support # # Copyright (c) 2015 Linaro Ltd
scripts/qemugdb/aio.py +1 -2
@@ -1,5 +1,4 @@ -#!/usr/bin/python - +# # GDB debugging support: aio/iohandler debug # # Copyright (c) 2015 Red Hat, Inc.
scripts/qemugdb/coroutine.py +1 -2
@@ -1,5 +1,4 @@ -#!/usr/bin/python - +# # GDB debugging support # # Copyright 2012 Red Hat, Inc. and/or its affiliates
scripts/qemugdb/mtree.py +1 -3
@@ -1,5 +1,4 @@ -#!/usr/bin/python - +# # GDB debugging support # # Copyright 2012 Red Hat, Inc. and/or its affiliates
@@ -84,4 +83,3 @@ def print_item(self, ptr, offset = gdb.Value(0), level = 0): while not isnull(subregion): self.print_item(subregion, addr, level) subregion = subregion['subregions_link']['tqe_next'] -
scripts/qemugdb/tcg.py +0 -1
@@ -1,4 +1,3 @@ -#!/usr/bin/python # -*- coding: utf-8 -*- # # GDB debugging support, TCG status
Signature · 1 line
2.21.1
PATCH v2 3/3 scripts/qmp: Use Python 3 interpreter
In reply to Philippe Mathieu-Daudé---
v2: Use /usr/bin/env (jsnow)
--- scripts/qmp/qom-get | 2 +- scripts/qmp/qom-list | 2 +- scripts/qmp/qom-set | 2 +- scripts/qmp/qom-tree | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
scripts/qmp/qom-get +1 -1
@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 ## # QEMU Object Model test tools #
scripts/qmp/qom-list +1 -1
@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 ## # QEMU Object Model test tools #
scripts/qmp/qom-set +1 -1
@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 ## # QEMU Object Model test tools #
scripts/qmp/qom-tree +1 -1
@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 ## # QEMU Object Model test tools #
Signature · 1 line
2.21.1