[gdb/f14/master] detach-as-stopped kernel workaround is now always active, not just on RHEL-5.

Jan Kratochvil jankratochvil at fedoraproject.org
Wed Mar 23 20:22:21 UTC 2011


commit 1bbb88d597ff476417dce1cb9c0dc45b13b0dde4
Author: Jan Kratochvil <jan.kratochvil at redhat.com>
Date:   Wed Mar 23 21:22:07 2011 +0100

    detach-as-stopped kernel workaround is now always active, not just on RHEL-5.

 gdb-6.8-attach-signalled-detach-stopped.patch |   29 +++++++++++++++++++++++++
 gdb-rhel5-compat.patch                        |   29 -------------------------
 gdb.spec                                      |    5 +++-
 3 files changed, 33 insertions(+), 30 deletions(-)
---
diff --git a/gdb-6.8-attach-signalled-detach-stopped.patch b/gdb-6.8-attach-signalled-detach-stopped.patch
index a518122..a18af1e 100644
--- a/gdb-6.8-attach-signalled-detach-stopped.patch
+++ b/gdb-6.8-attach-signalled-detach-stopped.patch
@@ -79,6 +79,35 @@ Index: gdb-7.0.50.20100115/gdb/linux-nat.c
  }
  
  /* Convert a native/host siginfo object, into/from the siginfo in the
+Index: gdb-7.0.50.20100115/gdb/linux-nat.c
+===================================================================
+--- gdb-7.0.50.20100115.orig/gdb/linux-nat.c	2010-01-15 22:19:27.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/linux-nat.c	2010-01-15 22:19:55.000000000 +0100
+@@ -1768,8 +1768,22 @@ GPT: lwp %s had signal %s, but it is in 
+ 			    target_signal_to_string (signo));
+     }
+ 
+-  if (*status == 0 && GET_PID (lp->ptid) == pid_was_stopped)
+-    *status = W_STOPCODE (SIGSTOP);
++  /* Workaround RHEL-5 kernel which has unreliable PTRACE_DETACH, SIGSTOP (that
++     many TIDs are left unstopped).  See RH Bug 496732.  */
++  if (GET_PID (lp->ptid) == pid_was_stopped)
++    {
++      int err;
++
++      errno = 0;
++      err = kill_lwp (GET_LWP (lp->ptid), SIGSTOP);
++      if (debug_linux_nat)
++	{
++	  fprintf_unfiltered (gdb_stdlog,
++			      "SC:  lwp kill %d %s\n",
++			      err,
++			      errno ? safe_strerror (errno) : "ERRNO-OK");
++	}
++    }
+ 
+   return 0;
+ }
 Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.threads/attach-stopped.exp
 ===================================================================
 --- gdb-7.0.50.20100115.orig/gdb/testsuite/gdb.threads/attach-stopped.exp	2010-01-01 08:32:06.000000000 +0100
diff --git a/gdb-rhel5-compat.patch b/gdb-rhel5-compat.patch
index 33e63a9..943d347 100644
--- a/gdb-rhel5-compat.patch
+++ b/gdb-rhel5-compat.patch
@@ -38,32 +38,3 @@ Index: gdb-7.0.50.20100115/gdb/corelow.c
  
  static void
  build_id_locate_exec (int from_tty)
-Index: gdb-7.0.50.20100115/gdb/linux-nat.c
-===================================================================
---- gdb-7.0.50.20100115.orig/gdb/linux-nat.c	2010-01-15 22:19:27.000000000 +0100
-+++ gdb-7.0.50.20100115/gdb/linux-nat.c	2010-01-15 22:19:55.000000000 +0100
-@@ -1768,8 +1768,22 @@ GPT: lwp %s had signal %s, but it is in 
- 			    target_signal_to_string (signo));
-     }
- 
--  if (*status == 0 && GET_PID (lp->ptid) == pid_was_stopped)
--    *status = W_STOPCODE (SIGSTOP);
-+  /* Workaround RHEL-5 kernel which has unreliable PTRACE_DETACH, SIGSTOP (that
-+     many TIDs are left unstopped).  See RH Bug 496732.  */
-+  if (GET_PID (lp->ptid) == pid_was_stopped)
-+    {
-+      int err;
-+
-+      errno = 0;
-+      err = kill_lwp (GET_LWP (lp->ptid), SIGSTOP);
-+      if (debug_linux_nat)
-+	{
-+	  fprintf_unfiltered (gdb_stdlog,
-+			      "SC:  lwp kill %d %s\n",
-+			      err,
-+			      errno ? safe_strerror (errno) : "ERRNO-OK");
-+	}
-+    }
- 
-   return 0;
- }
diff --git a/gdb.spec b/gdb.spec
index 2f46694..2797e17 100644
--- a/gdb.spec
+++ b/gdb.spec
@@ -27,7 +27,7 @@ Version: 7.2
 
 # The release always contains a leading reserved number, start it at 1.
 # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
-Release: 49%{?_with_upstream:.upstream}%{dist}
+Release: 50%{?_with_upstream:.upstream}%{dist}
 
 License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and GFDL and BSD and Public Domain
 Group: Development/Debuggers
@@ -1468,6 +1468,9 @@ fi
 %endif
 
 %changelog
+* Wed Mar 23 2011 Jan Kratochvil <jan.kratochvil at redhat.com> - 7.2-50.fc14
+- detach-as-stopped kernel workaround is now always active, not just on RHEL-5.
+
 * Wed Mar 23 2011 Jan Kratochvil <jan.kratochvil at redhat.com> - 7.2-49.fc14
 - [ifunc] Fix ppc64 function descriptors compatibility.
 


More information about the scm-commits mailing list