From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11807 invoked by alias); 24 Jul 2012 16:08:58 -0000 Received: (qmail 11330 invoked by uid 22791); 24 Jul 2012 16:08:52 -0000 X-SWARE-Spam-Status: No, hits=-7.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 24 Jul 2012 16:08:33 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6OG8SjC004547 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 24 Jul 2012 12:08:28 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q6OG8Q1N021153; Tue, 24 Jul 2012 12:08:27 -0400 Message-ID: <500EC87A.10806@redhat.com> Date: Tue, 24 Jul 2012 16:08:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: Yao Qi CC: gdb-patches@sourceware.org Subject: Re: [RFC] new board file 'remote-host-native.exp' References: <1343135426-20959-1-git-send-email-yao@codesourcery.com> In-Reply-To: <1343135426-20959-1-git-send-email-yao@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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/msg00486.txt.bz2 On 07/24/2012 02:10 PM, Yao Qi wrote: > Hi, when fixing other PR, I need to make sure test case running well on > 'remote host' as well. I write a new board file remote-host-native.exp > so that we can run gdb testsuite in 'remote-host' locally. > > When run testsuite for 'remote-host', I get following error, > > ERROR: tcl error sourcing ../../../../git/gdb/testsuite/gdb.base/break.exp. > ERROR: wrong # args: should be "gdb_download filename" > while executing > "gdb_download "remote-host" ../../../../git/gdb/testsuite/gdb.base/break.c break.c" > ("eval" body line 1) > invoked from within > "eval ${try}_${proc} \"$dest\" $args" > (procedure "call_remote" line 66) > invoked from within > "call_remote "" download $dest $file $destfile" > (procedure "remote_download" line 30) > invoked from within > "remote_download host $x" > (procedure "default_target_compile" line 323) > invoked from within > "default_target_compile $source $destfile $type $options" > (procedure "target_compile" line 6) > invoked from within > "target_compile $source $dest $type $options" > (procedure "gdb_compile" line 142) > invoked from within > "gdb_compile "${srcdir}/${subdir}/${s}" "${binfile}${i}.o" object $options" > > As we can see, dejagnu looks proc ${board}_download, and matches gdb_download. However, I'm confused at why ${board} expanded to gdb, the tool. > we can't simply change the parameters of gdb_download to meet the required parameters. > This will cause an endless recurisive call "remote_download->call_remote->gdb_download > ->remote_download". This patch simply renames this proc to gdb_download_1. > > As this patch applied, there are a lot of fails when running testsuite with > board file remote-host-native.exp. Some of them are intermittent, and > some of them reflect the flaws in test cases. > > gdb/testsuite: > > 2012-07-24 Yao Qi > > * boards/remote-host-native.exp: New board file. > * lib/gdb.exp: Rename gdb_downlad to gdb_download_1. > (gdb_load_shlibs): Caller update. > * lib/gdbserver-support.exp (gdbserver_download_current_prog): > Likewise. > * lib/mi-support.exp (mi_load_shlibs): Likewise. > * gdb.base/jit-so.exp, gdb.base/jit.exp: Likewise. > --- > gdb/testsuite/boards/remote-host-native.exp | 60 +++++++++++++++++++++++++++ > gdb/testsuite/gdb.base/jit-so.exp | 2 +- > gdb/testsuite/gdb.base/jit.exp | 2 +- > gdb/testsuite/lib/gdb.exp | 6 +- > gdb/testsuite/lib/gdbserver-support.exp | 2 +- > gdb/testsuite/lib/mi-support.exp | 2 +- > 6 files changed, 67 insertions(+), 7 deletions(-) > create mode 100644 gdb/testsuite/boards/remote-host-native.exp > > diff --git a/gdb/testsuite/boards/remote-host-native.exp b/gdb/testsuite/boards/remote-host-native.exp > new file mode 100644 > index 0000000..cdb0684 > --- /dev/null > +++ b/gdb/testsuite/boards/remote-host-native.exp > @@ -0,0 +1,60 @@ > +# 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 > +# natively in remote host. Why natively? I'd think you could use both this host board with e.g., a gdbserver target board file. I suggest: +# This file is a dejagnu "board file" and is used to run the testsuite +# against local host, in remote host mode. I'd even rename the file to local-remote-host.exp. > +# > +# To use this file: > +# bash$ touch ${my_dejagnu_dir}/my-dejagnu.exp > +# bash$ export DEJAGNU=${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="--host_board=remote-host-native" > + > +load_generic_config "gdb" 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. > + > +set_board_info gdb_protocol "standard" Why is this necessary? A host board file should only specify the bits for downloading and executing bits on the host, I think. > + > +global GDB > +# Specify the location of GDB binary. > +set GDB "/your/built/gdb" How about we make this pick up the just built GDB ? set GDB [file join [pwd] "../gdb"] > + > +set_board_info compiler "[find_gcc]" Is this necessary in a host board file? > +set_board_info hostname 127.0.0.1 > + > +set_board_info username YOUR.USER.NAME We can make this pick up the current user by default on at least GNU/Linux, and probably other Unixen: 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 can't > + # be found on host, because the current directory usually is /home/$USER. > + if { [file pathtype $src] == "relative" } { > + return [file join [pwd] $src] > + } else { > + return $src > + } > +} 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. > diff --git a/gdb/testsuite/gdb.base/jit-so.exp b/gdb/testsuite/gdb.base/jit-so.exp > index 36f18ad..95c2eac 100644 > --- a/gdb/testsuite/gdb.base/jit-so.exp > +++ b/gdb/testsuite/gdb.base/jit-so.exp > @@ -61,7 +61,7 @@ if { [gdb_compile_shlib ${solib_srcfile} ${solib_binfile} {}] != "" } { > return -1 > } > > -set solib_binfile_target [gdb_download ${solib_binfile}] > +set solib_binfile_target [gdb_download_1 ${solib_binfile}] Someone might well in the future notice there's a "gdb_download_1" overload but no "gdb_download", and decide to "clean up" things by renaming "gdb_download_1" back to "gdb_download"... I'd prefer a better name. But, in any case, I'm confused at why this board trips on this, while other remote host testing CS does, does not. -- Pedro Alves