public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc r12-2966] libstdc++: Fix testsuite for skipping gdb tests on remote/non-native target
Date: Tue, 17 Aug 2021 15:55:07 +0000 (GMT)	[thread overview]
Message-ID: <20210817155507.ED3D33877436@sourceware.org> (raw)

https://gcc.gnu.org/g:817766f4dd2f6f3fdea2c4e6e22358b0b6b06d0d

commit r12-2966-g817766f4dd2f6f3fdea2c4e6e22358b0b6b06d0d
Author: Luc Michel <lmichel@kalray.eu>
Date:   Tue Aug 17 16:34:37 2021 +0100

    libstdc++: Fix testsuite for skipping gdb tests on remote/non-native target
    
    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.

Diff:
---
 libstdc++-v3/testsuite/lib/gdb-test.exp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libstdc++-v3/testsuite/lib/gdb-test.exp b/libstdc++-v3/testsuite/lib/gdb-test.exp
index af20c85e5a0..f993355c2b4 100644
--- a/libstdc++-v3/testsuite/lib/gdb-test.exp
+++ b/libstdc++-v3/testsuite/lib/gdb-test.exp
@@ -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'>"]


                 reply	other threads:[~2021-08-17 15:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210817155507.ED3D33877436@sourceware.org \
    --to=redi@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).