diff --git a/gdb-6.3-ia32el-fix-waitpid-20060615.patch b/gdb-6.3-ia32el-fix-waitpid-20060615.patch new file mode 100644 index 0000000..dac1703 --- /dev/null +++ b/gdb-6.3-ia32el-fix-waitpid-20060615.patch @@ -0,0 +1,33 @@ +Index: gdb-6.3/gdb/linux-nat.c +=================================================================== +--- gdb-6.3.orig/gdb/linux-nat.c 2006-06-15 07:27:02.000000000 -0300 ++++ gdb-6.3/gdb/linux-nat.c 2006-06-15 07:27:06.000000000 -0300 +@@ -157,12 +157,28 @@ static int + my_waitpid (int pid, int *status, int flags) + { + int ret; ++ int old_status = status ? *status : 0; ++ + do + { + ret = waitpid (pid, status, flags); + } + while (ret == -1 && errno == EINTR); + ++ if (ret == 0 && status != 0) ++ { ++ /* waitpid() running within ia32el (on multi-threaded processes ++ only?) modifies status even when it returns zero, and this ++ breaks the assumption in linux_nat_wait(), and perhaps ++ elsewhere, that it remains unchanged in this case. We ++ restore the old value before returning zero, such that the ++ assumption holds. */ ++ if (*status != 0 && *status != old_status) ++ warning ("waitpid: non-zero status %x for zero return value", ++ *status); ++ *status = old_status; ++ } ++ + return ret; + } + diff --git a/gdb.spec b/gdb.spec index 1239b89..fcfa65b 100644 --- a/gdb.spec +++ b/gdb.spec @@ -11,7 +11,7 @@ Name: gdb Version: 6.3.0.0 # The release always contains a leading reserved number, start it at 0. -Release: 1.131.FC6 +Release: 1.132.FC6 License: GPL Group: Development/Debuggers @@ -281,12 +281,16 @@ Patch175: gdb-6.3-support-fopen64-20060413.patch # Use bigger numbers than int. Patch176: gdb-6.3-large-core-20051206.patch -# Do not let errors related with debug registers break thread debugging. -Patch177: gdb-6.3-catch-debug-registers-error-20060527.patch - # Hard-code executable names in gstack, such that it can run with a # corrupted or missing PATH. -Patch178: gdb-6.3-gstack-without-path-20060414.patch +Patch177: gdb-6.3-gstack-without-path-20060414.patch + +# Do not let errors related with debug registers break thread debugging. +Patch178: gdb-6.3-catch-debug-registers-error-20060527.patch + +# Copy with waitpid modifying status even when returning zero, as on +# ia32el. +Patch179: gdb-6.3-ia32el-fix-waitpid-20060615.patch BuildRequires: ncurses-devel glibc-devel gcc make gzip texinfo dejagnu gettext @@ -395,6 +399,7 @@ and printing their data. %patch176 -p1 %patch177 -p1 %patch178 -p1 +%patch179 -p1 # Change the version that gets printed at GDB startup, so it is RedHat # specific. @@ -563,6 +568,10 @@ fi # don't include the files in include, they are part of binutils %changelog +* Thu Jun 15 2006 Alexandre Oliva - 6.3.0.0-1.132 +- Additional patch for BZ 175083, to cope with waitpid setting status +even when returning zero. + * Wed May 31 2006 Alexandre Oliva - 6.3.0.0-1.131 - Require gettext at build time. (BZ193366)