+2014-01-08 Pedro Alves <palves@redhat.com>
+
+ * server.c (handle_status): Don't discard previous queued stop
+ replies or thread's pending status here.
+ (main) <disconnection>: Do it here instead.
+
2014-01-08 Pedro Alves <palves@redhat.com>
* gdbthread.h (struct thread_info) <status_pending_p>: New field.
/* GDB is connected, don't forward events to the target anymore. */
for_each_inferior (&all_processes, gdb_reattached_process);
- discard_queued_stop_replies (-1);
- for_each_inferior (&all_threads, clear_pending_status_callback);
-
/* In non-stop mode, we must send a stop reply for each stopped
thread. In all-stop mode, just send one for the first stopped
thread we find. */
"Remote side has terminated connection. "
"GDBserver will reopen the connection.\n");
+ /* Get rid of any pending statuses. An eventual reconnection
+ (by the same GDB instance or another) will refresh all its
+ state from scratch. */
+ discard_queued_stop_replies (-1);
+ for_each_inferior (&all_threads, clear_pending_status_callback);
+
if (tracing)
{
if (disconnected_tracing)