Message ID | 1399965128-5603-1-git-send-email-yao@codesourcery.com |
---|---|
State | Committed |
Headers |
Return-Path: <x14314964@homiemail-mx20.g.dreamhost.com> X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx20.g.dreamhost.com (mx2.sub5.homie.mail.dreamhost.com [208.113.200.128]) by wilcox.dreamhost.com (Postfix) with ESMTP id 9C22A36001D for <siddhesh@wilcox.dreamhost.com>; Tue, 13 May 2014 00:15:17 -0700 (PDT) Received: by homiemail-mx20.g.dreamhost.com (Postfix, from userid 14314964) id 4362741A13016; Tue, 13 May 2014 00:15:17 -0700 (PDT) X-Original-To: gdb@patchwork.siddhesh.in Delivered-To: x14314964@homiemail-mx20.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx20.g.dreamhost.com (Postfix) with ESMTPS id 20F5F41A10D14 for <gdb@patchwork.siddhesh.in>; Tue, 13 May 2014 00:15:17 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type; q=dns; s=default; b=Lh6imRDRpnaa218p+upD+dY+XKXyF I719sY6cZlYtzldJO9aJ+ASSfEfEQxzdZB64BKjwShGu/RJXKcLuZl/H1usy4WhL g4H1EzZIpp13tqC12Hgfyhe6U0nxteaT+n3worHleDf2kMz0hUOjMCJboIWb2iS2 T7heFVkCPMt7Ps= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type; s=default; bh=qiGGccGXwKvAyvJH+HwV0G9kzm0=; b=ska MK81mTN08qmsfSVboHVu1acIw5Kz0qLAvAI5WcWZKXdVxG9IS/rLC5JNcQv0S+BC kUsLjUbs6yAMjC2Ku7MGLbJChaHc0hKTC+sdBIqnQ3dGvj/OhKUBOs2rx8idIFiz bO/sckKbs/26CpLhInSr+bZ1VbysTQiOliGCGnJI= Received: (qmail 31293 invoked by alias); 13 May 2014 07:15:14 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-gdb=patchwork.siddhesh.in@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 31268 invoked by uid 89); 13 May 2014 07:15:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 13 May 2014 07:15:10 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1Wk6vb-00015g-19 from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Tue, 13 May 2014 00:15:07 -0700 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Tue, 13 May 2014 00:15:06 -0700 Received: from qiyao.dyndns.org.com (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.2.247.3; Tue, 13 May 2014 00:13:40 -0700 From: Yao Qi <yao@codesourcery.com> To: <gdb-patches@sourceware.org> Subject: [PATCH OBV] Overwrite ${board}_file in local-remote-host Date: Tue, 13 May 2014 15:12:08 +0800 Message-ID: <1399965128-5603-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-DH-Original-To: gdb@patchwork.siddhesh.in |
Commit Message
Yao Qi
May 13, 2014, 7:12 a.m. UTC
After I run test like this, $ make check RUNTESTFLAGS='--host_board=local-remote-host dw2-basic.exp' gdb.dwarf2/file1.txt in source tree was removed. In some gdb.dwarf2/*.exp, file1.txt is copied to host and then removed at the end. However, in local-remote-host-notty.exp, ${board}_download doesn't copy the file but return the absolute path of the src file. 'remote_file host delete' at the end will remove the file in source tree. This patch is to overwrite ${board}_file, and specially make "delete" option do nothing. This approach is used in gdbserver-base.exp and remote-stdio-gdbserver.exp too. It is obvious. I'll commit it in two days if there are no objections. gdb/testsuite: 2014-05-13 Yao Qi <yao@codesourcery.com> * boards/local-remote-host-notty.exp (${board}_file): New proc. --- gdb/testsuite/boards/local-remote-host-notty.exp | 7 +++++++ 1 file changed, 7 insertions(+)
Comments
On 05/13/14 08:12, Yao Qi wrote: > After I run test like this, > > $ make check RUNTESTFLAGS='--host_board=local-remote-host dw2-basic.exp' > > gdb.dwarf2/file1.txt in source tree was removed. In some gdb.dwarf2/*.exp, > file1.txt is copied to host and then removed at the end. However, in > local-remote-host-notty.exp, ${board}_download doesn't copy the file but > return the absolute path of the src file. 'remote_file host delete' at > the end will remove the file in source tree. > > This patch is to overwrite ${board}_file, and specially make "delete" > option do nothing. This approach is used in gdbserver-base.exp and > remote-stdio-gdbserver.exp too. It is obvious. I'll commit it in two > days if there are no objections. Thanks. I agree it's obvious, knowing we already do that in other board files. Go ahead and push.
On 05/14/2014 02:19 AM, Pedro Alves wrote: > Thanks. I agree it's obvious, knowing we already do that in > other board files. Go ahead and push. Thanks, Pedro. Patch is pushed in.
On Wed, May 14, 2014 at 12:58 AM, Yao Qi <yao@codesourcery.com> wrote: > On 05/14/2014 02:19 AM, Pedro Alves wrote: >> Thanks. I agree it's obvious, knowing we already do that in >> other board files. Go ahead and push. > > Thanks, Pedro. Patch is pushed in. Hi. There's no comments in the code explaining Why Things Are The Way They Are. It's not obvious to me that wanting to delete a file should necessarily always be a nop. I can imagine writing a test where I need it to not be a nop. [I realize gdbserver-base.exp has the same problem, and I may have even been the one that originally put it there (this file was created to contain some common parts of the native-*.exp files). btw, gdbserver-base.exp needs to be renamed to native-gdbserver-base.exp, hardwiring delete to be a nop is only for native gdbserver.] Looking at gdb_remote_download I see gdb_download does this differently. It appends the file to cleanfiles which is a list of files to be deleted (on the target) when the test ends. So now we have two different solutions to similar problems: cleaning up after a test. If you use gdb_remote_download you have to remember to delete it at the end and if you use gdb_download you don't. [I realize gdb_download is for the target only.] Maybe we need host_cleanfiles. I remember some tests solving this problem by giving the downloaded file a different name. So that's another way in which we now have two different solutions to the same problem.
diff --git a/gdb/testsuite/boards/local-remote-host-notty.exp b/gdb/testsuite/boards/local-remote-host-notty.exp index 6ff8f18..dd3ee5a 100644 --- a/gdb/testsuite/boards/local-remote-host-notty.exp +++ b/gdb/testsuite/boards/local-remote-host-notty.exp @@ -33,6 +33,13 @@ set_board_info rsh_prog /usr/bin/ssh set_board_info rcp_prog /usr/bin/scp set_board_info file_transfer "rsh" +proc ${board}_file { dest op args } { + if { $op == "delete" } { + return 0 + } + return [eval [list standard_file $dest $op] $args] +} + proc ${board}_download { board src dest } { # If file name is a relative, convert it to absolute, otherwise file can't