f056ae4
gdb/linux-nat.c:
f056ae4
- Workaround RHEL-5 kernels for detaching SIGSTOPped processes (BZ 498595).
f056ae4
f056ae4
--- gdb-6.8/gdb-orig/symfile.c	2008-08-21 00:06:50.000000000 +0200
f056ae4
+++ gdb-6.8/gdb/symfile.c	2008-08-21 22:31:00.000000000 +0200
f056ae4
@@ -1456,8 +1456,10 @@ find_separate_debug_file (struct objfile
f056ae4
       /* Prevent looping on a stripped .debug file.  */
f056ae4
       if (build_id_name != NULL && strcmp (build_id_name, objfile->name) == 0)
f056ae4
         {
f056ae4
+#if 0 /* RHEL-5 backward behavior compatibility.  */
f056ae4
 	  warning (_("\"%s\": separate debug info file has no debug info"),
f056ae4
 		   build_id_name);
f056ae4
+#endif
f056ae4
 	  xfree (build_id_name);
f056ae4
 	}
f056ae4
       else if (build_id_name != NULL)
fe319bc
--- ./gdb/corelow.c	2010-01-01 16:04:34.000000000 +0100
fe319bc
+++ ./gdb/corelow.c	2010-01-01 16:06:26.000000000 +0100
fe319bc
@@ -277,7 +277,7 @@ add_to_thread_list (bfd *abfd, asection 
fe319bc
     inferior_ptid = ptid;			 /* Yes, make it current */
fe319bc
 }
fe319bc
 
fe319bc
-static int build_id_core_loads = 1;
fe319bc
+static int build_id_core_loads = 0;
fe319bc
 
fe319bc
 static void
fe319bc
 build_id_locate_exec (int from_tty)
fe319bc
--- ./gdb/symfile.c	2010-01-01 16:04:35.000000000 +0100
fe319bc
+++ ./gdb/symfile.c	2010-01-01 16:06:12.000000000 +0100
fe319bc
@@ -1249,7 +1249,7 @@ symbol_file_clear (int from_tty)
fe319bc
 #define BUILD_ID_VERBOSE_NONE 0
fe319bc
 #define BUILD_ID_VERBOSE_FILENAMES 1
fe319bc
 #define BUILD_ID_VERBOSE_BINARY_PARSE 2
fe319bc
-static int build_id_verbose = BUILD_ID_VERBOSE_FILENAMES;
fe319bc
+static int build_id_verbose = BUILD_ID_VERBOSE_NONE;
fe319bc
 static void
fe319bc
 show_build_id_verbose (struct ui_file *file, int from_tty,
fe319bc
 		       struct cmd_list_element *c, const char *value)
f056ae4
--- gdb-7.0-orig/gdb/linux-nat.c	2009-12-19 20:53:46.000000000 +0100
f056ae4
+++ gdb-7.0/gdb/linux-nat.c	2009-12-19 20:55:02.000000000 +0100
f056ae4
@@ -1604,8 +1604,22 @@ GPT: lwp %s had signal %s, but it is in 
f056ae4
 	*status = lp->status;
f056ae4
     }
f056ae4
 
f056ae4
-  if (*status == 0 && GET_PID (lp->ptid) == pid_was_stopped)
f056ae4
-    *status = W_STOPCODE (SIGSTOP);
f056ae4
+  /* Workaround RHEL-5 kernel which has unreliable PTRACE_DETACH, SIGSTOP (that
f056ae4
+     many TIDs are left unstopped).  See RH Bug 496732.  */
f056ae4
+  if (GET_PID (lp->ptid) == pid_was_stopped)
f056ae4
+    {
f056ae4
+      int err;
f056ae4
+
f056ae4
+      errno = 0;
f056ae4
+      err = kill_lwp (GET_LWP (lp->ptid), SIGSTOP);
f056ae4
+      if (debug_linux_nat)
f056ae4
+	{
f056ae4
+	  fprintf_unfiltered (gdb_stdlog,
f056ae4
+			      "SC:  lwp kill %d %s\n",
f056ae4
+			      err,
f056ae4
+			      errno ? safe_strerror (errno) : "ERRNO-OK");
f056ae4
+	}
f056ae4
+    }
f056ae4
 
f056ae4
   return 0;
f056ae4
 }