From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16168 invoked by alias); 12 Aug 2014 23:57:00 -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 16148 invoked by uid 89); 12 Aug 2014 23:56:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: elasmtp-banded.atl.sa.earthlink.net Received: from elasmtp-banded.atl.sa.earthlink.net (HELO elasmtp-banded.atl.sa.earthlink.net) (209.86.89.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 12 Aug 2014 23:56:53 +0000 Received: from [68.104.16.238] (helo=macbook2.local) by elasmtp-banded.atl.sa.earthlink.net with esmtpa (Exim 4.67) (envelope-from ) id 1XHLvv-0005eN-4I; Tue, 12 Aug 2014 19:56:51 -0400 Message-ID: <53EAA9C3.2090303@earthlink.net> Date: Tue, 12 Aug 2014 23:57:00 -0000 From: Stan Shebs User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Doug Evans , Yao Qi CC: gdb-patches@sourceware.org Subject: Re: [PATCH] Copy .py files to remote host References: <1407849103-16521-1-git-send-email-yao@codesourcery.com> <21482.19388.251662.22760@ruffy.mtv.corp.google.com> In-Reply-To: <21482.19388.251662.22760@ruffy.mtv.corp.google.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-ELNK-Trace: ae6f8838ff913eba0cc1426638a40ef67e972de0d01da940539511f651ed3228dcde255a4c3d84a3350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c X-IsSubscribed: yes X-SW-Source: 2014-08/txt/msg00204.txt.bz2 On 8/12/14, 10:15 AM, Doug Evans wrote: > 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? Going by instances of remote_file delete in the testsuite, it's at least semi-standard to do so. It certainly reduces the chances of confusion for any functionality that is based on searching for a matching file to load/process. > 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? I could go for that. The existing deletions seem to be in a variety of styles, and it would be useful to have standard failure handling and such. Stan stan@codesourcery.com