From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id U+VIDWLu2GqQCQYAWB0awg (envelope-from ) for ; Wed, 21 Oct 2026 12:54:58 -0400 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=uLhzuLcN; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 147401E04D; Wed, 21 Oct 2026 12:54:58 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id D49A21E04D for ; Wed, 21 Oct 2026 12:54:53 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9E8084BA23F4 for ; Wed, 21 Oct 2026 16:54:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9E8084BA23F4 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=uLhzuLcN Received: from omta036.useast.a.cloudfilter.net (omta036.useast.a.cloudfilter.net [44.202.169.35]) by sourceware.org (Postfix) with ESMTPS id A165D4BA2E1B for ; Wed, 21 Oct 2026 16:54:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A165D4BA2E1B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A165D4BA2E1B Authentication-Results: sourceware.org; arc=none smtp.remote-ip=44.202.169.35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1792601661; cv=none; b=uUdj0kNfikI6OaKf1NtmTTs1Po5uldL5V3molX2niltfWTZJoJnCZ9jccsje6H0sBcBq4o/PJNTnnclMlhV0JltNuqSghTb0C7wkc6S5y65kZkG/823TvGBqvGioGLYV90oLYyEG3iVl/CNRBsUh6LHBKvTwETnB4TOT1rE3nQk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1792601661; c=relaxed/simple; bh=4e0YoxAEMhwd+e3BsrdxETDfxtnhnL4SylmxcdFNNzM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=IyUr0TpqQswWj56FwNW2cp8y55I7xJQ5OhdfdwhjpvkqWdfI1bdm9gvXg487MqluM5WImOPif8DC0MB6fDXzGSigfUQJUFZaEAWGNvexPhkJiR/H1VzLMZ4ExyC2V9CCO+rHwa6GeTWKiMzxKjBrztY4KXKe7bwXqfiQbq6WPoY= ARC-Authentication-Results: i=1; sourceware.org; dkim=policy (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=uLhzuLcN reason="signing key too small" DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A165D4BA2E1B Received: from eig-obgw-5004b.ext.cloudfilter.net ([10.0.29.208]) by cmsmtp with ESMTPS id JRvlxi9m4LvgbJZa0x8OnU; Wed, 21 Oct 2026 16:54:20 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id JZa0xBjQ7irxPJZa0xonMH; Wed, 21 Oct 2026 16:54:20 +0000 X-Authority-Analysis: v=2.4 cv=FqoF/3rq c=1 sm=1 tr=0 ts=6ad8ee3c a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=660iZSQnnn4A:10 a=ItBw4LHWJt0A:10 a=1oQS7DvjsHw2gFKGPHwA:9 a=DCx65vhANUyCzuf5D8fC:22 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:Date:References:In-Reply-To :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-Unsubscribe-Post: List-Subscribe:List-Post:List-Owner:List-Archive; bh=htcCkSwC1z+FxYVTicEBhSo3H2IxswkcVjL8+SIiaOs=; b=uLhzuLcNzk979JSITQcKCYiioT nf1NTpfEmm4Xhwskgoqo2so6t7kwqXb5XN2oqzM5ZB4VgPjleanyk1mmC5YbPTbs15FfqMHLrgBPB DY7VtAVxBFZN5lOxR7i1cquJK; Received: from 97-122-110-129.hlrn.qwest.net ([97.122.110.129]:53920 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.100.1) (envelope-from ) id 1xJZZz-000000031A0-2rSo; Wed, 21 Oct 2026 10:54:19 -0600 From: Tom Tromey To: Tom de Vries Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 1/4] [gdb] Add logging_file::fd In-Reply-To: <20261021080120.349861-2-tdevries@suse.de> (Tom de Vries's message of "Wed, 21 Oct 2026 10:01:17 +0200") References: <20261021080120.349861-1-tdevries@suse.de> <20261021080120.349861-2-tdevries@suse.de> X-Attribution: Tom Date: Wed, 21 Oct 2026 10:54:18 -0600 Message-ID: <878q3ryoxx.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.110.129 X-Source-L: No X-Exim-ID: 1xJZZz-000000031A0-2rSo X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-110-129.hlrn.qwest.net (bapiya) [97.122.110.129]:53920 X-Source-Auth: tom+tromey.com X-Email-Count: 12 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfJM4MQACfI0Te/lB+9cYvNGqbExC0QCbH+PICbhxafjXmfgYqG9Sc815H+wmJejn2V2qwe8u2yZiKJq9rTNjPNjSwMmFm4E9+PFe0YqsD2zm9x3eiISE +R+nXFXn38ttIwPf7nxucWa2m+qO/s1SV7/erY4nDfkLKtOvg9q6zRSLvmfdhOH9kCzUH6qbJ5xOLNVDhKVAzcgwS1zOZF41/Ds= X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org >>>>> "Tom" == Tom de Vries writes: Tom> Logging_file is derived from ui_file, which defines a virtual fd member Tom> function: Tom> ... Tom> /* If this object has an underlying file descriptor, then return it. Tom> Otherwise, return -1. */ Tom> virtual int fd () const Tom> { return -1; } Tom> ... Tom> Logging_file doesn't define its own fd, so it defaults to -1. That test in bt-utils.c (and the other one in event-top.c) look weird to me. It does this: if (gdb_stderr == nullptr || gdb_stderr->fd () == -1) std::ignore = ::write (2, msg, strlen (msg)); else gdb_stderr->write_async_safe (msg, strlen (msg)); But why is that -1 check there? Is it because the default ui_file::write_async_safe aborts? Since if so then maybe that's the real issue: the API is kind of incoherent here. I wonder whether we could simply remove the fd() method entirely and instead make the default write_async_safe do something sensible; or make it pure virtual and require the subclasses to DTRT. Tom