This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Testsuite: Ensure changing directory does not break the log file


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]