aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote-mips.c
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1994-01-22 19:16:02 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1994-01-22 19:16:02 +0000
commit864df7e6f35f352b139061a7d0546c002067e507 (patch)
tree2003713749acd81e391d78bd76fc9bc76e4076b2 /gdb/remote-mips.c
parent08f74b9271bc22a0e0a55707f18b23778d25be1e (diff)
downloadfsf-binutils-gdb-864df7e6f35f352b139061a7d0546c002067e507.zip
fsf-binutils-gdb-864df7e6f35f352b139061a7d0546c002067e507.tar.gz
fsf-binutils-gdb-864df7e6f35f352b139061a7d0546c002067e507.tar.bz2
* remote-mips.c (mips_initialize): Clear mips_initializing via
cleanup chain, not directly. * ser-unix.c (wait_for) [HAVE_TERMIO, HAVE_TERMIOS]: Make a timeout of -1 mean forever, like in the HAVE_SGTTY case. Warn if we are munging the timeout due to the limited range of c_cc[VTIME].
Diffstat (limited to 'gdb/remote-mips.c')
-rw-r--r--gdb/remote-mips.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c
index 02310b3..23e89f4 100644
--- a/gdb/remote-mips.c
+++ b/gdb/remote-mips.c
@@ -888,6 +888,13 @@ mips_request (cmd, addr, data, perr, timeout)
return rresponse;
}
+static void
+mips_initialize_cleanups (arg)
+ PTR arg;
+{
+ mips_initializing = 0;
+}
+
/* Initialize a new connection to the MIPS board, and make sure we are
really connected. */
@@ -897,9 +904,16 @@ mips_initialize ()
char cr;
char buff[DATA_MAXLEN + 1];
int err;
+ struct cleanup *old_cleanups = make_cleanup (mips_initialize_cleanups, NULL);
+ /* What is this code doing here? I don't see any way it can happen, and
+ it might mean mips_initializing didn't get cleared properly.
+ So I'll make it a warning. */
if (mips_initializing)
- return;
+ {
+ warning ("internal error: mips_initialize called twice");
+ return;
+ }
mips_initializing = 1;
@@ -929,7 +943,7 @@ mips_initialize ()
}
mips_receive_packet (buff, 1, 3);
- mips_initializing = 0;
+ do_cleanups (old_cleanups);
/* If this doesn't call error, we have connected; we don't care if
the request itself succeeds or fails. */