* bsd-uthread.c (bsd_uthread_wait): Don't try to fetch thread IDs
authorMark Kettenis <kettenis@gnu.org>
Fri, 6 Jul 2007 11:39:44 +0000 (11:39 +0000)
committerMark Kettenis <kettenis@gnu.org>
Fri, 6 Jul 2007 11:39:44 +0000 (11:39 +0000)
for terminated processes.

gdb/ChangeLog
gdb/bsd-uthread.c

index b14389c684b6d6e7bdea782598b8f4d5f389e06f..125283a4aa41418c59ecdf63ba61f5a9b91a7695 100644 (file)
@@ -1,3 +1,8 @@
+2007-07-06  Mark Kettenis  <kettenis@gnu.org>
+
+       * bsd-uthread.c (bsd_uthread_wait): Don't try to fetch thread IDs
+       for terminated processes.
+
 2007-07-05  Michael Snyder  <msnyder@access-company.com>
 
        * event-top.c (cli_command_loop): Prompt string can (and should)
index 172192e4d22f5e1488315e031074d570d20aeb2f..bb01816805b4433c65700711c084abbc40b817de 100644 (file)
@@ -337,6 +337,12 @@ bsd_uthread_wait (ptid_t ptid, struct target_waitstatus *status)
   /* Pass the request to the layer beneath.  */
   ptid = find_target_beneath (bsd_uthread_ops_hack)->to_wait (ptid, status);
 
+  /* If the process is no longer alive, there's no point in figuring
+     out the thread ID.  It will fail anyway.  */
+  if (status->kind == TARGET_WAITKIND_SIGNALLED
+      || status->kind == TARGET_WAITKIND_EXITED)
+    return ptid;
+
   /* Fetch the corresponding thread ID, and augment the returned
      process ID with it.  */
   addr = read_memory_typed_address (bsd_uthread_thread_run_addr,