This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] testsuite: let find_gdbserver call which before return ""


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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]