diff options
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/linux-nat.c | 14 | ||||
-rw-r--r-- | gdb/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/testsuite/gdb.threads/fork-plus-threads.exp | 4 |
4 files changed, 30 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 40403f9..64fbe8e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,4 +1,10 @@ 2015-07-30 Pedro Alves <palves@redhat.com> + + PR threads/18600 + * linux-nat.c (wait_lwp): Report to the core when thread group + leader exits. + +2015-07-30 Pedro Alves <palves@redhat.com> Simon Marchi <simon.marchi@ericsson.com> PR threads/18600 diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index 966c6a8..69cfefc 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -2274,6 +2274,20 @@ wait_lwp (struct lwp_info *lp) /* Check if the thread has exited. */ if (WIFEXITED (status) || WIFSIGNALED (status)) { + if (ptid_get_pid (lp->ptid) == ptid_get_lwp (lp->ptid)) + { + if (debug_linux_nat) + fprintf_unfiltered (gdb_stdlog, "WL: Process %d exited.\n", + ptid_get_pid (lp->ptid)); + + /* This is the leader exiting, it means the whole + process is gone. Store the status to report to the + core. Store it in lp->waitstatus, because lp->status + would be ambiguous (W_EXITCODE(0,0) == 0). */ + store_waitstatus (&lp->waitstatus, status); + return 0; + } + thread_dead = 1; if (debug_linux_nat) fprintf_unfiltered (gdb_stdlog, "WL: %s exited.\n", diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 06ca987..e3126ed 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2015-07-30 Pedro Alves <palves@redhat.com> + + PR threads/18600 + * gdb.threads/fork-plus-threads.exp: Test that "info inferiors" + only shows inferior 1. + 2015-07-30 Simon Marchi <simon.marchi@ericsson.com> Pedro Alves <palves@redhat.com> diff --git a/gdb/testsuite/gdb.threads/fork-plus-threads.exp b/gdb/testsuite/gdb.threads/fork-plus-threads.exp index 53d1102..8a503ec 100644 --- a/gdb/testsuite/gdb.threads/fork-plus-threads.exp +++ b/gdb/testsuite/gdb.threads/fork-plus-threads.exp @@ -60,6 +60,10 @@ proc do_test { detach_on_fork } { gdb_test "info threads" "No threads\." \ "no threads left" + + gdb_test "info inferiors" \ + "Num\[ \t\]+Description\[ \t\]+Executable\[ \t\]+\r\n\\* 1 \[^\r\n\]+" \ + "only inferior 1 left" } foreach detach_on_fork {"on" "off"} { |