This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix a non-stop/remote problem.


I've added the missing call to init_wait_for_inferior call
recently.  But, I was able to run the nonstop tests ran against
gdbserver+non-stop, and that caught a problem of *where* it was
added, as explained in the patch.

Checked in.

-- 
Pedro Alves

2009-03-25  Pedro Alves  <pedro@codesourcery.com>

	* remote.c (remote_start_remote): In non-stop mode, call
	init_wait_for_inferior before adding threads and inferiors.

---
 gdb/remote.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Index: src/gdb/remote.c
===================================================================
--- src.orig/gdb/remote.c	2009-03-25 16:13:56.000000000 +0000
+++ src/gdb/remote.c	2009-03-25 16:18:43.000000000 +0000
@@ -2740,6 +2740,13 @@ remote_start_remote (struct ui_out *uiou
     }
   else
     {
+      /* Clear WFI global state.  Do this before finding about new
+	 threads and inferiors, and setting the current inferior.
+	 Otherwise we would clear the proceed status of the current
+	 inferior when we want its stop_soon state to be preserved
+	 (see notice_new_inferior).  */
+      init_wait_for_inferior ();
+
       /* In non-stop, we will either get an "OK", meaning that there
 	 are no stopped threads at this time; or, a regular stop
 	 reply.  In the latter case, there may be more than one thread
@@ -2800,8 +2807,6 @@ remote_start_remote (struct ui_out *uiou
       /* In non-stop mode, any cached wait status will be stored in
 	 the stop reply queue.  */
       gdb_assert (wait_status == NULL);
-
-      init_wait_for_inferior ();
     }
 
   /* If we connected to a live target, do some additional setup.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]