This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] testsuite: let find_gdbserver call which before return ""
- From: Pedro Alves <palves at redhat dot com>
- To: Hui Zhu <hui_zhu at mentor dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 29 Mar 2012 10:41:40 +0100
- Subject: Re: [PATCH] testsuite: let find_gdbserver call which before return ""
- References: <4F73EE77.50907@mentor.com>
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