From patchwork Thu Mar 22 22:59:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 26435 Received: (qmail 49162 invoked by alias); 22 Mar 2018 22:59:19 -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 49142 invoked by uid 89); 22 Mar 2018 22:59:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=luckily, outcome X-HELO: mail-wr0-f173.google.com Received: from mail-wr0-f173.google.com (HELO mail-wr0-f173.google.com) (209.85.128.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 22 Mar 2018 22:59:16 +0000 Received: by mail-wr0-f173.google.com with SMTP id l49so1183172wrl.4 for ; Thu, 22 Mar 2018 15:59:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=PUgobmO5tYJCHkHphHS240Jig/OD4feJOTGQICZSeHI=; b=sLEXOTDLv1ihovWfmZdcv2znUCJwSQxxMCnhCijbj3qpXAiAdQmq16kjyixYFFmvPv FXBou0kh000R0UBscH6+NztGRHZQqxejph4dbcvoIAk8hunewCwjUdv3KBQGBBTXchJQ u9yhgU8OP0lItxanMbis4Qk5xCcx8e8st0QR+xvKtU+n/pCm4KcsR29z6aKyWVR85alx tzjUKyWnlwob61nS/QDt0N6BomqMzEEQIJr06X5YsPo8P6AJA+wVEypHzMgYo+jNQz+p 3G0LbLjP/CibcX4svud9xyi3mdIXR0zf/BxvgOTMDfq3Nfe4s7raE4WNkkla8BLPTExV Nvog== X-Gm-Message-State: AElRT7EkgfjT7S+DUepAjxG11V7Kj+ecDH0vOK00nWqlQ+jLs7woEiDc qM7ElLb8taJT/0MOTCm41gLWw0cs X-Google-Smtp-Source: AG47ELuUxs23akzlDRnzeNGbs1VyU5ysEYnJBToztHvYwRAFBY7DPo9m6Jg5FNEfSscvQnsWaSFkcg== X-Received: by 10.223.151.1 with SMTP id r1mr20831096wrb.126.1521759554004; Thu, 22 Mar 2018 15:59:14 -0700 (PDT) Received: from localhost (host86-177-103-167.range86-177.btcentralplus.com. [86.177.103.167]) by smtp.gmail.com with ESMTPSA id x128sm6290571wmg.20.2018.03.22.15.59.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 Mar 2018 15:59:13 -0700 (PDT) Date: Thu, 22 Mar 2018 22:59:11 +0000 From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Pedro Alves Subject: Re: [PATCH 1/2] gdb: Minor cleanup in some gdb.arch/* tests Message-ID: <20180322225911.GA13407@embecosm.com> References: <4b5623c7-72b0-4640-ce94-35be198b718d@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4b5623c7-72b0-4640-ce94-35be198b718d@redhat.com> X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] User-Agent: Mutt/1.9.2 (2017-12-15) X-IsSubscribed: yes * Pedro Alves [2018-03-22 13:51:30 +0000]: > On 03/22/2018 12:57 PM, Andrew Burgess wrote: > > A small number of tests incorrectly tried to pass -Wa,-g through to > > GCC as an extra compile time flag, either to gdb_compile or > > prepare_for_testing. > > > > There were two mistakes, first, the 'debug' flag was already being > > passed, this will cause GCC to add a suitable -g flag, which should > > then be propagated to the assembler. Secondly, in order to pass > > additional compiler flags, the syntax would be > > 'additional_flags=-Wa,-g'. As it was, the flag was just being > > ignored. > > > > Given that all these tests pass 'debug', and the invalid flag has been > > ignored for some time, I'm just removing the flags in this commit. > > > > There should be no change in the test results after this commit. > > OK. > > > - > > if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \ > > - [list debug $additional_flags]] } { > > + [list debug]] } { > > return -1 > > Note you could make these {debug} instead now. "[list ...]" was only > necessary because of variable expansion. (Don't know whether that > shortens the lines enough to avoid wrapping). Actually, "debug" is > the default, so you could just remove them completely: > > proc prepare_for_testing { testname executable {sources ""} {options {debug}}} { > Thanks for the review. I've updated inline with your suggestion. I've also converted the uses of gdb_compile to prepare_for_testing as I believe in these cases the outcome is the same. I compared the compile commands in the log file, prepare_for_testing does split out the object file step into a separate command, but otherwise I think the command are identical. Anyway, how's this? Thanks, Andrew --- gdb: Minor cleanup in some gdb.arch/* tests A small number of tests incorrectly tried to pass -Wa,-g through to GCC as an extra compile time flag, either to gdb_compile or prepare_for_testing. The problem is that the syntax used for passing the flags was incorrect, and as a result these extra flags were being ignored. Luckily, the 'debug' flag was being passed in each case anyway, which means that the '-g' flag would already be added. Given that all these tests pass 'debug', and the invalid flag has been ignored for some time, I'm just removing the flags in this commit. I've also changed the tests from using gdb_compile to prepare_for_testing, which allows some extra code to be removed from a couple of tests scripts. There should be no change in the test results after this commit. gdb/testsuite/ChangeLog: * gdb.arch/amd64-disp-step-avx.exp: Remove unneeded assembler flag option, syntax was wrong anyway. * gdb.arch/arm-disp-step.exp: Likewise. * gdb.arch/sparc64-regs.exp: Likewise. * gdb.arch/amd64-disp-step.exp: Remove unneeded assembler flag option, syntax was wrong anyway, switch to use prepare_for_testing. * gdb.arch/i386-disp-step.exp: Likewise. --- gdb/testsuite/ChangeLog | 11 +++++++++++ gdb/testsuite/gdb.arch/amd64-disp-step-avx.exp | 5 +---- gdb/testsuite/gdb.arch/amd64-disp-step.exp | 12 +----------- gdb/testsuite/gdb.arch/arm-disp-step.exp | 4 +--- gdb/testsuite/gdb.arch/i386-disp-step.exp | 12 +----------- gdb/testsuite/gdb.arch/sparc64-regs.exp | 5 +---- 6 files changed, 16 insertions(+), 33 deletions(-) diff --git a/gdb/testsuite/gdb.arch/amd64-disp-step-avx.exp b/gdb/testsuite/gdb.arch/amd64-disp-step-avx.exp index 5c20aeb35b4..1f85fa77c1a 100644 --- a/gdb/testsuite/gdb.arch/amd64-disp-step-avx.exp +++ b/gdb/testsuite/gdb.arch/amd64-disp-step-avx.exp @@ -25,10 +25,7 @@ if { ![istarget x86_64-*-* ] || ![is_lp64_target] } { standard_testfile .S -set additional_flags "-Wa,-g" - -if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \ - [list debug $additional_flags]] } { +if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return -1 } diff --git a/gdb/testsuite/gdb.arch/amd64-disp-step.exp b/gdb/testsuite/gdb.arch/amd64-disp-step.exp index 84f7e69e40e..782b75896cc 100644 --- a/gdb/testsuite/gdb.arch/amd64-disp-step.exp +++ b/gdb/testsuite/gdb.arch/amd64-disp-step.exp @@ -27,20 +27,10 @@ set newline "\[\r\n\]*" standard_testfile .S -set additional_flags "-Wa,-g" - -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug $additional_flags]] != "" } { - untested "failed to compile" +if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } { return -1 } -# Get things started. - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} - gdb_test "set displaced-stepping on" "" gdb_test "show displaced-stepping" ".* displaced stepping .* is on.*" diff --git a/gdb/testsuite/gdb.arch/arm-disp-step.exp b/gdb/testsuite/gdb.arch/arm-disp-step.exp index 760d392885e..0f33b37eaf1 100644 --- a/gdb/testsuite/gdb.arch/arm-disp-step.exp +++ b/gdb/testsuite/gdb.arch/arm-disp-step.exp @@ -24,9 +24,7 @@ if {![is_aarch32_target]} then { standard_testfile .S -set additional_flags "-Wa,-g" - -if { [prepare_for_testing "failed to prepare" $testfile $srcfile [list debug $additional_flags]] } { +if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } { return -1 } diff --git a/gdb/testsuite/gdb.arch/i386-disp-step.exp b/gdb/testsuite/gdb.arch/i386-disp-step.exp index ff0713cef96..d15c54be74b 100644 --- a/gdb/testsuite/gdb.arch/i386-disp-step.exp +++ b/gdb/testsuite/gdb.arch/i386-disp-step.exp @@ -25,20 +25,10 @@ if { ![is_x86_like_target] } then { standard_testfile .S -set additional_flags "-Wa,-g" - -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug $additional_flags]] != "" } { - untested "failed to compile" +if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } { return -1 } -# Get things started. - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} - gdb_test "set displaced-stepping on" "" gdb_test "show displaced-stepping" ".* displaced stepping .* is on.*" diff --git a/gdb/testsuite/gdb.arch/sparc64-regs.exp b/gdb/testsuite/gdb.arch/sparc64-regs.exp index 3e84de6dd01..6b621bbd98c 100644 --- a/gdb/testsuite/gdb.arch/sparc64-regs.exp +++ b/gdb/testsuite/gdb.arch/sparc64-regs.exp @@ -25,10 +25,7 @@ if ![istarget "sparc64*-*-linux*"] then { standard_testfile .S -set additional_flags "-Wa,-g" - -if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \ - [list debug $additional_flags]] } { +if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return -1 }