Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] testsuite: let find_gdbserver call which before return ""
@ 2012-03-29  5:09 Hui Zhu
  2012-03-29  9:42 ` Pedro Alves
  0 siblings, 1 reply; 6+ messages in thread
From: Hui Zhu @ 2012-03-29  5:09 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 941 bytes --]

Hi,

I got some trouble with testsuite about gdbserver for example:
make check RUNTESTFLAGS="server-run.exp"
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:
   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. 
  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.

Thanks,
Hui


2012-03-29  Hui Zhu  <hui_zhu@mentor.com>

	* lib/gdbserver-support.exp (find_gdbserver): Add code for
	which gdbserver.

[-- Attachment #2: testsuite-find_gdbserver.txt --]
[-- Type: text/plain, Size: 455 bytes --]

---
 testsuite/lib/gdbserver-support.exp |    9 +++++++++
 1 file changed, 9 insertions(+)

--- a/testsuite/lib/gdbserver-support.exp
+++ b/testsuite/lib/gdbserver-support.exp
@@ -131,6 +131,15 @@ proc find_gdbserver { } {
     return $gdbserver
   }
 
+  spawn -noecho which $gdbserver
+  expect {
+	  -re "$gdbserver" {
+	      if { [file executable $expect_out(buffer)] } {
+	        return $expect_out(buffer)
+	      }
+	  }
+  }
+
   return ""
 }
 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-03-29 14:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-29  5:09 [PATCH] testsuite: let find_gdbserver call which before return "" Hui Zhu
2012-03-29  9:42 ` Pedro Alves
2012-03-29 10:04   ` Hui Zhu
2012-03-29 10:07     ` Pedro Alves
2012-03-29 14:24       ` Hui Zhu
2012-03-29 14:38         ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox