From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19816 invoked by alias); 12 Aug 2014 17:15:48 -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 19804 invoked by uid 89); 12 Aug 2014 17:15:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-oa0-f73.google.com Received: from mail-oa0-f73.google.com (HELO mail-oa0-f73.google.com) (209.85.219.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 12 Aug 2014 17:15:45 +0000 Received: by mail-oa0-f73.google.com with SMTP id g18so1872422oah.2 for ; Tue, 12 Aug 2014 10:15:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:mime-version:content-type :content-transfer-encoding:message-id:date:to:cc:subject:in-reply-to :references; bh=hlcRHMshqeEpnZZm1uCXV34EALQLPwAa+ETwdU3wPbs=; b=SFERCH7LHpWJF/0o/EidUqysNU7dU4jHjARpF8DJJTi5m7nPcYddz8Rouic0g0YpDY mkKvDbBRSux5eB8HmQYbeFaxAJAp2K+uubSCZtoopoIo/s7vI6DxGa2FRAnEZKoCyYrA aqXDesE/GcJBLBmXVHXeu9CvAKFypCD0FOVazLUdlICfecN4+PgxJa54aHOT6PbucE0R tBj4asYrSoL60lHgNBb8/LdXDIGSsfmHFGjV07paCsDSYYjWFAPrU40WiY0YT8SXr5Gd acVjbuCURBbYb6uRcQA9+g2XITIbvegltK7vS5rW0ek3iXQfZoEfvbXV6z8Nk70AYpZv vrNA== X-Gm-Message-State: ALoCoQnUJxbr5gTnkiwEDj1+OPVqCtA+triQASJEHXs6rC0lqZ8fKPhsSuNg0J4xV8jyWjHXDnhm X-Received: by 10.182.130.168 with SMTP id of8mr3099169obb.27.1407863743319; Tue, 12 Aug 2014 10:15:43 -0700 (PDT) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id j43si1243745yhh.5.2014.08.12.10.15.43 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 12 Aug 2014 10:15:43 -0700 (PDT) Received: from ruffy.mtv.corp.google.com (ruffy.mtv.corp.google.com [172.17.128.44]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id 99BEF31C4E6; Tue, 12 Aug 2014 10:15:42 -0700 (PDT) From: Doug Evans MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <21482.19388.251662.22760@ruffy.mtv.corp.google.com> Date: Tue, 12 Aug 2014 17:15:00 -0000 To: Yao Qi Cc: Subject: Re: [PATCH] Copy .py files to remote host In-Reply-To: <1407849103-16521-1-git-send-email-yao@codesourcery.com> References: <1407849103-16521-1-git-send-email-yao@codesourcery.com> X-IsSubscribed: yes X-SW-Source: 2014-08/txt/msg00197.txt.bz2 Yao Qi writes: > Some gdb.python/*.exp tests fail because the .py files aren't copied > to the (remote) host. This patch is to copy needed .py files to host. > Most of gdb.python/*.exp tests do this. > > gdb/testsuite: > > 2014-08-12 Yao Qi > > * gdb.python/py-finish-breakpoint.exp: Copy .py file to host. > Delete the .py file on host when test is finished. > * gdb.python/py-finish-breakpoint2.exp: Likewise. > * gdb.python/python.exp: Likewise. Use .py file on the host > instead of the build. > [...] > --- > gdb/testsuite/gdb.python/py-finish-breakpoint.exp | 15 ++++++++++++--- > gdb/testsuite/gdb.python/py-finish-breakpoint2.exp | 6 +++++- > gdb/testsuite/gdb.python/python.exp | 13 +++++++++++-- > 3 files changed, 28 insertions(+), 6 deletions(-) > > diff --git a/gdb/testsuite/gdb.python/py-finish-breakpoint.exp b/gdb/testsuite/gdb.python/py-finish-breakpoint.exp > index 43d0d81..45aa231 100644 > --- a/gdb/testsuite/gdb.python/py-finish-breakpoint.exp > +++ b/gdb/testsuite/gdb.python/py-finish-breakpoint.exp > @@ -53,9 +53,6 @@ if { $gdb_py_is_py24 == 1 } { > return 0 > } > > -set python_file ${srcdir}/${subdir}/${testfile}.py > - > - > # Skip all tests if Python scripting is not enabled. > if { [skip_python_tests] } { continue } > > @@ -71,6 +68,9 @@ if ![runto_main] then { > return 0 > } > > +set python_file [gdb_remote_download host \ > + ${srcdir}/${subdir}/${testfile}.py] > + > gdb_test_no_output "set confirm off" "disable confirmation" > gdb_test "source $python_file" "Python script imported.*" \ > "import python scripts" > @@ -115,6 +115,7 @@ gdb_test "source $python_file" "Python script imported.*" \ > set cond_line [gdb_get_line_number "Condition Break."] > > if ![runto_main] then { > + remote_file host delete ${python_file} > fail "Cannot run to main." > return 0 > } > @@ -141,6 +142,7 @@ gdb_test "source $python_file" "Python script imported.*" \ > "import python scripts" > > if ![runto call_longjmp_1] then { > + remote_file host delete ${python_file} > perror "couldn't run to breakpoint call_longjmp" > continue > } > [...] Hi. I still have an outstanding question on this topic, and before this gets checked in I'd like to get it resolved. Do we delete other files downloaded to the remote target? At one point I tried to find a place there the testsuite code was taking care to delete other downloaded files, but couldn't. Since we've gotten by this long without doing so [and this is *still* just a hypothesis - I haven't worked with remote hosts in awhile ...] I would rather just punt on deleting python files as well, and document that that is the convention (since for every other file it already is :-)). [Why treat python files differently?] If we really did want to fully clean up after each test, and we should first establish that that is indeed what we want to do, instead of filling every test exit point with explicit code to delete only one kind of downloaded file, how about instead keep a list of all downloaded files and call a routine to delete the files in that list from some central cleanup point?