tests/tcg: Fix the /proc/self/mem probing in the PROT_NONE gdbstub test
PATCH 1/1 tests/tcg: Fix the /proc/self/mem probing in the PROT_NONE gdbstub test
The if not probe_proc_self_mem check never passes, because probe_proc_self_mem is a function object, which is a truthy value. Add parentheses in order to perform a function call.
--- tests/tcg/multiarch/gdbstub/prot-none.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/tcg/multiarch/gdbstub/prot-none.py +1 -1
@@ -20,7 +20,7 @@ def probe_proc_self_mem(): def run_test(): """Run through the tests one by one""" - if not probe_proc_self_mem: + if not probe_proc_self_mem(): print("SKIP: /proc/self/mem is not usable") exit(0) gdb.Breakpoint("break_here")
Signature · 1 line
2.43.0
Quoted 15 lines · Ilya Leoshkevich
The
if not probe_proc_self_memcheck never passes, becauseprobe_proc_self_memis a function object, which is a truthy value. Add parentheses in order to perform a function call.Fixes dc84d50a7f9b ("tests/tcg: Add the PROT_NONE gdbstub test")Signed-off-by Ilya Leoshkevich <[email protected]>--- tests/tcg/multiarch/gdbstub/prot-none.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/tcg/multiarch/gdbstub/prot-none.py +0
-0
tests/tcg/multiarch/gdbstub/prot-none.py def probe_proc_self_mem(): · line 26
Quoted 8 lines
tests/tcg/multiarch/gdbstub/prot-none.py +1
-1@@ -20,7 +20,7 @@ def probe_proc_self_mem(): def run_test(): """Run through the tests one by one""" - if not probe_proc_self_mem: + if not probe_proc_self_mem(): print("SKIP: /proc/self/mem is not usable") exit(0) gdb.Breakpoint("break_here")
Ack. Queued to tcg-next.
r~
Quoted 5 lines · Ilya Leoshkevich
The
if not probe_proc_self_memcheck never passes, becauseprobe_proc_self_memis a function object, which is a truthy value. Add parentheses in order to perform a function call.Fixes dc84d50a7f9b ("tests/tcg: Add the PROT_NONE gdbstub test")
FWIW (it's too late already and this commit has landed in master), commit "tests/tcg: Add the PROT_NONE gdbstub test" is 82607a73f8 not dc84d50a7f9b.
/mjt
Quoted 5 lines · Michael Tokarev
Quoted 4 lines · Ilya Leoshkevich
The
if not probe_proc_self_memcheck never passes, becauseprobe_proc_self_memis a function object, which is a truthy value. Add parentheses in order to perform a function call.
Quoted 7 lines
Quoted 1 line
Fixes dc84d50a7f9b ("tests/tcg: Add the PROT_NONE gdbstub test")FWIW (it's too late already and this commit has landed in master), commit "tests/tcg: Add the
PROT_NONEgdbstub test" is82607a73f8notdc84d50a7f9b./mjt
Sorry about that; I thought that checkpatch catches such issues and didn't double check - but apparently this is a relatively new addition to the kernel checkpatch, which did not find its way into the qemu checkpatch yet.