]> gcc.gnu.org Git - gcc.git/commitdiff
libstdc++: Fix testsuite for skipping gdb tests on remote/non-native target
authorLuc Michel <lmichel@kalray.eu>
Tue, 17 Aug 2021 15:34:37 +0000 (16:34 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 17 Aug 2021 15:54:44 +0000 (16:54 +0100)
This fixes an incorrect invocation of gdb on remote targets where
DejaGNU would try to run host's gdb in remote target simulator.
gdb-test skips the testing when target is remote or non native but the
gdb version check function does not.

Suggested-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Luc Michel <lmichel@kalray.eu>
Co-authored-by: Marc Poulhies <mpoulhies@kalrayinc.com>
libstdc++-v3/ChangeLog:

* testsuite/lib/gdb-test.exp (gdb_version_check)
(gdb_version_check_xmethods): Only check the GDB version for
local native targets.

libstdc++-v3/testsuite/lib/gdb-test.exp

index af20c85e5a0a1d8b1569316027311bb3f6c96f90..f993355c2b416485c21cac29b75df7588b975475 100644 (file)
@@ -280,6 +280,8 @@ proc gdb_batch_check {command pattern} {
 # but not earlier versions.
 # Return 1 if the version is ok, 0 otherwise.
 proc gdb_version_check {} {
+    if { ![isnative] || [is_remote target] } { return 0 }
+
     return [gdb_batch_check "python print(gdb.lookup_global_symbol)" \
              "<built-in function lookup_global_symbol>"]
 }
@@ -288,6 +290,8 @@ proc gdb_version_check {} {
 # in a manner similar to the check for a version of gdb which supports the
 # pretty-printer tests below.
 proc gdb_version_check_xmethods {} {
+    if { ![isnative] || [is_remote target] } { return 0 }
+
     return [gdb_batch_check \
              "python import gdb.xmethod; print(gdb.xmethod.XMethod)" \
              "<class 'gdb\\.xmethod\\.XMethod'>"]
This page took 0.060725 seconds and 5 git commands to generate.