2006-01-16 Amdrew Stubbs * gdbthread.h (prune_threads): Add prototype. * infrun.c (normal_stop): Call prune_threads(). * thread.c (prune_threads): Remove 'static'. Index: src/gdb/gdbthread.h =================================================================== --- src.orig/gdb/gdbthread.h 2006-01-16 16:08:57.000000000 +0000 +++ src/gdb/gdbthread.h 2006-01-16 16:13:57.000000000 +0000 @@ -80,6 +80,9 @@ extern struct thread_info *add_thread (p /* Delete an existing thread list entry. */ extern void delete_thread (ptid_t); +/* Delete all dead threads from the list. */ +extern void prune_threads (void); + /* Delete a step_resume_breakpoint from the thread database. */ extern void delete_step_resume_breakpoint (void *); Index: src/gdb/infrun.c =================================================================== --- src.orig/gdb/infrun.c 2006-01-16 16:08:57.000000000 +0000 +++ src/gdb/infrun.c 2006-01-16 16:13:57.000000000 +0000 @@ -3037,6 +3037,9 @@ Further execution is probably impossible if (stopped_by_random_signal) disable_current_display (); + /* Delete any threads which have died. */ + prune_threads (); + /* Don't print a message if in the middle of doing a "step n" operation for n > 1 */ if (step_multi && stop_step) Index: src/gdb/thread.c =================================================================== --- src.orig/gdb/thread.c 2006-01-16 16:08:57.000000000 +0000 +++ src/gdb/thread.c 2006-01-16 16:13:57.000000000 +0000 @@ -64,7 +64,6 @@ static void info_threads_command (char * static void thread_apply_command (char *, int); static void restore_current_thread (ptid_t); static void switch_to_thread (ptid_t ptid); -static void prune_threads (void); void delete_step_resume_breakpoint (void *arg) @@ -382,7 +381,7 @@ thread_alive (struct thread_info *tp) return 1; } -static void +void prune_threads (void) { struct thread_info *tp, *next;