From patchwork Fri Jun 17 10:16:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 13157 Received: (qmail 49814 invoked by alias); 17 Jun 2016 10:16:49 -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 49778 invoked by uid 89); 17 Jun 2016 10:16:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=H*RU:209.85.192.193, Hx-spam-relays-external:209.85.192.193 X-HELO: mail-pf0-f193.google.com Received: from mail-pf0-f193.google.com (HELO mail-pf0-f193.google.com) (209.85.192.193) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 17 Jun 2016 10:16:38 +0000 Received: by mail-pf0-f193.google.com with SMTP id t190so5972499pfb.2 for ; Fri, 17 Jun 2016 03:16:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=P5DN0C8JqGf/s8gv3NrHYOiDoN6pNbtAgPidtwb1cOM=; b=Y+ridmVuGyfDDYcBx0BdgBCv/axvBuQNKtGhOoTj3NeTK1p9hmhHzLC8JsBEnmTRmI 7lCPl8dgXmEtYy98OaWwPCyZ04L0FoDX+Yap9QKbHWseI5L8HMgdR3bAXH3dxdF+rOHV JWAn+CNkc8JIPTY3L6yKynkBWoXykbUCVeArWYJgjcZcw1DGew1n7jlvG/JPKzG9lLvE 3jW35wtWVANRcyvN/GF1Ch14PdNp/OTtWymNjlzQHx9LXQUC23JS6mc9shqOwPzuhg/Z GlCYiwH40s2PhSV647vWI034mvDnif73QsdxkjjpD6vmktpk9k6wASQ1PO4e9dRE3rJE vF/w== X-Gm-Message-State: ALyK8tJuQGiv+e8Nvcg+3AF45rNDcVMqrU2WvThUGTzRmANWMoV52UqoZyFiX/lHBjtESg== X-Received: by 10.98.64.21 with SMTP id n21mr1583130pfa.161.1466158596688; Fri, 17 Jun 2016 03:16:36 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (gcc113.osuosl.org. [140.211.9.71]) by smtp.gmail.com with ESMTPSA id z88sm39535357pfa.59.2016.06.17.03.16.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Jun 2016 03:16:36 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH 1/4] Probe catch syscall support Date: Fri, 17 Jun 2016 11:16:22 +0100 Message-Id: <1466158585-21833-2-git-send-email-yao.qi@linaro.org> In-Reply-To: <1466158585-21833-1-git-send-email-yao.qi@linaro.org> References: <1466158585-21833-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes In 82075af2c14b1f8a54fa5796fb63f7ef23f98d9d (Implement 'catch syscall' for gdbserver), only x86 is supported, but the test can still be run on other linux targets, like aarch64 and ppc, with native-gdbserver. This causes many new fails. This patch removes the check on isnative and on target triplets. Instead, we can insert catch point, and resume the program to see whether catch syscall is supported or not. gdb/testsuite: 2016-06-16 Yao Qi * gdb.base/catch-syscall.exp: Remove check on isnative and target triplets. Start gdb, execute catch syscall, and continue. Check gdb's output to determine catch syscall is supported. --- gdb/testsuite/gdb.base/catch-syscall.exp | 43 +++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp index 5679000..f3ab6cb 100644 --- a/gdb/testsuite/gdb.base/catch-syscall.exp +++ b/gdb/testsuite/gdb.base/catch-syscall.exp @@ -19,20 +19,6 @@ # It was written by Sergio Durigan Junior # on September/2008. -if { ![isnative] } then { - continue -} - -# This shall be updated whenever 'catch syscall' is implemented -# on some architecture. -if { ![istarget "x86_64-*-linux*"] && ![istarget "i\[34567\]86-*-linux*"] - && ![istarget "powerpc-*-linux*"] && ![istarget "powerpc64-*-linux*"] - && ![istarget "sparc-*-linux*"] && ![istarget "sparc64-*-linux*"] - && ![istarget "mips*-linux*"] && ![istarget "arm*-linux*"] - && ![istarget "s390*-linux*"] && ![istarget "aarch64*-*-linux*"] } { - continue -} - standard_testfile if { [prepare_for_testing ${testfile}.exp $testfile ${testfile}.c] } { @@ -40,6 +26,35 @@ if { [prepare_for_testing ${testfile}.exp $testfile ${testfile}.c] } { return -1 } +# Check target supports catch syscall or not. +clean_restart $binfile +if ![runto_main] then { + fail "Can't run to main" + return +} + +set test "catch syscall" +gdb_test_multiple $test $test { + -re "The feature \'catch syscall\' is not supported.*\r\n$gdb_prompt $" { + unsupported "catch syscall isn't supported" + return -1 + } + -re ".*$gdb_prompt $" { + pass $test + } +} + +set test "check catch syscall" +gdb_test_multiple "continue" $test { + -re ".*Your system does not support this type\r\nof catchpoint.*$gdb_prompt $" { + unsupported "catch syscall isn't supported" + return -1 + } + -re ".*Catchpoint.*$gdb_prompt $" { + pass $test + } +} + # All (but the last) syscalls from the example code. It is filled in # proc setup_all_syscalls. set all_syscalls { }