From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 76976 invoked by alias); 15 May 2017 22:49:22 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 76958 invoked by uid 89); 15 May 2017 22:49:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=pedro, Pedro, Alves, alves X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 15 May 2017 22:49:20 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 66E2DA794; Mon, 15 May 2017 22:49:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 66E2DA794 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=palves@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 66E2DA794 Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id C28BB5DD6D; Mon, 15 May 2017 22:49:20 +0000 (UTC) Subject: Re: new-ui and Windows To: Jonah Graham , gdb@sourceware.org References: From: Pedro Alves Message-ID: <4c77fe53-dafc-3376-6f00-21e69289e39e@redhat.com> Date: Mon, 15 May 2017 22:49:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-05/txt/msg00007.txt.bz2 On 05/15/2017 01:38 PM, Jonah Graham wrote: > Hello gdb devs, > > I am looking to support the new-ui functionality[1] for Eclipse CDT on > Windows [2]. I have been using it on Linux and have been enjoying it. > Having a full GDB CLI available within Eclipse is a great improvement. Awesome, great to hear. > > I would like to know if new-ui is supposed to work on Windows with > mingw host? The original focus was on GNU/Linux. Even though I/we kept the idea of supporting Windows down the road in mind, we knew there'd likely be more work required to get there. WinPTY takes care of the Windows console<->pty bridging for "free", fortunately, which I think means we're mostly there. > The new-ui attempts to open a tty with > top.c:open_terminal_stream() which calls open(). On Windows, AFAIK, > this can only open a normal file. What kind of file would you like to pass to gdb? My original idea was that on Windows you'd pass down the path to a bidirectional/duplex named pipe, and things would Just Work (TM). Doesn't open() work on such named pipe paths? If not, then the "struct serial" abstraction seems to know about named pipes already (ser-mingw.c), so maybe it'd work to adjust the new-ui code to use serial_open instead. If other kinds of files are more convenient, I'm definitely open to patches teaching gdb about them. > > If this is supposed to work on Windows already, an example of how to > do it would be great. I can take that and see where I can get next. > > Any thoughts much appreciated. The next issue you'll run into is that the new-ui mechanism only really works if the active target backend supports asynchronous debugging. The Linux backends supports it. Windows _remote_ debugging supports it. But Windows _native_ debugging does not (gdb blocks in windows-nat.c -> WaitForDebugEvent). If you're interested, I can guide you in the direction of fixing the latter. Just let me know. Thanks, Pedro Alves