Andrew STUBBS wrote: > Now onto figuring out why it doesn't work.... The smoking gun seems to be here: [From linux-thread-db.c] static void detach_thread (ptid_t ptid, int verbose) { struct thread_info *thread_info; if (verbose) printf_unfiltered (_("[%s exited]\n"), target_pid_to_str (ptid)); /* Don't delete the thread now, because it still reports as active until it has executed a few instructions after the event breakpoint - if we deleted it now, "info threads" would cause us to re-attach to it. Just mark it as having had a TD_DEATH event. This means that we won't delete it from our thread list until we notice that it's dead (via prune_threads), or until something re-uses its thread ID. */ thread_info = find_thread_pid (ptid); gdb_assert (thread_info != NULL); thread_info->private->dying = 1; } The attached patch fixes the problem, but I don't know if it does it the best way. What do you think? Andrew Stubbs