aboutsummaryrefslogtreecommitdiff
path: root/gdb/serial.c
diff options
context:
space:
mode:
authorJohn Darrington <john@darrington.wattle.id.au>2018-10-13 18:12:01 +0200
committerJohn Darrington <john@darrington.wattle.id.au>2018-10-23 16:09:34 +0200
commit88f5cc8cf8606478832c7d0d7b74755f3f625015 (patch)
tree5992356e148c9913017faeaf56504692f730579d /gdb/serial.c
parent0a163825df5e98ad55de13eb3d3534d875943047 (diff)
downloadgdb-88f5cc8cf8606478832c7d0d7b74755f3f625015.zip
gdb-88f5cc8cf8606478832c7d0d7b74755f3f625015.tar.gz
gdb-88f5cc8cf8606478832c7d0d7b74755f3f625015.tar.bz2
GDB: Remote target can now accept the form unix::/path/to/socket.
Allow target remote to use the unix::/path/to/socket syntax as well as just plain /path/to/socket gdb/ * ser-uds.c (uds_open): Use parse_connection_spec to deal with the comm form unix::/path/to/socket. * serial.c (serial_open): Consider the "unix:" prefix when deciding which interface to use.
Diffstat (limited to 'gdb/serial.c')
-rw-r--r--gdb/serial.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/serial.c b/gdb/serial.c
index 7f9362a..f7c3e6e 100644
--- a/gdb/serial.c
+++ b/gdb/serial.c
@@ -210,7 +210,7 @@ serial_open (const char *name)
/* Check for a colon, suggesting an IP address/port pair.
Do this *after* checking for all the interesting prefixes. We
don't want to constrain the syntax of what can follow them. */
- else if (strchr (name, ':'))
+ else if (!startswith (name, "unix:") && (strchr (name, ':')))
ops = serial_interface_lookup ("tcp");
else
{
@@ -218,7 +218,8 @@ serial_open (const char *name)
/* Check to see if name is a socket. If it is, then treat it
as such. Otherwise assume that it's a character device. */
struct stat sb;
- if (stat (name, &sb) == 0 && (sb.st_mode & S_IFMT) == S_IFSOCK)
+ if (startswith (name, "unix:") ||
+ (stat (name, &sb) == 0 && (sb.st_mode & S_IFMT) == S_IFSOCK))
ops = serial_interface_lookup ("local");
else
#endif