From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9983 invoked by alias); 29 Mar 2012 09:42:05 -0000 Received: (qmail 9966 invoked by uid 22791); 29 Mar 2012 09:42:04 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,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; Thu, 29 Mar 2012 09:41:45 +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 q2T9ff7o000388 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 29 Mar 2012 05:41:41 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q2T9feGS001508; Thu, 29 Mar 2012 05:41:41 -0400 Message-ID: <4F742E54.3040506@redhat.com> Date: Thu, 29 Mar 2012 09:42:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120316 Thunderbird/11.0 MIME-Version: 1.0 To: Hui Zhu CC: gdb-patches@sourceware.org Subject: Re: [PATCH] testsuite: let find_gdbserver call which before return "" References: <4F73EE77.50907@mentor.com> In-Reply-To: <4F73EE77.50907@mentor.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-03/txt/msg00982.txt.bz2 On 03/29/2012 06:09 AM, Hui Zhu wrote: > Hi, > > I got some trouble with testsuite about gdbserver for example: > make check RUNTESTFLAGS="server-run.exp" This should work fine in the case the tests were designed for. To test against the gdbserver that has just been built along the native debugger, under the build/gdb/gdbserver/ directory. Most of these tests are in my TODO for removal/rewriting/moving elsewhere actually. The ones that remain, should be converted to run only when testing against gdbserver, instead of spawning gdbserver when testing the native target. > It will not works because testsuite cannot get gdbserver from find_gdbserver. > In the find_gdbserver, we can find that if didn't find gdbserver from GDBSERVER or gdb_server_prog, it will: So set GDBSERVER or gdb_server_prog. > set gdbserver "${GDB}server" > if { [file isdirectory $gdbserver] } { > append gdbserver "/gdbserver" > } > > if { [file executable $gdbserver] } { > return $gdbserver > } > > But file executable just check the gdbserver in current work directory. No. ${GDB} points at the built gdb binary. So ${GDB}server points at the gdbserver build directory. In that case, when gdbserver is built along gdb, ${GDB}server/gdbserver will point at the gdbserver binary. So it will return "". > > The attachment is a patch that add some code that call "which $gdbserver" after this part. If the reply include $gdbserver and it is executable, return it. Then make check RUNTESTFLAGS="server-run.exp" can work OK now. NAK. This will end up picking the system installed gdbserver that happens to be in the path. Not what you normally want to test. -- Pedro Alves