From patchwork Fri Jun 16 23:12:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 21059 Received: (qmail 80545 invoked by alias); 16 Jun 2017 23:12:15 -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 80529 invoked by uid 89); 16 Jun 2017 23:12:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.0 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= X-HELO: mail-wr0-f177.google.com Received: from mail-wr0-f177.google.com (HELO mail-wr0-f177.google.com) (209.85.128.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Jun 2017 23:12:13 +0000 Received: by mail-wr0-f177.google.com with SMTP id 36so45093332wry.3 for ; Fri, 16 Jun 2017 16:12:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=y6RegRsKHFpnADgH65pyZ1mkaTIMmGJcJ9G2AhiQ1Q8=; b=DnoTUl0qB8mI1pomSaM6RctewRaxJtldAVUaUQtBqqJKSGGCbjw2C2TZWIbT50pIHF S0qovGO3C7aq3XNK5Syfc8zfiH4l4+cZ5WXBjChYaYuvMnQGa8eYcgik2s/Vthc7ny8J Temfbzn4gwJWJe3jsKIDwIwuas4COzOTly/70SpuqQHJdIbfWd6pOrnBJ+oNDzOAWir9 6CHqCnT25wKJ0IplBElO3KJ0acvBruDu3jV4SCtDzSxwUesdHk6RwkqcGrPVFunHqcbz eG22jrhZQ3axp36Dtmtoo65pXXl9UXirVYQgNGceXVytUx3ncqkT+ofC+Tmvaqwwl3Ul 3Fag== X-Gm-Message-State: AKS2vOzjeVWFQbS/d8WeHq6xSOaouLw0G6bAsVqwDZYc2XXSwR2/9ux6 ua4HQt5WNmb6tbDVOmU= X-Received: by 10.223.147.165 with SMTP id 34mr8177919wrp.175.1497654735563; Fri, 16 Jun 2017 16:12:15 -0700 (PDT) Received: from localhost (host86-164-103-137.range86-164.btcentralplus.com. [86.164.103.137]) by smtp.gmail.com with ESMTPSA id t15sm4820522wmd.13.2017.06.16.16.12.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Jun 2017 16:12:14 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH] gdb: Unset PROMPT_COMMAND before testing Date: Sat, 17 Jun 2017 00:12:10 +0100 Message-Id: <20170616231210.14867-1-andrew.burgess@embecosm.com> X-IsSubscribed: yes One of the GDB tests starts up a sub-shell and runs a few commands in it. In some cases, a users PROMPT_COMMAND might not work in the sub-shell GDB starts, which could cause the shell to emit unexpected warnings or errors, this in turn could cause tests to fail. The current example is gdb.base/batch-preserve-term-settings.exp, but there could be others in the future. I don't see any regressions with this patch, but I do now see 5 additional passes on gdb.base/batch-preserve-term-settings.exp. OK to apply? Thanks, Andrew --- gdb/testsuite/ChangeLog: * lib/gdb.exp (gdb_init): Unset PROMPT_COMMAND. --- gdb/testsuite/ChangeLog | 4 ++++ gdb/testsuite/lib/gdb.exp | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index a74f97465e..053bc65e09 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -4626,6 +4626,11 @@ proc gdb_init { test_file_name } { # especially having color output turned on can cause tests to fail. setenv GREP_OPTIONS "" + # Some tests run a shell. If a user has PROMPT_COMMAND set then + # there's no guarantee that what it's set to will work correctly + # within the sub-shells we run. For safety clear it. + setenv PROMPT_COMMAND "" + # Clear $gdbserver_reconnect_p. global gdbserver_reconnect_p set gdbserver_reconnect_p 1