From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id UuX1FVvbwGBIBgAAWB0awg (envelope-from ) for ; Wed, 09 Jun 2021 11:16:43 -0400 Received: by simark.ca (Postfix, from userid 112) id 4A9D91F163; Wed, 9 Jun 2021 11:16:43 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id A49801E813 for ; Wed, 9 Jun 2021 11:16:42 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 594EF3848025 for ; Wed, 9 Jun 2021 15:16:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 594EF3848025 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623251802; bh=MItbl2Dl0qQGVJDt7uj1LQ8jmJ4vrxUMIR09LSK2SJM=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=s81k+6VGOwkJzNMqIhA0iCGla9VS/0enF+nittAfoMvOLRxcVRZn49vyZyhQLYh2m KUiiqty1Jq9X6Um5GsnpvKRD2B6vV1tXuY23oP8TEfHhTDclidpgwCtsgUOFoM7Zmw 1Q1YPfDqIQ2cQW5qBkmxnI0+HlpnGTZE5lRPNFRY= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id B1307398B898 for ; Wed, 9 Jun 2021 15:15:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B1307398B898 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 159FF2eA028161 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 9 Jun 2021 11:15:06 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 159FF2eA028161 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 1F0841E813; Wed, 9 Jun 2021 11:15:02 -0400 (EDT) Subject: Re: [PATCH] gdb/testsuite: capture GDB tty name in default_gdb_spawn To: Tom Tromey , Simon Marchi via Gdb-patches References: <20210608212126.1673188-1-simon.marchi@polymtl.ca> <874ke7jcrv.fsf@tromey.com> Message-ID: <269336aa-5500-c03e-9e00-81279c24e5be@polymtl.ca> Date: Wed, 9 Jun 2021 11:15:01 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <874ke7jcrv.fsf@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Wed, 9 Jun 2021 15:15:02 +0000 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 2021-06-09 11:09 a.m., Tom Tromey wrote: > Simon> + # Capture GDB's TTY name, so we can save it below. > Simon> + rename spawn builtin_spawn > Simon> + rename spawn_capture_tty_name spawn > Simon> + set code [catch {uplevel 1 { > Simon> + remote_spawn host "$::GDB $::INTERNAL_GDBFLAGS $::GDBFLAGS [host_info gdb_opts]" > Simon> + }} res] > Simon> + rename spawn spawn_capture_tty_name > Simon> + rename builtin_spawn spawn > Simon> + > Simon> + # If remote_spawn threw an error, propagate it. > Simon> + if { $code == 1 } { > Simon> + return -code $code -errorinfo $::errorInfo -errorcode $::errorCode $res > Simon> + } > > It would be simpler to just always rename+wrap spawn, and then only > stash the result in this particular case. However, it's also fine this > way. Yeah, I wanted to avoid overriding it all the time, to avoid bad suprises. Although if we don't introduce bugs, it should be fine ;). Simon