From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id YDWxKXGEd1/vNQAAWB0awg (envelope-from ) for ; Fri, 02 Oct 2020 15:50:09 -0400 Received: by simark.ca (Postfix, from userid 112) id 9D2DE1EF44; Fri, 2 Oct 2020 15:50:09 -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 E75001E4B5 for ; Fri, 2 Oct 2020 15:50:08 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2E211386EC3E; Fri, 2 Oct 2020 19:50:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2E211386EC3E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1601668208; bh=k6V+y3zLWL+fWtZbOPWxLZgYWjCOFk/7+1pfuI91RPc=; h=Date:To:In-Reply-To:Subject:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=pqW0q01pSmaeejXCqClB/Ys6ZMWott1XqxVNfThqQRZJ4QPqLPEkEGNVLj57tB8Zi qMFF4h4UfunaQ4nnjncMNB7t+OHgs3904+H3a985Aacn5/6QbQWopbyNaBLaxvwf0e S+B90eZCFc+R51wJDySwtr561yzw/QAjls9cSpHk= Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 505CC386EC3E for ; Fri, 2 Oct 2020 19:50:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 505CC386EC3E Received: from fencepost.gnu.org ([2001:470:142:3::e]:39128) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kOR48-0001nh-Dk; Fri, 02 Oct 2020 15:50:04 -0400 Received: from [176.228.60.248] (port=2757 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kOR46-0001MR-IA; Fri, 02 Oct 2020 15:50:03 -0400 Date: Fri, 02 Oct 2020 22:50:01 +0300 Message-Id: <83h7rce7bq.fsf@gnu.org> To: Roy Qu In-Reply-To: (message from Roy Qu on Sat, 3 Oct 2020 00:22:46 +0800) Subject: Re: the redirected stdin/out/err for new console is wrong when the gdb's stdin/out/err is already redirected References: <83a6xam5uv.fsf@gnu.org> <83blhkg6v1.fsf@gnu.org> <83zh54el8g.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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: Eli Zaretskii via Gdb-patches Reply-To: Eli Zaretskii Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" [Please use Reply All to reply, so that the list is CC'ed.] > From: Roy Qu > Date: Sat, 3 Oct 2020 00:22:46 +0800 > > Eli Zaretskii 于2020年10月2日周五 下午10:49写道: > > [Please use Reply All to reply, so that the list is CC'ed.] Please do, you continue replying only to me, which requires me to quote the entire message sent by you to the list, and also prevents others from replying in a timely manner. > > > From: Roy Qu > > Date: Fri, 2 Oct 2020 21:58:13 +0800 > > > > > https://stackoverflow.com/questions/30494945/createprocess-with-new-console-window-but-override-some-std-i-o-handles > > > > > Point 1.You are right, NULL doesn't work under windows 7. > > So we need a better solution here. > > OK. > > > Point 2. When GDB's standard output is not redirected (started in console) , the inferior's ouput will > go to it's > > own console, not the gdb's console. > > Really? I thought this happens only if you say > > (gdb) set new-console 1 > > If I'm wrong, then where is the code which causes that other console > to be created for the inferior? > > Yes. Can we add a check here to see if there should be a new console ? Probably, but I hope someone else will explain how to do that. And if we do have such a test, how will that affect the issue you would like to solve? Does the problem only happen when the inferior has a separate console?