From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 70601 invoked by alias); 21 Feb 2019 22:40:26 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 70415 invoked by uid 89); 21 Feb 2019 22:40:23 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=3.1 required=5.0 tests=BAYES_00,KAM_SHORT,KAM_TK,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=UD:tk, gross, HX-Local-Domain:yes, UD:htm X-HELO: gateway36.websitewelcome.com Received: from gateway36.websitewelcome.com (HELO gateway36.websitewelcome.com) (192.185.201.2) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 21 Feb 2019 22:40:21 +0000 Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway36.websitewelcome.com (Postfix) with ESMTP id 73E82400D8A21 for ; Thu, 21 Feb 2019 15:55:01 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id wx0ugfEaN2PzOwx0ug7OW1; Thu, 21 Feb 2019 16:40:20 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ajUlXCazKdS+lVpptzh097CFoZYJG3gG31R+4vgXR+g=; b=rFdfz6Ia70x+YXg7PHOt+GT7dT nFHIIt/w04j0rHzLOlyBzaTKdms92Wp94OfMh1Fmm0GehObMbVprkjSbr2D216E8xhlrxFxu9AwGX dYPV2ywrlX1zSoiE3+wlG3Ubt; Received: from 75-166-72-210.hlrn.qwest.net ([75.166.72.210]:46638 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1gwx0t-000jsj-SL; Thu, 21 Feb 2019 16:40:19 -0600 From: Tom Tromey To: Alan Hayward Cc: "gdb-patches\@sourceware.org" , nd Subject: Re: [PATCH] Testsuite: Ensure changing directory does not break the log file References: <20190221103420.18162-1-alan.hayward@arm.com> Date: Thu, 21 Feb 2019 22:40:00 -0000 In-Reply-To: <20190221103420.18162-1-alan.hayward@arm.com> (Alan Hayward's message of "Thu, 21 Feb 2019 10:34:29 +0000") Message-ID: <878sy8bwa5.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2019-02/txt/msg00355.txt.bz2 >>>>> "Alan" == Alan Hayward 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