aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2008-11-04 20:52:24 +0000
committerPedro Alves <palves@redhat.com>2008-11-04 20:52:24 +0000
commitd3fd534293b3e22ff1aac0e141bb22e99fbbe3c2 (patch)
treed385a0f37a1f84387b0d1b338b46c5c2b5b818a2 /gdb/remote.c
parent1c9f699cd9c816946535115db84ec0d0ce6bf330 (diff)
downloadgdb-d3fd534293b3e22ff1aac0e141bb22e99fbbe3c2.zip
gdb-d3fd534293b3e22ff1aac0e141bb22e99fbbe3c2.tar.gz
gdb-d3fd534293b3e22ff1aac0e141bb22e99fbbe3c2.tar.bz2
* inf-loop.c (inferior_event_handler): On INF_ERROR and
INF_REG_EVENT throwing, don't call target_async or pop_target. Call pop_all_targets_above. * remote.c (remote_close): Call remote_terminal_ours. Don't call signal or target_async.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r--gdb/remote.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/gdb/remote.c b/gdb/remote.c
index a5589f6..f4d6c1f 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -232,6 +232,8 @@ static int peek_stop_reply (ptid_t ptid);
static void remote_async_inferior_event_handler (gdb_client_data);
static void remote_async_get_pending_events_handler (gdb_client_data);
+static void remote_terminal_ours (void);
+
/* The non-stop remote protocol provisions for one pending stop reply.
This is where we keep it until it is acknowledged. */
@@ -2287,18 +2289,15 @@ extended_remote_restart (void)
static void
remote_close (int quitting)
{
- if (remote_desc)
- {
- /* Unregister the file descriptor from the event loop. */
- if (target_is_async_p ())
- target_async (NULL, 0);
- serial_close (remote_desc);
- remote_desc = NULL;
- }
+ if (remote_desc == NULL)
+ return; /* already closed */
- /* Make sure we don't leave the async SIGINT signal handler
- installed. */
- signal (SIGINT, handle_sigint);
+ /* Make sure we leave stdin registered in the event loop, and we
+ don't leave the async SIGINT signal handler installed. */
+ remote_terminal_ours ();
+
+ serial_close (remote_desc);
+ remote_desc = NULL;
/* We don't have a connection to the remote stub anymore. Get rid
of all the inferiors and their threads we were controlling. */