From patchwork Fri Jan 31 23:08:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Simon Marchi (Code Review)" X-Patchwork-Id: 37633 Received: (qmail 102261 invoked by alias); 31 Jan 2020 23:08:28 -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 102252 invoked by uid 89); 31 Jan 2020 23:08:28 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.5 required=5.0 tests=AWL, BAYES_50, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=Gerrit-PatchSet, GerritBranch, sk:Gerrit, Gerrit-Branch X-HELO: mx1.osci.io Received: from polly.osci.io (HELO mx1.osci.io) (8.43.85.229) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 31 Jan 2020 23:08:27 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id 80A1620393; Fri, 31 Jan 2020 18:08:23 -0500 (EST) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [8.43.85.239]) by mx1.osci.io (Postfix) with ESMTP id 6B32F20178 for ; Fri, 31 Jan 2020 18:08:22 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id 4D1E920AF7 for ; Fri, 31 Jan 2020 18:08:22 -0500 (EST) X-Gerrit-PatchSet: 1 Date: Fri, 31 Jan 2020 18:08:22 -0500 From: "Tom de Vries (Code Review)" To: gdb-patches@sourceware.org Message-ID: Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange Subject: [review] [gdb/testsuite] Fix UNRESOLVED in gdb.server/server-kill-python.exp X-Gerrit-Change-Id: Ic385e08cbd34cbf85518720cf5695b4ff6619f4b X-Gerrit-Change-Number: 760 X-Gerrit-ChangeURL: X-Gerrit-Commit: af7cc3568e7d72fd6d948e4b204801d7dad8c8f8 References: Reply-To: tdevries@suse.de, gdb-patches@sourceware.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-79-g83ff7f88f1 Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/760 ...................................................................... [gdb/testsuite] Fix UNRESOLVED in gdb.server/server-kill-python.exp The test-case gdb.server/server-kill-python.exp runs fine by itself: ... Running src/gdb/testsuite/gdb.server/server-kill-python.exp ... === gdb Summary === nr of expected passes 3 ... But if we run f.i. gdb.server/file-transfer.exp before it, we get instead: ... Running src/gdb/testsuite/gdb.server/server-kill-python.exp ... ERROR: GDB process no longer exists === gdb Summary === nr of expected passes 13 nr of unresolved testcases 1 ... We can see the origin of the problem here: ... spawn gdbserver --once localhost:2347 \ build/gdb/testsuite/outputs/gdb.server/file-transfer/file-transfer \ build/gdb/testsuite/outputs/gdb.server/server-kill-python/server-kill-python^M Process build/gdb/testsuite/outputs/gdb.server/file-transfer/file-transfer \ created; pid = 9464^M Listening on port 2347^M ... The spawn of the gdbserver for the server-kill-python test-case gets as executable argument the file-transfer binary. This is caused by proc gdbserver_spawn attempting to load the exec file in $file_last_loaded. This is something that is meant to load the same exec in the gdbserver that was earlier loaded into gdb. In this test-case however, nothing has been loaded into gdb by the test-case, and consequently we load the file that was loaded into gdb in the previous test-case. Fix this by unsetting $file_last_loaded before spawning gdbserver. Build and reg-tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-01-31 Tom de Vries PR testsuite/25488 * gdb.server/server-kill-python.exp: Unset $file_last_loaded before spawning gdbserver. Change-Id: Ic385e08cbd34cbf85518720cf5695b4ff6619f4b --- M gdb/testsuite/gdb.server/server-kill-python.exp 1 file changed, 3 insertions(+), 0 deletions(-) diff --git a/gdb/testsuite/gdb.server/server-kill-python.exp b/gdb/testsuite/gdb.server/server-kill-python.exp index 71067e2..ae0eb2c 100644 --- a/gdb/testsuite/gdb.server/server-kill-python.exp +++ b/gdb/testsuite/gdb.server/server-kill-python.exp @@ -32,6 +32,9 @@ return -1 } +global last_loaded_file +unset -nocomplain last_loaded_file + # Start gdbserver. set res [gdbserver_spawn "${binfile}"] set gdbserver_protocol [lindex $res 0]