From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18181 invoked by alias); 23 May 2012 17:15:23 -0000 Received: (qmail 18165 invoked by uid 22791); 23 May 2012 17:15:21 -0000 X-SWARE-Spam-Status: No, hits=-6.0 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 23 May 2012 17:15:05 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q4NHF5ir003296 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 23 May 2012 13:15:05 -0400 Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q4NHF24s021859 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Wed, 23 May 2012 13:15:04 -0400 Message-ID: <4FBD1B16.7080606@redhat.com> Date: Wed, 23 May 2012 17:15:00 -0000 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-Version: 1.0 To: "gdb-patches@sourceware.org ml" Subject: [RFA] Suppress stap-trace.exp when compilation fails Content-Type: multipart/mixed; boundary="------------070601080309000707080206" X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-05/txt/msg00904.txt.bz2 This is a multi-part message in MIME format. --------------070601080309000707080206 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 604 Hi, stap-trace.exp does not check the return value of its compile-a-testcase wrapper procedure, so when compilation of the test case fails, it attempts to run the tests anyway instead of nicely bailing out. This patch addresses this by fixing the compile wrapper to always return a valid value and checking this procedure's return value before running the tests. Okay? Keith testsuite/ChangeLog 2012-05-23 Keith Seitz * gdb.trace/stap-trace.exp: If compile_stap_bin fails, return -1 to suppress the rest of the tests. (compile_stap_bin): Return boolean success value. --------------070601080309000707080206 Content-Type: text/x-patch; name="suppress-stap-trace.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="suppress-stap-trace.patch" Content-length: 835 diff --git a/gdb/testsuite/gdb.trace/stap-trace.exp b/gdb/testsuite/gdb.trace/stap-trace.exp index 562eec4..088d14c 100644 --- a/gdb/testsuite/gdb.trace/stap-trace.exp +++ b/gdb/testsuite/gdb.trace/stap-trace.exp @@ -46,8 +46,10 @@ proc compile_stap_bin {exec_name {arg ""}} { "$binfile_dir/$exec_name" \ executable [concat $arg debug nowarnings]] != "" } { untested "Could not compile ${srcfile}" - return -1 + return 0 } + + return 1 } proc prepare_for_trace_test {} { @@ -105,7 +107,10 @@ proc gdb_collect_probe_arg { msg probe val_arg0 } { "collect $msg: collected probe arg0" } -compile_stap_bin "stap-probe-nosem" +if {![compile_stap_bin "stap-probe-nosem"]} { + # An appropriate failure message has already been output + return -1 +} clean_restart $executable if { ![runto_main] } { --------------070601080309000707080206--