summaryrefslogtreecommitdiff
path: root/gdb/remote.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@debian.org>2002-05-14 04:26:25 +0000
committerDaniel Jacobowitz <dan@debian.org>2002-05-14 04:26:25 +0000
commitb38d2a1ef75fa069d5c11abd64b24ebf38bfaeb2 (patch)
tree612cfae538b3847d7dc2f63e90013b0765e5c65d /gdb/remote.c
parent19a0e5c5f18af033f4e019c5383f949b42f57240 (diff)
downloadgdb-b38d2a1ef75fa069d5c11abd64b24ebf38bfaeb2.tar.gz
2002-05-14 Daniel Jacobowitz <drow@mvista.com>
* ser-tcp.c: Include <netinet/udp.h>. Rename tcp_open and tcp_close to net_open and net_close. (net_open): Accept "udp:" and "tcp:" specifications. Connect using UDP if requested. Don't try to disable Nagle on UDP sockets. * remote.c (remote_serial_open): New function. Warn about UDP. (remote_open_1, remote_async_open_1, remote_cisco_open): Call it. 2002-05-14 Daniel Jacobowitz <drow@mvista.com> * gdb.texinfo (Debug Session): Document new `udp:' and `tcp:' options for `target remote'.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r--gdb/remote.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/gdb/remote.c b/gdb/remote.c
index d447f3804f8..c3f40fed1f9 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -2222,6 +2222,26 @@ remote_check_symbols (struct objfile *objfile)
}
}
+static struct serial *
+remote_serial_open (char *name)
+{
+ static int udp_warning = 0;
+
+ /* FIXME: Parsing NAME here is a hack. But we want to warn here instead
+ of in ser-tcp.c, because it is the remote protocol assuming that the
+ serial connection is reliable and not the serial connection promising
+ to be. */
+ if (!udp_warning && strncmp (name, "udp:", 4) == 0)
+ {
+ warning ("The remote protocol may be unreliable over UDP.");
+ warning ("Some events may be lost, rendering further debugging "
+ "impossible.");
+ udp_warning = 1;
+ }
+
+ return serial_open (name);
+}
+
static void
remote_open_1 (char *name, int from_tty, struct target_ops *target,
int extended_p)
@@ -2239,7 +2259,7 @@ remote_open_1 (char *name, int from_tty, struct target_ops *target,
unpush_target (target);
- remote_desc = serial_open (name);
+ remote_desc = remote_serial_open (name);
if (!remote_desc)
perror_with_name (name);
@@ -2337,7 +2357,7 @@ remote_async_open_1 (char *name, int from_tty, struct target_ops *target,
unpush_target (target);
- remote_desc = serial_open (name);
+ remote_desc = remote_serial_open (name);
if (!remote_desc)
perror_with_name (name);
@@ -5463,7 +5483,7 @@ remote_cisco_open (char *name, int from_tty)
unpush_target (&remote_cisco_ops);
- remote_desc = serial_open (name);
+ remote_desc = remote_serial_open (name);
if (!remote_desc)
perror_with_name (name);