From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta36.uswest2.a.cloudfilter.net (omta36.uswest2.a.cloudfilter.net [35.89.44.35]) by sourceware.org (Postfix) with ESMTPS id AAD89385800D for ; Tue, 12 Dec 2023 20:10:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AAD89385800D 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 AAD89385800D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702411823; cv=none; b=AIQdLUgqB3AdoqRi8OYbc36xqsNXI1WNmFx14aKh3k9+xp1MEqfsEYVEsClkWsymbzPpnbT5bHJsorBEhZPxGWk4P2Xo8Ovb9Udr1jgqsZNywVcNW1C6qZF4pD/NUfqNSLYQdpcBWJaXpkx8LsDJncfpo+aQZTVFtplhDm/MTTI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702411823; c=relaxed/simple; bh=yzdWAZQc5wr2CAgjpdCKt6ugKvwNdWfcrThmY4//V5I=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=hVI5tFLaLFl8AcIIHjUWFIT5HVWs3JYKWC9rW0hS5aZPf/vDd2Sa+iUFqsaSsOMAB6GNjsOUoMvGXnicahn3qTYy/4JAmeuXrap4VCqfbDUjearI0oIXl+vEtYR8qYh6n4buPy0IZiFBwqcFotux8Qkj3f2veICcI3HEdLaHFSo= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6009a.ext.cloudfilter.net ([10.0.30.184]) by cmsmtp with ESMTPS id D5D3rRBThhqFdD95AroYIY; Tue, 12 Dec 2023 20:10:20 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id D95ArGZKkBOccD95ArY0S0; Tue, 12 Dec 2023 20:10:20 +0000 X-Authority-Analysis: v=2.4 cv=J+25USrS c=1 sm=1 tr=0 ts=6578be2c a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=IkcTkHD0fZMA:10 a=e2cXIFwxEfEA:10 a=Qbun_eYptAEA:10 a=20KFwNOVAAAA:8 a=j8mZnVrygGSBmfBTv6MA:9 a=QEXdDO2ut3YA:10 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID: In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To: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=vJNG8njnzES44JteXv3vi4rhTOUCCXOytIPCAiobUL0=; b=dl1/EjT4dnyuXqQwr8lEyGG8p7 Xls6Hpuvh9/fTnlviXrfFjw06ZhJh60TZopWbzs/pYDAwcTE3gmmZZ3Qc3iPwmSBQt5BvT7gF4wT0 czsBqoIBx6Lyw/mPsHvvLXtg0; Received: from 71-211-161-25.hlrn.qwest.net ([71.211.161.25]:52374 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1rD959-002Old-2t; Tue, 12 Dec 2023 13:10:19 -0700 From: Tom Tromey To: Alexandra =?utf-8?B?SMOhamtvdsOh?= Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 4/6] gdbserver/linux-low.cc: Connect the inferior to the terminal References: <20231117111840.2040709-1-ahajkova@redhat.com> <20231117111840.2040709-5-ahajkova@redhat.com> X-Attribution: Tom Date: Tue, 12 Dec 2023 13:10:19 -0700 In-Reply-To: <20231117111840.2040709-5-ahajkova@redhat.com> ("Alexandra =?utf-8?B?SMOhamtvdsOhIidz?= message of "Fri, 17 Nov 2023 12:18:38 +0100") Message-ID: <87msufb2s4.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: 71.211.161.25 X-Source-L: No X-Exim-ID: 1rD959-002Old-2t X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 71-211-161-25.hlrn.qwest.net (murgatroyd) [71.211.161.25]:52374 X-Source-Auth: tom+tromey.com X-Email-Count: 4 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfOLvDIq0SPMcnszubkTe5jofEu/1drTsqSD7c5YeucrQOj7R4nawPcdOsz3QxD8lIWmnadSSXi/AlPJqW2oMCD6WmISX5+nYmKoTZdIa1hL5vku6DMxv b7qYhdfRPlCdsetcwXXX7RqYUDb6640pkWz4jlck8YLlgDLa30mYlBf0VhOIdEF4SSlj7zMvc1PauKitkUgm16ARe/NnT+sUDnc= X-Spam-Status: No, score=-3016.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,JMQ_SPF_NEUTRAL,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: >>>>> "Alexandra" =3D=3D Alexandra H=C3=A1jkov=C3=A1 = writes: Alexandra> --- a/gdbserver/linux-low.cc Alexandra> +++ b/gdbserver/linux-low.cc Alexandra> @@ -952,6 +952,8 @@ linux_process_target::low_new_thread (lwp_in= fo *info) If this feature is Linux-specific then I think there has to be a new target method so that gdbserver doesn't advertise it on platforms where it won't actually work. Alexandra> + if ((fstat(cs.fds[0], &buf) =3D=3D -1) Alexandra> + || (fstat(cs.fds[1], &buf) =3D=3D -1) Alexandra> + || (fstat(cs.fds[2], &buf) =3D=3D -1)) These are over-parenthesized. Alexandra> + write (2, "Fstat failed. Can't connect inferior to the te= rminal.\n", Alexandra> + sizeof ("Fstat failed. Can't connect inferior to t= he terminal.\n") - 1); This looked weird but now I see that other code here does this. Tom