From: Tom Tromey <tom@tromey.com>
To: Alan Hayward <Alan.Hayward@arm.com>
Cc: "gdb-patches\@sourceware.org" <gdb-patches@sourceware.org>,
nd <nd@arm.com>
Subject: Re: [PATCH] Testsuite: Ensure changing directory does not break the log file
Date: Thu, 21 Feb 2019 22:40:00 -0000 [thread overview]
Message-ID: <878sy8bwa5.fsf@tromey.com> (raw)
In-Reply-To: <20190221103420.18162-1-alan.hayward@arm.com> (Alan Hayward's message of "Thu, 21 Feb 2019 10:34:29 +0000")
>>>>> "Alan" == Alan Hayward <Alan.Hayward@arm.com> writes:
Alan> get_compiler_info switches to a new log file before checking the compiler
Alan> to ensure the checks are not logged.
Haha, that seems pretty gross.
Alan> The simpler and safer solution is to override the builtin cd function. The
Alan> new function checks the current log file and if the path is relative, then
Alan> it resets the logging using an absolute path. Finally it calls the builtin
Alan> cd. This ensures get_compiler_info (and any other code) can correctly
Alan> backup and restore the current log file.
Makes sense to me.
Alan> + if { [regexp "^-a \[^/\]" $saved_log match] } {
It may be better here to just extract the file name and either use "file normalize"
(could be done unconditionally) or look at it with "file pathtype".
See https://www.tcl.tk/man/tcl8.4/TclCmd/file.htm
Tom
next prev parent reply other threads:[~2019-02-21 22:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-21 10:34 Alan Hayward
2019-02-21 22:40 ` Tom Tromey [this message]
2019-02-22 12:36 ` Alan Hayward
2019-02-22 14:21 ` Pedro Alves
2019-02-22 17:10 ` Alan Hayward
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=878sy8bwa5.fsf@tromey.com \
--to=tom@tromey.com \
--cc=Alan.Hayward@arm.com \
--cc=gdb-patches@sourceware.org \
--cc=nd@arm.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