new-ui and Windows

Jonah Graham jonah@kichwacoders.com
Tue May 16 08:52:00 GMT 2017


On 15 May 2017 at 23:49, Pedro Alves <palves@redhat.com> wrote:
> On 05/15/2017 01:38 PM, Jonah Graham wrote:

Thanks Pedro and Eli. I now have good information to get started on this.

> 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.

AFAICT the current Eclipse CDT support for PTY (based on an older
version of WinPTY) works well for the CLI connection. Upgrading WinPTY
in CDT would be a nice to have, especially if we run into problems.

>> 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.

The example from the original patch for Linux was very useful. I will
now try to create a simple (independent of Eclipse) example for
Windows.

>> 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.

My primary focus is on embedded developers using Eclipse CDT, so
Windows native development is a lower priority for now. Cygwin and
MSYS2 are shipping GDB 7.11 so far, so there is no easy path for those
users to access the feature yet anyway. ARM's latest release on the
other hand is shipping with mingw built GDB 7.12:
https://developer.arm.com/open-source/gnu-toolchain/gnu-rm I also have
not started looking at how to support Cygwin/MSYS2 GDBs which do have
support for PTY's through the emulation layer.

Thanks for the help and advice,
Jonah



More information about the Gdb mailing list