aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2009-04-01 18:56:30 +0000
committerJoel Brobecker <brobecker@gnat.com>2009-04-01 18:56:30 +0000
commit9db037429ba345fce9634d7508673c1cab5409f8 (patch)
tree886b8009fb8a9e4bc003e89a37de61287fef5906 /gdb
parent0d8f58ca949525dc612ba1f019d9efe733c75677 (diff)
downloadgdb-9db037429ba345fce9634d7508673c1cab5409f8.zip
gdb-9db037429ba345fce9634d7508673c1cab5409f8.tar.gz
gdb-9db037429ba345fce9634d7508673c1cab5409f8.tar.bz2
* linux-nat.c (linux_nat_filter_events): Do not delete the lwp if
this is the last one.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/linux-nat.c23
2 files changed, 17 insertions, 11 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b9d4197..dab5458 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2009-04-01 Joel Brobecker <brobecker@adacore.com>
+
+ * linux-nat.c (linux_nat_filter_events): Do not delete the lwp if
+ this is the last one.
+
2009-04-01 Pedro Alves <pedro@codesourcery.com>
* remote.c (append_resumption): New.
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index be99ece..c511a7d 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -2623,16 +2623,16 @@ linux_nat_filter_event (int lwpid, int status, int options)
/* Check if the thread has exited. */
if ((WIFEXITED (status) || WIFSIGNALED (status)) && num_lwps > 1)
{
- /* If this is the main thread, we must stop all threads and
- verify if they are still alive. This is because in the nptl
- thread model, there is no signal issued for exiting LWPs
+ /* If this is the main thread, we must stop all threads and verify
+ if they are still alive. This is because in the nptl thread model
+ on Linux 2.4, there is no signal issued for exiting LWPs
other than the main thread. We only get the main thread exit
signal once all child threads have already exited. If we
stop all the threads and use the stop_wait_callback to check
if they have exited we can determine whether this signal
should be ignored or whether it means the end of the debugged
application, regardless of which threading model is being
- used. */
+ used. */
if (GET_PID (lp->ptid) == GET_LWP (lp->ptid))
{
lp->stopped = 1;
@@ -2644,13 +2644,14 @@ linux_nat_filter_event (int lwpid, int status, int options)
"LLW: %s exited.\n",
target_pid_to_str (lp->ptid));
- exit_lwp (lp);
-
- /* If there is at least one more LWP, then the exit signal was
- not the end of the debugged application and should be
- ignored. */
- if (num_lwps > 0)
- return NULL;
+ if (num_lwps > 1)
+ {
+ /* If there is at least one more LWP, then the exit signal
+ was not the end of the debugged application and should be
+ ignored. */
+ exit_lwp (lp);
+ return NULL;
+ }
}
/* Check if the current LWP has previously exited. In the nptl