2014-02-09 18:23:04 +00:00
|
|
|
Index: gdb-7.7/gdb/linux-nat.c
|
2012-04-25 18:59:19 +00:00
|
|
|
===================================================================
|
2014-02-09 18:23:04 +00:00
|
|
|
--- gdb-7.7.orig/gdb/linux-nat.c 2014-02-09 19:18:24.048554459 +0100
|
|
|
|
+++ gdb-7.7/gdb/linux-nat.c 2014-02-09 19:19:22.210622806 +0100
|
|
|
|
@@ -1529,8 +1529,22 @@ get_pending_status (struct lwp_info *lp,
|
2012-06-03 17:40:44 +00:00
|
|
|
gdb_signal_to_string (signo));
|
2012-04-25 18:59:19 +00:00
|
|
|
}
|
|
|
|
|
2014-02-09 18:23:04 +00:00
|
|
|
- if (*status == 0 && ptid_get_pid (lp->ptid) == pid_was_stopped)
|
2012-04-25 18:59:19 +00:00
|
|
|
- *status = W_STOPCODE (SIGSTOP);
|
|
|
|
+ /* Workaround RHEL-5 kernel which has unreliable PTRACE_DETACH, SIGSTOP (that
|
|
|
|
+ many TIDs are left unstopped). See RH Bug 496732. */
|
2014-02-09 18:23:04 +00:00
|
|
|
+ if (ptid_get_pid (lp->ptid) == pid_was_stopped)
|
2012-04-25 18:59:19 +00:00
|
|
|
+ {
|
|
|
|
+ int err;
|
|
|
|
+
|
|
|
|
+ errno = 0;
|
2014-02-09 18:23:04 +00:00
|
|
|
+ err = kill_lwp (ptid_get_lwp (lp->ptid), SIGSTOP);
|
2012-04-25 18:59:19 +00:00
|
|
|
+ if (debug_linux_nat)
|
|
|
|
+ {
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
|
|
|
+ "SC: lwp kill %d %s\n",
|
|
|
|
+ err,
|
|
|
|
+ errno ? safe_strerror (errno) : "ERRNO-OK");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|