From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28052 invoked by alias); 25 Jul 2012 07:27:31 -0000 Received: (qmail 28028 invoked by uid 22791); 25 Jul 2012 07:27:28 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 25 Jul 2012 07:27:14 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1Stw00-0003xe-3x from Yao_Qi@mentor.com ; Wed, 25 Jul 2012 00:27:12 -0700 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 25 Jul 2012 00:27:13 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.1.289.1; Wed, 25 Jul 2012 00:27:10 -0700 From: Yao Qi To: CC: Pedro Alves Subject: Re: [RFC] new board file 'remote-host-native.exp' Date: Wed, 25 Jul 2012 07:27:00 -0000 Message-ID: <1804874.ivBX2v1I8f@qiyao.dyndns.org> User-Agent: KMail/4.8.3 (Linux/3.3.7-1.fc16.i686; KDE/4.8.3; i686; ; ) In-Reply-To: <500EC87A.10806@redhat.com> References: <1343135426-20959-1-git-send-email-yao@codesourcery.com> <500EC87A.10806@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-IsSubscribed: yes 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 X-SW-Source: 2012-07/txt/msg00514.txt.bz2 On Tuesday, July 24, 2012 05:08:26 PM Pedro Alves wrote: > Why natively? I'd think you could use both this host board with e.g., > a gdbserver target board file. I suggest: >=20 > +# This file is a dejagnu "board file" and is used to run the testsuite > +# against local host, in remote host mode. >=20 > I'd even rename the file to local-remote-host.exp. >=20 Looks term "native" can be used for target board file, while term "local/remote" can be used for host board file. Comment is fixed. I thought of 'local-remote-host.exp' before, but gave it up since I was afraid people are confused by its name. I am fine with it. > > +# > > +# To use this file: > > +# bash$ touch ${my_dejagnu_dir}/my-dejagnu.exp > > +# bash$ export DEJAGNU=3D${my_dejagnu_dir}/my-dejagnu.exp > > +# bash$ mkdir ${my_dejagnu_dir}/boards > > +# bash$ cp ${src_dir}/gdb/testsuite/boards/remote-host-native.exp \ > > +# ${my_dejagnu_dir}/boards > > + > > +# Modify the location of GDB and the username to access your box > > +# below. > > + > > +# bash$ cd ${build_dir}/gdb > > +# bash$ make check RUNTESTFLAGS=3D"--host_board=3Dremote-host-native" > > + > > +load_generic_config "gdb" >=20 > Why is this necessary? Why "gdb", and not "unix" ? What is "gdb" > actually loading? Isn't this "gdb" the reason remote_download maps > to gdb_download ? Otherwise, that gdb_download issue should have tripped > up other configurations doing remote host testing, I'd think. Yes, this line causes remote_donwload map to gdb_download. This line is removed, and existing gdb_download doesn't have to be renamed. >=20 > > + > > +set_board_info gdb_protocol "standard" >=20 > Why is this necessary? A host board file should only specify the bits > for downloading and executing bits on the host, I think. >=20 We don't have to set this in host board file. Removed. > > + > > +global GDB > > +# Specify the location of GDB binary. > > +set GDB "/your/built/gdb" >=20 > How about we make this pick up the just built GDB ? >=20 > set GDB [file join [pwd] "../gdb"] >=20 Done. > > + > > +set_board_info compiler "[find_gcc]" >=20 > Is this necessary in a host board file? >=20 Again, we don't have to set this either in host board file. It should be set in target board file. > > +set_board_info hostname 127.0.0.1 > > + > > +set_board_info username YOUR.USER.NAME >=20 > We can make this pick up the current user by default on at least GNU/Linu= x, > and probably other Unixen: >=20 > set_board_info username $::env(USER) >=20 What does these double colons mean? I use $env(USER), and it works fine. > > + > > +# The ssh key should be correctly set up that you ssh to 127.0.0.1 > > +# without having to type password. > > +set_board_info rsh_prog /usr/bin/ssh > > +set_board_info rcp_prog /usr/bin/scp > > +set_board_info file_transfer "rsh" > >=20 > > + > > +proc ${board}_download { board src dest } { > > + > > + # If file name is a relative, convert it to absolute, otherwise fi= le > > can't + # be found on host, because the current directory usually is > > /home/$USER. + if { [file pathtype $src] =3D=3D "relative" } { > > + return [file join [pwd] $src] > > + } else { > > + return $src > > + } > > +} >=20 > Hmm, so the intention is to bypass the download to the host. I'd like a > small comment above the function that says something to the effect. Yes, with ${board}_download, files are not copied to somewhere else through ssh, so the test is faster. One line of comment is added. How about the new one? --=20 Yao (=E9=BD=90=E5=B0=A7) gdb/testsuite: 2012-07-25 Yao Qi Pedro Alves * boards/local-remote-host.exp: New. --- gdb/testsuite/boards/local-remote-host.exp | 55 ++++++++++++++++++++++++= ++++ 1 files changed, 55 insertions(+), 0 deletions(-) create mode 100644 gdb/testsuite/boards/local-remote-host.exp diff --git a/gdb/testsuite/boards/local-remote-host.exp b/gdb/testsuite/boa= rds/local-remote-host.exp new file mode 100644 index 0000000..d9f6372 --- /dev/null +++ b/gdb/testsuite/boards/local-remote-host.exp @@ -0,0 +1,55 @@ +# Copyright 2012 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# This file is a dejagnu "board file" and is used to run the testsuite +# against local host, in remote host mode. +# +# To use this file: +# bash$ touch ${my_dejagnu_dir}/my-dejagnu.exp +# bash$ export DEJAGNU=3D${my_dejagnu_dir}/my-dejagnu.exp +# bash$ mkdir ${my_dejagnu_dir}/boards +# bash$ cp ${src_dir}/gdb/testsuite/boards/local-remote-host.exp \ +# ${my_dejagnu_dir}/boards + +# Modify the location of GDB and the username to access your box +# below. + +# bash$ cd ${build_dir}/gdb +# bash$ make check RUNTESTFLAGS=3D"--host_board=3Dlocal-remote-host" + +global GDB +set GDB [file join [pwd] "../gdb"] + +set_board_info hostname 127.0.0.1 + +set_board_info username $env(USER) + +# The ssh key should be correctly set up that you ssh to 127.0.0.1 +# without having to type password. +set_board_info rsh_prog /usr/bin/ssh +set_board_info rcp_prog /usr/bin/scp +set_board_info file_transfer "rsh" + +proc ${board}_download { board src dest } { + + # If file name is a relative, convert it to absolute, otherwise file c= an't + # be found on host, because the current directory usually is /home/$US= ER. + # This also bypasses the real download to the host. + if { [file pathtype $src] =3D=3D "relative" } { + return [file join [pwd] $src] + } else { + return $src + } +} --=20 1.7.7.6