summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2007-07-06 11:39:44 +0000
committerMark Kettenis <kettenis@gnu.org>2007-07-06 11:39:44 +0000
commitdd041b2325c0f56dd43732d207c3a5c69b94f492 (patch)
tree457feabd0d05df9628597ef2329b760a18a71693
parent0a8691edd07908ed8b82fc37f92507ee99b4acf6 (diff)
downloadgdb-dd041b2325c0f56dd43732d207c3a5c69b94f492.tar.gz
* bsd-uthread.c (bsd_uthread_wait): Don't try to fetch thread IDs
for terminated processes.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/bsd-uthread.c6
2 files changed, 11 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b14389c684b..125283a4aa4 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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)
diff --git a/gdb/bsd-uthread.c b/gdb/bsd-uthread.c
index 172192e4d22..bb01816805b 100644
--- a/gdb/bsd-uthread.c
+++ b/gdb/bsd-uthread.c
@@ -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,