aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2018-10-29 13:22:47 -0400
committerSimon Marchi <simon.marchi@ericsson.com>2018-10-29 13:22:47 -0400
commit431f22cc098a118a862412c1bac1a8aa1bc6ceb7 (patch)
treecd7aab111d346273eef3da089f65055b7fffed10
parent7f53228719a0111e41c66da6c9c3b2ed1fd2aab9 (diff)
downloadgdb-431f22cc098a118a862412c1bac1a8aa1bc6ceb7.zip
gdb-431f22cc098a118a862412c1bac1a8aa1bc6ceb7.tar.gz
gdb-431f22cc098a118a862412c1bac1a8aa1bc6ceb7.tar.bz2
Revert "GDB: Remote target can now accept the form unix::/path/to/socket."
This reverts commit 88f5cc8cf8606478832c7d0d7b74755f3f625015.
-rw-r--r--gdb/ser-uds.c18
-rw-r--r--gdb/serial.c5
2 files changed, 4 insertions, 19 deletions
diff --git a/gdb/ser-uds.c b/gdb/ser-uds.c
index acace25..a98469f 100644
--- a/gdb/ser-uds.c
+++ b/gdb/ser-uds.c
@@ -23,8 +23,6 @@
#include <sys/socket.h>
#include <sys/un.h>
-#include <netdb.h>
-#include "netstuff.h"
#ifndef UNIX_PATH_MAX
#define UNIX_PATH_MAX sizeof(((struct sockaddr_un *) NULL)->sun_path)
@@ -35,21 +33,9 @@
static int
uds_open (struct serial *scb, const char *name)
{
- struct addrinfo hint;
-
- memset (&hint, 0, sizeof (hint));
- /* Assume no prefix will be passed, therefore we should use
- AF_UNSPEC. */
- hint.ai_family = AF_UNSPEC;
- hint.ai_socktype = SOCK_STREAM;
-
- parsed_connection_spec parsed = parse_connection_spec (name, &hint);
-
- const char *socket_name = parsed.port_str.empty() ? name : parsed.port_str.c_str ();
-
struct sockaddr_un addr;
- if (strlen (socket_name) > UNIX_PATH_MAX - 1)
+ if (strlen (name) > UNIX_PATH_MAX - 1)
{
warning
(_("The socket name is too long. It may be no longer than %s bytes."),
@@ -59,7 +45,7 @@ uds_open (struct serial *scb, const char *name)
memset (&addr, 0, sizeof addr);
addr.sun_family = AF_UNIX;
- strncpy (addr.sun_path, socket_name, UNIX_PATH_MAX - 1);
+ strncpy (addr.sun_path, name, UNIX_PATH_MAX - 1);
int sock = socket (AF_UNIX, SOCK_STREAM, 0);
diff --git a/gdb/serial.c b/gdb/serial.c
index f7c3e6e..7f9362a 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 (!startswith (name, "unix:") && (strchr (name, ':')))
+ else if (strchr (name, ':'))
ops = serial_interface_lookup ("tcp");
else
{
@@ -218,8 +218,7 @@ 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 (startswith (name, "unix:") ||
- (stat (name, &sb) == 0 && (sb.st_mode & S_IFMT) == S_IFSOCK))
+ if (stat (name, &sb) == 0 && (sb.st_mode & S_IFMT) == S_IFSOCK)
ops = serial_interface_lookup ("local");
else
#endif