On gdb < 16.1, there is a mismatch between our gdbstub and gdb target
definition, visible with gdb message:
warning: Architecture rejected target-supplied description

As a result, loongarch64-softmmu-gdb-memory hangs due to gdb not
completing a requested operation. To be safe, let's restrict all gdb
test to this minimal version.

Reported-by: Peter Maydell <[email protected]>
Signed-off-by: Pierrick Bouvier <[email protected]>
---
 tests/tcg/loongarch64/meson.build        | 16 +++++++++++++++-
 tests/tcg/loongarch64/system/meson.build |  4 ++++
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/tests/tcg/loongarch64/meson.build 
b/tests/tcg/loongarch64/meson.build
index 4dd64f16d87..bff30cb49c8 100644
--- a/tests/tcg/loongarch64/meson.build
+++ b/tests/tcg/loongarch64/meson.build
@@ -1,11 +1,24 @@
 cc = 'loongarch64-unknown-linux-gnu-gcc'
 cc_dockerfile = 'debian-loongarch-cross'
 
+gdb_feat_version = {
+  # previous version report "Architecture rejected target-supplied
+  # description", exposing a mismatch between our gdbstub and gdb.
+  'loongarch64': '16.1',
+}
+
 subdir('system')
 
 tests = []
 
-tests += tcg_tests['multiarch-linux-user']['tests']
+foreach t: tcg_tests['multiarch-linux-user']['tests']
+  foreach src, setup: t
+    if 'gdb_test' in setup
+      setup += {'gdb_feat': 'loongarch64'}
+    endif
+    tests += {src: setup}
+  endforeach
+endforeach
 
 tests += {
   'test_bit.c': {},
@@ -23,6 +36,7 @@ if 'qemu-loongarch64' in emulators
       'cc_dockerfile': cc_dockerfile,
       'folder': 'loongarch64',
       'gdb_arch': 'loongarch64',
+      'gdb_feat_version': gdb_feat_version,
       'qemu': emulators['qemu-loongarch64'],
       'tests': tests,
     }
diff --git a/tests/tcg/loongarch64/system/meson.build 
b/tests/tcg/loongarch64/system/meson.build
index d1ee3986b62..0f81ef9cfe3 100644
--- a/tests/tcg/loongarch64/system/meson.build
+++ b/tests/tcg/loongarch64/system/meson.build
@@ -30,6 +30,9 @@ foreach t: tcg_tests['multiarch-softmmu']['tests']
         continue
       endif
     endif
+    if 'gdb_test' in setup
+      setup += {'gdb_feat': 'loongarch64'}
+    endif
     if src not in multi_src
       setup += {'cflags': [new_cflags]}
       multi_src += src
@@ -45,6 +48,7 @@ if 'qemu-system-loongarch64' in emulators
       'cc_dockerfile': cc_dockerfile,
       'folder': 'loongarch64/system',
       'gdb_arch': 'loongarch64',
+      'gdb_feat_version': gdb_feat_version,
       'qemu': emulators['qemu-system-loongarch64'],
       'tests': tests,
     }
-- 
2.47.3


Reply via email to