public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Shahab Vahedi <shahab.vahedi@gmail.com>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org, Shahab Vahedi <shahab@synopsys.com>,
	Francois Bedard <fbedard@synopsys.com>
Subject: Re: [PATCH] gdb/testsuite: Regenerate the testglue if it is not in path
Date: Tue, 11 Feb 2020 16:52:00 -0000	[thread overview]
Message-ID: <20200211165216.GA23086@gmail.com> (raw)
In-Reply-To: <87zhdp876w.fsf@tromey.com>

On Tue, Feb 11, 2020 at 08:39:03AM -0700, Tom Tromey wrote:
> >>>>> "Shahab" == Shahab Vahedi <shahab.vahedi@gmail.com> writes:
> 
> Shahab> For running the  DejaGnu  tests,  some  esoteric  configurations
> Shahab> may require a testglue.
> 
> Thank you for the patch.  I wasn't aware of this code at all :-)
> 
> Shahab> This patch checks if the wrapper file ("gdb_tg.o") is  still  in
> Shahab> reach and if it is not, it will stimulate the generation of  the
> Shahab> wrapper again.
> 
> I wonder if it would make sense to instead set gdb_wrapper_file to the
> absolute path.

This is how "gdb_wrapper_file" is set in gdb/testsuite/lib/gdb.exp:

  proc gdb_wrapper_init { args } {
  ...
  global gdb_wrapper_file
  ...
      set result [build_wrapper "testglue.o"]
      if { $result != "" } {
          set gdb_wrapper_file [lindex $result 0]
          ...
  }

The "build_wrapper" is a procedure form DejaGnu  itself  (libgloss.exp),
and it does not provide the full path.  Maybe we  can  get  the  current
working directory from somewhere else and append it here?

> It could perhaps be put in the cache directory.  This might help avoid
> recompiling it many times when running the tests in parallel.
> 
> What do you think of that?

I absolutely like this idea and believe this is how it should  be  done,
but am not sure where to begin. Any pointers?

> 
> Shahab> +    # if the wrapper is initialized but the wrapper file cannot be
> 
> GNU style is to start a comment with an upper-case letter, so "If".

I will fix this in next patch (whatever approach we take).

> 
> Shahab> +    # found anymore, the wrapper file must be built again.
> Shahab> +    if { $gdb_wrapper_initialized == 1 && \
> Shahab> +	    [info exists gdb_wrapper_file] && \
> Shahab> +	    ![file exists $gdb_wrapper_file] } {
> Shahab> +	verbose "reinitializing the wrapper"
> Shahab> +	set gdb_wrapper_initialized 0
> Shahab> +    }
> Shahab> +
> Shahab>      if { $gdb_wrapper_initialized == 0 } { gdb_wrapper_init }
> 
> If you don't like the absolute path idea, maybe just having all this
> logic be in the wrapper code would be better, and this could just call
> gdb_wrapper_init unconditionally.

I agree with your suggestion and if we opt for  this  approach,  I  will
adapt it as such.

> 
> Tom

Cheers,
Shahab

  reply	other threads:[~2020-02-11 16:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-11 13:37 Shahab Vahedi
2020-02-11 15:41 ` Tom Tromey
2020-02-11 16:52   ` Shahab Vahedi [this message]
2020-02-18 11:51 ` [PATCH v2] " Shahab Vahedi
2020-02-19  3:10   ` Simon Marchi
2020-02-19 21:16     ` Tom Tromey
2020-02-19 15:11 ` [PATCH v3] gdb/testsuite: Regenerate the testglue if it is not in Shahab Vahedi
2020-02-19 21:29   ` Tom Tromey

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=20200211165216.GA23086@gmail.com \
    --to=shahab.vahedi@gmail.com \
    --cc=fbedard@synopsys.com \
    --cc=gdb-patches@sourceware.org \
    --cc=shahab@synopsys.com \
    --cc=tom@tromey.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).