summaryrefslogtreecommitdiff
path: root/gdb/windows-nat.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2013-05-04 13:36:18 +0000
committerEli Zaretskii <eliz@gnu.org>2013-05-04 13:36:18 +0000
commitef40e27e0cee297fac4f7a247ff40f39433fbaf0 (patch)
tree920368a47b97d330a84a7a2e19b8803dfa7f2042 /gdb/windows-nat.c
parent16c0b11b02771012bf4514ba955f681e5994ce3c (diff)
downloadgdb-ef40e27e0cee297fac4f7a247ff40f39433fbaf0.tar.gz
Announce thread death on MS-Windows.
* windows-nat.c (windows_delete_thread): Accept an additional argument, the thread's exit code, and announce thread death when print_thread_events is non-zero and we are deleting a thread that is not the main thread. (get_windows_debug_event): Pass thread exit code to windows_delete_thread.
Diffstat (limited to 'gdb/windows-nat.c')
-rw-r--r--gdb/windows-nat.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index c44314b953f..7eec2cfed61 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -386,7 +386,7 @@ windows_init_thread_list (void)
/* Delete a thread from the list of threads. */
static void
-windows_delete_thread (ptid_t ptid)
+windows_delete_thread (ptid_t ptid, DWORD exit_code)
{
thread_info *th;
DWORD id;
@@ -397,6 +397,9 @@ windows_delete_thread (ptid_t ptid)
if (info_verbose)
printf_unfiltered ("[Deleting %s]\n", target_pid_to_str (ptid));
+ else if (print_thread_events && id != main_thread_id)
+ printf_unfiltered (_("[%s exited with code %u]\n"),
+ target_pid_to_str (ptid), (unsigned)exit_code);
delete_thread (ptid);
for (th = &thread_head;
@@ -1498,7 +1501,8 @@ get_windows_debug_event (struct target_ops *ops,
if (current_event.dwThreadId != main_thread_id)
{
windows_delete_thread (ptid_build (current_event.dwProcessId, 0,
- current_event.dwThreadId));
+ current_event.dwThreadId),
+ current_event.u.ExitThread.dwExitCode);
th = &dummy_thread_info;
}
break;
@@ -1515,7 +1519,8 @@ get_windows_debug_event (struct target_ops *ops,
current_process_handle = current_event.u.CreateProcessInfo.hProcess;
if (main_thread_id)
windows_delete_thread (ptid_build (current_event.dwProcessId, 0,
- main_thread_id));
+ main_thread_id),
+ 0);
main_thread_id = current_event.dwThreadId;
/* Add the main thread. */
th = windows_add_thread (ptid_build (current_event.dwProcessId, 0,