This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: new-ui and Windows
- From: Pedro Alves <palves at redhat dot com>
- To: Jonah Graham <jonah at kichwacoders dot com>, gdb at sourceware dot org
- Date: Mon, 15 May 2017 23:49:19 +0100
- Subject: Re: new-ui and Windows
- Authentication-results: sourceware.org; auth=none
- 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 at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 66E2DA794
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 66E2DA794
- References: <CAPmGMvivbG706SborUxcYLZ+Zt+0hhS_vdfCDe4PYey0w6zUVg@mail.gmail.com>
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