[PATCH v1 07/15] tests/tcg: better detect confused gdb which can't connect

Alex Bennée posted 15 patches 5 years, 8 months ago
There is a newer version of this series
[PATCH v1 07/15] tests/tcg: better detect confused gdb which can't connect
Posted by Alex Bennée 5 years, 8 months ago
While we may gamely give the right information it can still confuse
the wide range of GDBs out there. For example ppc64abi32-linux-user
reports:

  warning: Selected architecture powerpc:common is not compatible with reported target architecture powerpc:common64
  warning: Architecture rejected target-supplied description

but still connects. Add a test for a 0 pc and exit early if that is
the case. This may actually be a bug we need to fix?

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Cc: Richard Henderson <rth@twiddle.net>
---
 tests/tcg/multiarch/gdbstub/sha1.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/tcg/multiarch/gdbstub/sha1.py b/tests/tcg/multiarch/gdbstub/sha1.py
index 734553b98bb..2bfde49633c 100644
--- a/tests/tcg/multiarch/gdbstub/sha1.py
+++ b/tests/tcg/multiarch/gdbstub/sha1.py
@@ -65,6 +65,10 @@ except (gdb.error, AttributeError):
     print("SKIPPING (not connected)", file=sys.stderr)
     exit(0)
 
+if gdb.parse_and_eval('$pc') == 0:
+    print("SKIP: PC not set")
+    exit(0)
+
 try:
     # These are not very useful in scripts
     gdb.execute("set pagination off")
-- 
2.20.1


Re: [PATCH v1 07/15] tests/tcg: better detect confused gdb which can't connect
Posted by Richard Henderson 5 years, 8 months ago
On 5/20/20 7:05 AM, Alex Bennée wrote:
> While we may gamely give the right information it can still confuse
> the wide range of GDBs out there. For example ppc64abi32-linux-user
> reports:
> 
>   warning: Selected architecture powerpc:common is not compatible with reported target architecture powerpc:common64
>   warning: Architecture rejected target-supplied description
> 
> but still connects. Add a test for a 0 pc and exit early if that is
> the case. This may actually be a bug we need to fix?
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Cc: Richard Henderson <rth@twiddle.net>
> ---
>  tests/tcg/multiarch/gdbstub/sha1.py | 4 ++++
>  1 file changed, 4 insertions(+)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~