From patchwork Mon Jun 22 11:03:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 7284 Received: (qmail 109912 invoked by alias); 22 Jun 2015 11:03:50 -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 109903 invoked by uid 89); 22 Jun 2015 11:03:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f47.google.com Received: from mail-pa0-f47.google.com (HELO mail-pa0-f47.google.com) (209.85.220.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 22 Jun 2015 11:03:48 +0000 Received: by pabvl15 with SMTP id vl15so85795835pab.1 for ; Mon, 22 Jun 2015 04:03:46 -0700 (PDT) X-Received: by 10.66.62.202 with SMTP id a10mr52435609pas.42.1434971026437; Mon, 22 Jun 2015 04:03:46 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by mx.google.com with ESMTPSA id ql9sm19461428pbc.65.2015.06.22.04.03.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 22 Jun 2015 04:03:45 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH 1/2] New proc supports_get_siginfo_type Date: Mon, 22 Jun 2015 12:03:36 +0100 Message-Id: <1434971017-22494-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes Both siginfo-obj.exp and siginfo-thread.exp have the same code checking the support of geting a type of siginfo for a given arch. This patch is to move these code into a proc supports_get_siginfo_type. gdb/testsuite: 2015-06-22 Yao Qi * lib/gdb.exp (supports_get_siginfo_type): New proc. * gdb.base/siginfo-obj.exp: Invoke supports_get_siginfo_type. * gdb.base/siginfo-thread.exp: Likewise. --- gdb/testsuite/gdb.base/siginfo-obj.exp | 4 +--- gdb/testsuite/gdb.base/siginfo-thread.exp | 4 +--- gdb/testsuite/lib/gdb.exp | 13 +++++++++++++ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/gdb/testsuite/gdb.base/siginfo-obj.exp b/gdb/testsuite/gdb.base/siginfo-obj.exp index 0d1b96d..578c12e 100644 --- a/gdb/testsuite/gdb.base/siginfo-obj.exp +++ b/gdb/testsuite/gdb.base/siginfo-obj.exp @@ -26,9 +26,7 @@ if [target_info exists gdb,nosignals] { continue } -if { ! [istarget "i?86-*-linux*"] - && ! [istarget "x86_64-*-linux*"] - && ! [istarget "arm*-*-linux*"] } { +if { ![supports_get_siginfo_type] } { verbose "Skipping siginfo-obj.exp because of lack of support." return } diff --git a/gdb/testsuite/gdb.base/siginfo-thread.exp b/gdb/testsuite/gdb.base/siginfo-thread.exp index 638bef3..a00b5aa 100644 --- a/gdb/testsuite/gdb.base/siginfo-thread.exp +++ b/gdb/testsuite/gdb.base/siginfo-thread.exp @@ -21,9 +21,7 @@ if [target_info exists gdb,nosignals] { continue } -if { ! [istarget "i?86-*-linux*"] - && ! [istarget "x86_64-*-linux*"] - && ! [istarget "arm*-*-linux*"] } { +if { ![supports_get_siginfo_type] } { verbose "Skipping siginfo-thread.exp because of lack of support." return } diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index d169f3d..d3ed56f 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -1996,6 +1996,19 @@ gdb_caching_proc support_complex_tests { return $result } +# Return 1 if GDB can get a type for siginfo from the target, otherwise +# return 0. + +proc supports_get_siginfo_type {} { + if { [istarget "i?86-*-linux*"] + || [istarget "x86_64-*-linux*"] + || [istarget "arm*-*-linux*"] } { + return 1 + } else { + return 0 + } +} + # Return 1 if target hardware or OS supports single stepping to signal # handler, otherwise, return 0.