From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13999 invoked by alias); 10 Dec 2013 14:43:55 -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 13990 invoked by uid 89); 10 Dec 2013 14:43:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: mail-gw3-out.broadcom.com Received: from Unknown (HELO mail-gw3-out.broadcom.com) (216.31.210.64) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 10 Dec 2013 14:43:53 +0000 Received: from irvexchcas08.broadcom.com (HELO IRVEXCHCAS08.corp.ad.broadcom.com) ([10.9.208.57]) by mail-gw3-out.broadcom.com with ESMTP; 10 Dec 2013 06:44:04 -0800 Received: from IRVEXCHSMTP1.corp.ad.broadcom.com (10.9.207.51) by IRVEXCHCAS08.corp.ad.broadcom.com (10.9.208.57) with Microsoft SMTP Server (TLS) id 14.1.438.0; Tue, 10 Dec 2013 06:43:45 -0800 Received: from mail-irva-13.broadcom.com (10.10.10.20) by IRVEXCHSMTP1.corp.ad.broadcom.com (10.9.207.51) with Microsoft SMTP Server id 14.1.438.0; Tue, 10 Dec 2013 06:43:46 -0800 Received: from [10.177.73.57] (unknown [10.177.73.57]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id 9F24A246A3 for ; Tue, 10 Dec 2013 06:43:45 -0800 (PST) Message-ID: <52A728A0.1050208@broadcom.com> Date: Tue, 10 Dec 2013 14:43:00 -0000 From: Andrew Burgess User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 To: "gdb-patches@sourceware.org" Subject: [PATCH] Call get_compiler_info directly from test_compiler_info if needed. Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2013-12/txt/msg00374.txt.bz2 Ran into a case where we call test_compiler_info without first calling get_compiler_info. I was going to just add an extra call to get_compiler_info, but then I got all carried away.... with this patch test_compiler_info now calls get_compiler_info if needed. I also remove a couple of uses of the compiler_info variable and replace with calls to test_compiler_info instead. OK to apply? gdb/testsuite/ChangeLog * gdb.base/watchpoint.exp (test_complex_watchpoint): Remove use of compiler_info global, instead call test_compiler_info. * gdb.cp/temargs.exp: Same. * lib/gdb.exp (compiler_info): Change initial value to empty string. (test_compiler_info): Call get_compiler_info if compiler_info is empty string. (skip_vsx_tests): No longer need to call get_compiler_info. (skip_altivec_tests): Same. diff --git a/gdb/testsuite/gdb.base/watchpoint.exp b/gdb/testsuite/gdb.base/watchpoint.exp index 9576a9e..73dc5cc 100644 --- a/gdb/testsuite/gdb.base/watchpoint.exp +++ b/gdb/testsuite/gdb.base/watchpoint.exp @@ -464,12 +464,12 @@ proc test_complex_watchpoint {} { pass $test } -re "can't compute CFA for this frame.*\r\n$gdb_prompt $" { - global compiler_info no_hw + global no_hw # GCC < 4.5.0 does not get LOCATIONS_VALID set by dwarf2read.c. # Therefore epilogue unwinder gets applied which is # incompatible with dwarf2_frame_cfa. - verbose -log "compiler_info: $compiler_info" + verbose -log "compiler_info: [test_compiler_info]" if {$no_hw && ([test_compiler_info {gcc-[0-3]-*}] || [test_compiler_info {gcc-4-[0-4]-*}])} { xfail "$test (old GCC has broken watchpoints in epilogues)" diff --git a/gdb/testsuite/gdb.cp/temargs.exp b/gdb/testsuite/gdb.cp/temargs.exp index 4cd9da5..31cde41 100644 --- a/gdb/testsuite/gdb.cp/temargs.exp +++ b/gdb/testsuite/gdb.cp/temargs.exp @@ -34,7 +34,7 @@ if {![runto_main]} { # NOTE: prepare_for_testing calls get_compiler_info, which we need # for the test_compiler_info calls. # gcc 4.4 and earlier don't emit enough info for some of our template tests. -verbose -log "compiler_info: $compiler_info" +verbose -log "compiler_info: [test_compiler_info]" set have_older_template_gcc 0 set have_pr_41736_fixed 1 set have_pr_45024_fixed 1 diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 2c1cf29..6340e80 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -2027,10 +2027,6 @@ gdb_caching_proc skip_altivec_tests { # Make sure we have a compiler that understands altivec. set compile_flags {debug nowarnings} - if [get_compiler_info] { - warning "Could not get compiler info" - return 1 - } if [test_compiler_info gcc*] { set compile_flags "$compile_flags additional_flags=-maltivec" } elseif [test_compiler_info xlc*] { @@ -2110,10 +2106,6 @@ gdb_caching_proc skip_vsx_tests { # Make sure we have a compiler that understands altivec. set compile_flags {debug nowarnings quiet} - if [get_compiler_info] { - warning "Could not get compiler info" - return 1 - } if [test_compiler_info gcc*] { set compile_flags "$compile_flags additional_flags=-mvsx" } elseif [test_compiler_info xlc*] { @@ -2401,7 +2393,7 @@ proc skip_libstdcxx_probe_tests {} { return $ok } -set compiler_info "unknown" +set compiler_info "" set gcc_compiled 0 set hp_cc_compiler 0 set hp_aCC_compiler 0 @@ -2552,6 +2544,14 @@ proc get_compiler_info {{arg ""}} { proc test_compiler_info { {compiler ""} } { global compiler_info + # Check that compiler_info has been initialised + if [string match "" $compiler_info] { + if [get_compiler_info] { + warning "Could not get compiler info" + return -1 + } + } + # if no arg, return the compiler_info string if [string match "" $compiler] {