Re: [PATCH] Allow remote debugging over a local domain socket

Tom Tromey
2018-08-31T15:10:16Z

>>>>> "John" == John Darrington <john@darrington.wattle.id.au> writes:

John> Extend the "target remote" and "target extended-remote" commands
John> such that if the filename provided is a unix domain (AF_UNIX)
John> socket, then it'll be treated as such, instead of trying to open
John> it as if it were a character device.

Thanks for the patch.
This looks essentially reasonable to me.

John> +/* Open a AF_UNIX socket. */
John> +int
John> +socket_open (struct serial *scb, const char *name)
John> +{

It seems to me that all the functions in this file could be static.
This might necessitate wrapping many of them in "#ifndef USE_WIN32API"
to avoid warnings about unused code, but that seems like an improvement
as well.

John> +int
John> +ser_socket_send_break (struct serial *scb)
John> +{
John> + /* Send telnet IAC and BREAK characters. */
John> + return (serial_write (scb, "\377\363", 2));
John> +}

I don't really know what's expected here, but is this correct?

John> diff --git a/gdb/ser-socket.h b/gdb/ser-socket.h
John> new file mode 100644
John> index 0000000000..58509302d6
John> --- /dev/null
John> +++ b/gdb/ser-socket.h

You could just drop this file entirely.

Tom