diff --git a/gdb-rhel5-compat.patch b/gdb-rhel5-compat.patch new file mode 100644 index 0000000..921b1a1 --- /dev/null +++ b/gdb-rhel5-compat.patch @@ -0,0 +1,29 @@ +Index: gdb-7.2.50.20110328/gdb/linux-nat.c +=================================================================== +--- gdb-7.2.50.20110328.orig/gdb/linux-nat.c 2011-03-28 18:46:16.000000000 +0200 ++++ gdb-7.2.50.20110328/gdb/linux-nat.c 2011-03-28 18:47:56.000000000 +0200 +@@ -1774,8 +1774,22 @@ get_pending_status (struct lwp_info *lp, + 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 e257fad..c8be9c0 100644 --- a/gdb.spec +++ b/gdb.spec @@ -35,7 +35,7 @@ Version: 7.4.50.%{snap} # 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: 42%{?dist} +Release: 43%{?dist} License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain Group: Development/Debuggers @@ -377,6 +377,10 @@ Patch330: gdb-6.8-bz436037-reg-no-longer-active.patch #=push: It was useful only after gdb-6.8-attach-signalled-detach-stopped.patch . Patch331: gdb-6.8-quit-never-aborts.patch +# [RHEL5] Workaround kernel for detaching SIGSTOPped processes (BZ 809382). +#=fedora +Patch335: gdb-rhel5-compat.patch + # [RHEL5,RHEL6] Fix attaching to stopped processes. #=fedora Patch337: gdb-6.8-attach-signalled-detach-stopped.patch @@ -926,7 +930,9 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c %patch642 -p1 -R %endif %patch337 -p1 +%patch335 -p1 %if 0%{!?rhel:1} || 0%{?rhel} > 6 +%patch335 -p1 -R %patch337 -p1 -R %endif @@ -1395,6 +1401,9 @@ fi %endif # 0%{!?el5:1} || "%{_target_cpu}" == "noarch" %changelog +* Wed Apr 25 2012 Jan Kratochvil - 7.4.50.20120120-43.fc17 +- [RHEL5] Workaround kernel for detaching SIGSTOPped processes (BZ 809382). + * Tue Apr 24 2012 Jan Kratochvil - 7.4.50.20120120-42.fc17 - Update "set auto-load" patchset and the --with-auto-load-safe-path setting. - [RHEL] Disable gdb-add-index even on RHEL-6 as RHEL-6.0 had too old elfutils.