From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22023 invoked by alias); 29 Mar 2012 10:04:07 -0000 Received: (qmail 22006 invoked by uid 22791); 29 Mar 2012 10:04:05 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00 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; Thu, 29 Mar 2012 10:03:51 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1SDCCs-000558-6l from Hui_Zhu@mentor.com ; Thu, 29 Mar 2012 03:03:50 -0700 Received: from SVR-ORW-FEM-02.mgc.mentorg.com ([147.34.96.206]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 29 Mar 2012 03:03:18 -0700 Received: from [127.0.0.1] (147.34.91.1) by svr-orw-fem-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server id 14.1.289.1; Thu, 29 Mar 2012 03:03:49 -0700 Message-ID: <4F743382.2020003@mentor.com> Date: Thu, 29 Mar 2012 10:04:00 -0000 From: Hui Zhu User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120310 Thunderbird/11.0 MIME-Version: 1.0 To: Pedro Alves CC: Subject: Re: [PATCH] testsuite: let find_gdbserver call which before return "" References: <4F73EE77.50907@mentor.com> <4F742E54.3040506@redhat.com> In-Reply-To: <4F742E54.3040506@redhat.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit 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-03/txt/msg00984.txt.bz2 Hi Pedro, I agree with what you said. But my patch didn't affect what you want to test, because if ${GDB} is a built gdb binary, which will not return anything, find_gdbserver will keep return "". So only when ${GDB} is gdb, it will works. Thanks, Hui On 03/29/12 17:41, Pedro Alves wrote: > 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. >