Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Hui Zhu <hui_zhu@mentor.com>
To: <gdb-patches@sourceware.org>
Subject: [PATCH] testsuite: let find_gdbserver call which before return ""
Date: Thu, 29 Mar 2012 05:09:00 -0000	[thread overview]
Message-ID: <4F73EE77.50907@mentor.com> (raw)

[-- 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 ""
 }
 

             reply	other threads:[~2012-03-29  5:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-29  5:09 Hui Zhu [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F73EE77.50907@mentor.com \
    --to=hui_zhu@mentor.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox