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]

[PATCH 5/5] windows-nat: Don't change current_event.dwThreadId in handle_output_debug_string()


Since a Cygwin signal may be reported by a different thread to the thread the
signal is to be delivered to, use the signal target thread id by returning it,
rather than re-writing the thread id in current_event.

Altering current_event.dwThreadId() will cause ContinueDebugEvent() to be
applied to the wrong thread and fail, leaving the actual thread which reported
the debug event stuck in the suspended state.

gdb/ChangeLog:

2015-04-16  Jon Turney  <jon.turney@dronecode.org.uk>

	* windows-nat.c (handle_output_debug_string): Don't change
	current_event.dwThreadId.
	(get_windows_debug_event): Use thread_id, rather than relying on
	current_event.dwThreadId being changed.
---
 gdb/ChangeLog     | 7 +++++++
 gdb/windows-nat.c | 3 +--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 94d295e..9a4276e 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -850,7 +850,6 @@ handle_output_debug_string (struct target_waitstatus *ourstatus)
 					 __COPY_CONTEXT_SIZE, &n)
 		   && n == __COPY_CONTEXT_SIZE)
 	    have_saved_context = 1;
-	  current_event.dwThreadId = retval;
 	}
     }
 #endif
@@ -1508,7 +1507,7 @@ get_windows_debug_event (struct target_ops *ops,
 				  thread_id);
       current_thread = th;
       if (!current_thread)
-	current_thread = thread_rec (current_event.dwThreadId, TRUE);
+	current_thread = thread_rec (thread_id, TRUE);
     }
 
 out:
-- 
2.1.4


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