From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10273 invoked by alias); 21 Oct 2013 11:17:17 -0000 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 Received: (qmail 10234 invoked by uid 89); 21 Oct 2013 11:17:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: kiruna.synopsys.com Received: from us01smtp2.synopsys.com (HELO kiruna.synopsys.com) (198.182.44.80) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 21 Oct 2013 11:17:16 +0000 Received: from WBSNus01mta2 (us01secmta2.synopsys.com [10.9.203.102]) by kiruna.synopsys.com (Postfix) with ESMTP id 7E7DDF2C8; Mon, 21 Oct 2013 04:17:14 -0700 (PDT) Received: from us01secmta2.internal.synopsys.com (us01secmta2.internal.synopsys.com [127.0.0.1]) by us01secmta2.internal.synopsys.com (Service) with ESMTP id 6F221A4112; Mon, 21 Oct 2013 04:17:14 -0700 (PDT) Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.9.202.240]) by us01secmta2.internal.synopsys.com (Service) with ESMTP id 50C21A4102; Mon, 21 Oct 2013 04:17:14 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 4582067C; Mon, 21 Oct 2013 04:17:14 -0700 (PDT) Received: from ru20-arctools.internal.synopsys.com (ru20-arctools.internal.synopsys.com [10.121.9.107]) by mailhost.synopsys.com (Postfix) with ESMTP id 6001067B; Mon, 21 Oct 2013 04:17:13 -0700 (PDT) From: Anton Kolesov To: gdb-patches@sourceware.org Cc: Jeremy Bennett Subject: [PATCH v2] testsuite: Treat an empty string in needs_status_wrapper as false Date: Mon, 21 Oct 2013 11:17:00 -0000 Message-Id: <1382354229-10006-1-git-send-email-Anton.Kolesov@synopsys.com> In-Reply-To: <39A54937CC95F24AA2F794E2D2B66B1356BD8887@de02wembxa.internal.synopsys.com> References: <39A54937CC95F24AA2F794E2D2B66B1356BD8887@de02wembxa.internal.synopsys.com> X-SW-Source: 2013-10/txt/msg00616.txt.bz2 GDB test suite considers [target_info needs_status_wrapper] to be false if it unset or have a zero value. The former is achieved by using [target_info exists needs_status_wrapper]. GCC test suite on the other hand do not use "exists" but compares to an empty string. This doesn't make difference if value is unset, as unset value is treated as an empty string, but makes a difference if value was set to and empty string. In that case if needs_status_wrapper was set to an empty string, then GCC test suite will not use status wrapper, but GDB test suite will use it. Dejagnu's own remote.exp uses a comparison with an empty string. Though for some reason Dejagnu unlike GCC and GDB test suite doesn't treat a zero as a false. This patch makes GDB test suite treat an empty string in needs_status_wrapper the same way as it is done by GCC test suite and Dejagnu. gdb/testsuite/ChangeLog: 2013-10-21 Anton Kolesov * lib/gdb.exp (gdb_compile, gdb_wrapper_init): Treat empty string in target_info needs_status_wrapper the same way as zero - as a false value. --- gdb/testsuite/lib/gdb.exp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 3efd539..1e5c34a 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -2510,7 +2510,7 @@ proc gdb_wrapper_init { args } { if { $gdb_wrapper_initialized == 1 } { return; } - if {[target_info exists needs_status_wrapper] && \ + if {[target_info needs_status_wrapper] != "" && \ [target_info needs_status_wrapper] != "0"} { set result [build_wrapper "testglue.o"] if { $result != "" } { @@ -2609,7 +2609,7 @@ proc gdb_compile {source dest type options} { if { $gdb_wrapper_initialized == 0 } { gdb_wrapper_init } - if {[target_info exists needs_status_wrapper] && \ + if {[target_info needs_status_wrapper] != "" && \ [target_info needs_status_wrapper] != "0" && \ [info exists gdb_wrapper_file]} { lappend options "libs=${gdb_wrapper_file}" -- 1.8.4.1