aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote.c
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1993-09-03 14:26:29 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1993-09-03 14:26:29 +0000
commitac7a377f64a19b1bda507a6aecaaab3f81f7ebbb (patch)
treece5247ccd5902c18fb279ee0640da24931dbcf36 /gdb/remote.c
parenteba94f7d0d4ba3d9868c2ae9829b61cab96b344e (diff)
downloadgdb-ac7a377f64a19b1bda507a6aecaaab3f81f7ebbb.zip
gdb-ac7a377f64a19b1bda507a6aecaaab3f81f7ebbb.tar.gz
gdb-ac7a377f64a19b1bda507a6aecaaab3f81f7ebbb.tar.bz2
* dcache.c: Cast return value from xmalloc.
* remote.c: Move setting of immediate_quit from remote_open to remote_start_dummy and set it back to zero when done.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r--gdb/remote.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gdb/remote.c b/gdb/remote.c
index 6041b44..f9d04f4 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -238,11 +238,14 @@ static int
remote_start_remote (dummy)
char *dummy;
{
+ immediate_quit = 1; /* Allow user to interrupt it */
+
/* Ack any packet which the remote side has already sent. */
/* I'm not sure this \r is needed; we don't use it any other time we
send an ack. */
SERIAL_WRITE (remote_desc, "+\r", 2);
putpkt ("?"); /* initiate a query from remote machine */
+ immediate_quit = 0;
start_remote (); /* Initialize gdb process mechanisms */
return 1;
@@ -295,8 +298,9 @@ device is attached to the remote system (e.g. /dev/ttya).");
}
push_target (&remote_ops); /* Switch to using remote target now */
- /* Start the remote connection; if error (0), discard this target. */
- immediate_quit++; /* Allow user to interrupt it */
+ /* Start the remote connection; if error (0), discard this target.
+ In particular, if the user quits, be sure to discard it
+ (we'd be in an inconsistent state otherwise). */
if (!catch_errors (remote_start_remote, (char *)0,
"Couldn't establish connection to remote target\n", RETURN_MASK_ALL))
pop_target();