From patchwork Tue Jan 16 11:50:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 25413 Received: (qmail 57868 invoked by alias); 16 Jan 2018 11:50:29 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 57856 invoked by uid 89); 16 Jan 2018 11:50:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-spam-relays-external:209.85.128.194, H*RU:209.85.128.194, H*r:sk:static. X-HELO: mail-wr0-f194.google.com Received: from mail-wr0-f194.google.com (HELO mail-wr0-f194.google.com) (209.85.128.194) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 16 Jan 2018 11:50:18 +0000 Received: by mail-wr0-f194.google.com with SMTP id z48so14863097wrz.6 for ; Tue, 16 Jan 2018 03:50:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=0MquY8jo/4zyUhoZYD2XLZlb2WlZBkGy65xXSCIpl8c=; b=ig0BopmtCbovY9yxHE1IApW3nkHo1HNHapEkvRSZbXVh/JutchGNZdJ+ETvRPcGcHe U6gRzz8xw6+A7USk1J8ayGXxYEStizOYiNB7CcYj9wDSWTrsjJM2eHQcbI/F6zkUXyjy G0wkdmtZM47oQ+K1R/h84Xq6HcIp4Z/m8qYW6sAXadRjAvGEybOXNyFpoe19qnqANIFQ GloMIEEY65bSReonhBjZWs11IU9SpWrfzU5VR7Pdj2TnLrxa7OOctjrrU2GlL7jBzkxt eselVw5SKU61/ku9b/zl98pIrqOG+lgacG+8+ZJ3inU3JUXzonGsFPurqnTxHKbs25XT kO8g== X-Gm-Message-State: AKwxytfaCKX13WrQmXl0QxqPjiaZOzfrdvUG9k2UHH5W/yjxp72NCIkY LVflUjO6H5/bb3r1BaNrbfgOjQ== X-Google-Smtp-Source: ACJfBovX/fKpvFIGso+7i5Bgu50jEsAKAYwtiZIhuHj4VmhsTW48OkUH2+T8C0wv64b1MeczK55/gg== X-Received: by 10.223.179.193 with SMTP id x1mr4785581wrd.171.1516103416563; Tue, 16 Jan 2018 03:50:16 -0800 (PST) Received: from E107787-LIN.cambridge.arm.com (static.42.136.251.148.clients.your-server.de. [148.251.136.42]) by smtp.gmail.com with ESMTPSA id i1sm5441183wrh.96.2018.01.16.03.50.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 16 Jan 2018 03:50:16 -0800 (PST) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Cc: jan.kratochvil@redhat.com, pmuldoon@redhat.com Subject: [PATCH] Run gdb.compile/*.exp on {x86,x86_64,s390}-linux only Date: Tue, 16 Jan 2018 11:50:12 +0000 Message-Id: <1516103412-25086-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes I see many gdb.compile/*.exp fails on aarch64-linux and arm-linux, (gdb) compile code -- ; Could not find a compiler matching "^arm(-[^-]*)?-linux(-gnu)?-gcc$" (gdb) compile code -- ; aarch64-none-linux-gnu-gcc: error: unrecognized command line option '-m64' I think we need to properly skip tests on targets which don't support compile. As far as I know, gdb compile is supported on x86, x86_64, and s390. This patch matches the target triplet in lib/gdb.exp:skip_compile_feature_tests. If the target triplet is *not* x86,x86_64, and s390 linux, return 1; otherwise, do the "compile code -- ;" test. An alternative approach is to modify lib/gdb.exp:skip_compile_feature_tests to match these error messages above. However, these error message is from libcc1, subject to change, and other targets may have different error messages from libcc1. gdb/testsuite: 2018-01-16 Yao Qi * lib/gdb.exp (skip_compile_feature_tests): Return 1 if target triplet isn't x86-linux or s390-linux. --- gdb/testsuite/lib/gdb.exp | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index a4bde72..8723925 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -3141,16 +3141,25 @@ proc skip_compile_feature_tests {} { global gdb_prompt set result 0 - gdb_test_multiple "compile code -- ;" "check for working compile command" { - "Could not load libcc1.*\r\n$gdb_prompt $" { - set result 1 - } - -re "Command not supported on this host\\..*\r\n$gdb_prompt $" { - set result 1 - } - -re "\r\n$gdb_prompt $" { + + if { [istarget "i\[34567\]86-*-linux*"] + || [istarget "x86_64-*-linux*"] + || [istarget "s390*-*-linux*"] } { + gdb_test_multiple "compile code -- ;" \ + "check for working compile command" { + "Could not load libcc1.*\r\n$gdb_prompt $" { + set result 1 + } + -re "Command not supported on this host\\..*\r\n$gdb_prompt $" { + set result 1 + } + -re "\r\n$gdb_prompt $" { + } } + } else { + set result 1 } + return $result }