Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Hui Zhu <hui_zhu@mentor.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] testsuite: let find_gdbserver call which before return ""
Date: Thu, 29 Mar 2012 09:42:00 -0000	[thread overview]
Message-ID: <4F742E54.3040506@redhat.com> (raw)
In-Reply-To: <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


  reply	other threads:[~2012-03-29  9:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-29  5:09 Hui Zhu
2012-03-29  9:42 ` Pedro Alves [this message]
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=4F742E54.3040506@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=hui_zhu@mentor.com \
    /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