diff --git a/gdb-6.3-test-pie-20050107.patch b/gdb-6.3-test-pie-20050107.patch index ecaa473..a7c90c1 100644 --- a/gdb-6.3-test-pie-20050107.patch +++ b/gdb-6.3-test-pie-20050107.patch @@ -1051,7 +1051,7 @@ Index: gdb-6.5/gdb/testsuite/gdb.pie/break.exp +set bp_location9 [gdb_get_line_number "set breakpoint 9 here" $srcfile1] + +gdb_test "info break" \ -+ "Num Type\[ \]+Disp Enb Address\[ \]+What.* ++ "Num\[ \]+Type\[ \]+Disp Enb Address\[ \]+What.* +\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$main_line.* +\[0-9\]+\[\t \]+breakpoint keep y.* in marker2 at .*$srcfile1:($bp_location8|$bp_location9).* +\[0-9\]+\[\t \]+breakpoint keep y.* in factorial$proto at .*$srcfile:$bp_location7.* @@ -1181,7 +1181,7 @@ Index: gdb-6.5/gdb/testsuite/gdb.pie/break.exp +# +# check to see what breakpoints are set (temporary this time) +# -+gdb_test "info break" "Num Type.*Disp Enb Address.*What.*\[\r\n\] ++gdb_test "info break" "Num.*Type.*Disp Enb Address.*What.*\[\r\n\] +\[0-9\]+\[\t \]+breakpoint del.*y.*in main at .*$srcfile:$main_line.*\[\r\n\] +\[0-9\]+\[\t \]+breakpoint del.*y.*in factorial$proto at .*$srcfile:$bp_location7.*\[\r\n\] +\[0-9\]+\[\t \]+breakpoint del.*y.*in main at .*$srcfile:$bp_location1.*\[\r\n\] diff --git a/gdb-6.3-threaded-watchpoints2-20050225.patch b/gdb-6.3-threaded-watchpoints2-20050225.patch index b77512f..2d7965c 100644 --- a/gdb-6.3-threaded-watchpoints2-20050225.patch +++ b/gdb-6.3-threaded-watchpoints2-20050225.patch @@ -37,6 +37,8 @@ [ With recent upstream GDB (6.8) reduced only to the testcase. ] +FIXME: The testcase does not expects multiple watchpoints hits per one stop. + Index: gdb-6.5/gdb/testsuite/gdb.threads/watchthreads2.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 diff --git a/gdb-6.6-multifork-debugreg.patch b/gdb-6.6-multifork-debugreg.patch index 2d2bb2a..16d80b1 100644 --- a/gdb-6.6-multifork-debugreg.patch +++ b/gdb-6.6-multifork-debugreg.patch @@ -642,6 +642,17 @@ Index: gdb-6.7.50.20080227/gdb/s390-nat.c for (parea = &watch_base; *parea; parea = &(*parea)->next) if ((*parea)->lo_addr == addr && (*parea)->hi_addr == addr + len - 1) +@@ -378,8 +378,10 @@ s390_remove_watchpoint (CORE_ADDR addr, + + if (!*parea) + { ++#if 0 /* Red Hat fork/threads watchpoints changes may trigger it. */ + fprintf_unfiltered (gdb_stderr, + "Attempt to remove nonexistent watchpoint.\n"); ++#endif + return -1; + } + @@ -375,6 +392,15 @@ s390_remove_watchpoint (CORE_ADDR addr, return 0; } diff --git a/gdb-6.7-bz233852-attach-signalled-fix.patch b/gdb-6.7-bz233852-attach-signalled-fix.patch deleted file mode 100644 index dc51a2b..0000000 --- a/gdb-6.7-bz233852-attach-signalled-fix.patch +++ /dev/null @@ -1,436 +0,0 @@ -2008-01-09 Jan Kratochvil - - Support attaching to stopped processes/threads and/or with pending - signals. This ChangeLog entry is OBSOLETE: - * linux-nat.c (STRINGIFY, STRINGIFY_ARG): New macros. - (kill_lwp): New declaration. - (linux_ptrace_post_attach, pid_is_stopped): New function. - (linux_child_follow_fork): New comment about WAS_STOPPED. - (lin_lwp_attach_lwp): Variable PID removed. Part replaced by a call to - LINUX_PTRACE_POST_ATTACH. - (linux_nat_attach): Likewise. - (linux_nat_detach): Optionally stop the detached process. - (linux_nat_resume): Clear WAS_STOPPED if appropriate. - * NEWS: Document the new behaviour. - -2007-06-30 Jan Kratochvil - - * gdb.texinfo (Attach): Document the ATTACH and DETACH commands for - stopped processes. Document the messages on the seen pending signals. - -2008-02-24 Jan Kratochvil - - Port to GDB-6.8pre. - -Index: gdb-6.8cvs20080219/gdb/NEWS -=================================================================== ---- gdb-6.8cvs20080219.orig/gdb/NEWS 2008-02-24 19:35:37.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/NEWS 2008-02-24 19:36:26.000000000 +0100 -@@ -412,6 +412,9 @@ Renesas M32C/M16C m32c-elf - - Morpho Technologies ms1 ms1-elf - -+* On GNU/Linux, stopped processes may get attached to now. Signals being -+delivered at the time of the attach command no longer get lost. -+ - * New commands - - init-if-undefined Initialize a convenience variable, but -Index: gdb-6.8cvs20080219/gdb/linux-nat.c -=================================================================== ---- gdb-6.8cvs20080219.orig/gdb/linux-nat.c 2008-02-24 19:36:26.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/linux-nat.c 2008-02-24 19:45:01.000000000 +0100 -@@ -89,6 +89,15 @@ - #define PTRACE_GETSIGINFO 0x4202 - #endif - -+#define STRINGIFY_ARG(x) #x -+#define STRINGIFY(x) STRINGIFY_ARG (x) -+ -+static int linux_ptrace_post_attach (ptid_t ptid, int *cloned_return); -+static int kill_lwp (int lwpid, int signo); -+ -+/* PID of the inferior stopped by SIGSTOP before attaching (or zero). */ -+static pid_t pid_was_stopped; -+ - /* The single-threaded native GNU/Linux target_ops. We save a pointer for - the use of the multi-threaded target. */ - static struct target_ops *linux_ops; -@@ -539,6 +548,11 @@ linux_child_follow_fork (struct target_o - } - else - { -+ /* We should check PID_WAS_STOPPED and detach it stopped accordingly. -+ In this point of code it cannot be 1 as we would not get FORK -+ executed without CONTINUE first which resets PID_WAS_STOPPED. -+ We would have to first TARGET_STOP and WAITPID it as with running -+ inferior PTRACE_DETACH, SIGSTOP will ignore the signal. */ - target_detach (NULL, 0); - } - -@@ -942,9 +956,8 @@ lin_lwp_attach_lwp (ptid_t ptid) - to happen. */ - if (GET_LWP (ptid) != GET_PID (ptid) && lp == NULL) - { -- pid_t pid; - int status; -- int cloned = 0; -+ int cloned; - - if (ptrace (PTRACE_ATTACH, GET_LWP (ptid), 0, 0) < 0) - { -@@ -958,37 +971,20 @@ lin_lwp_attach_lwp (ptid_t ptid) - return -1; - } - -- if (debug_linux_nat) -- fprintf_unfiltered (gdb_stdlog, -- "LLAL: PTRACE_ATTACH %s, 0, 0 (OK)\n", -- target_pid_to_str (ptid)); -- -- pid = my_waitpid (GET_LWP (ptid), &status, 0); -- if (pid == -1 && errno == ECHILD) -- { -- /* Try again with __WCLONE to check cloned processes. */ -- pid = my_waitpid (GET_LWP (ptid), &status, __WCLONE); -- cloned = 1; -+ status = linux_ptrace_post_attach (ptid, &cloned); -+ if (status != 0) -+ { -+ error (_("Thread %s exited: %s"), target_pid_to_str (ptid), -+ status_to_str (status)); - } - -- gdb_assert (pid == GET_LWP (ptid) -- && WIFSTOPPED (status) && WSTOPSIG (status)); -- -- if (lp == NULL) -- lp = add_lwp (ptid); -+ /* ADD_LWP with TID only already after the WAITPID. */ -+ lp = add_lwp (ptid); - lp->cloned = cloned; - -- target_post_attach (pid); -+ target_post_attach (GET_LWP (ptid)); - - lp->stopped = 1; -- -- if (debug_linux_nat) -- { -- fprintf_unfiltered (gdb_stdlog, -- "LLAL: waitpid %s received %s\n", -- target_pid_to_str (ptid), -- status_to_str (status)); -- } - } - else - { -@@ -998,44 +994,202 @@ lin_lwp_attach_lwp (ptid_t ptid) - threads. Note that this won't have already been done since - the main thread will have, we assume, been stopped by an - attach from a different layer. */ -- if (lp == NULL) -- lp = add_lwp (ptid); - lp->stopped = 1; - } - - return 0; - } - -+/* Detect `T (stopped)' in `/proc/PID/status'. -+ Other states including `T (tracing stop)' are reported as false. */ -+ -+static int -+pid_is_stopped (pid_t pid) -+{ -+ FILE *status_file; -+ char buf[100]; -+ int retval = 0; -+ -+ snprintf (buf, sizeof (buf), "/proc/%d/status", (int) pid); -+ status_file = fopen (buf, "r"); -+ if (status_file != NULL) -+ { -+ int have_state = 0; -+ -+ while (fgets (buf, sizeof (buf), status_file)) -+ { -+ if (strncmp (buf, "State:", 6) == 0) -+ { -+ have_state = 1; -+ break; -+ } -+ } -+ if (have_state && strstr (buf, "T (stopped)") != NULL) -+ retval = 1; -+ fclose (status_file); -+ } -+ return retval; -+} -+ -+/* Handle the processing after PTRACE_ATTACH, the first WAITPID -> SIGSTOP. -+ Returns STATUS if the thread has exited, 0 otherwise. -+ Sets PID_WAS_STOPPED if the process was originally stopped. -+ Sets LP->CLONED if the given LWP is not the thread leader. -+ -+ Scenario for a standard unstopped inferior: -+ * `S (sleeping)' or `R (running)' or similiar states. -+ * PTRACE_ATTACH is called. -+ * `S (sleeping)' (or similiar) for some while. -+ * `T (tracing stop)'. -+ * WAITPID succeeds here returning SIGSTOP (signalled by PTRACE_ATTACH). -+ -+ Scenario for a formerly stopped inferior: -+ * `T (stopped)'. -+ * PTRACE_ATTACH is called. -+ * `T (stopped)' would stay indefinitely -+ Note since this moment the `TracerPid' field gets filled -+ (by PTRACE_ATTACH), it is no longer just the common `T (stopped)' state. -+ * If no one did WAITPID since sending SIGSTOP our WAITPID would return -+ SIGSTOP. The state still would not turn to `T (tracing stop)'. -+ * Usually its original parent (before PTRACE_ATTACH was applied) already -+ did WAITPID. The original parent already received our SIGSTOP -+ sinalled by our PTRACE_ATTACH. -+ In this case our own WAITPID would hang. Therefore... -+ * ... we do artificial: tkill (SIGCONT); -+ `PTRACE_CONT, SIGSTOP' does not work in 100% cases as sometimes SIGSTOP -+ gets remembered by kernel during the first PTRACE_CONT later and we get -+ spurious SIGSTOP event. Expecting the signal may get delivered to -+ a different task of the thread group. -+ `kill_lwp (SIGSTOP)' has no effect in this moment (it is already stopped). -+ * WAITPID returns the artifical SIGCONT. -+ (The possibly pending SIGSTOP gets vanished by specifically SIGCONT.) -+ * State turns `T (tracing stop)'. -+ In this moment everything is almost fine but we need a workaround as final -+ `PTRACE_DETACH, SIGSTOP' would leave the process unstopped otherwise: -+ * tkill (SIGSTOP); -+ * `PTRACE_CONT, 0' -+ * WAITPID returns the artifical SIGSTOP. -+ -+ With the pending (unwaited for) SIGSTOP the artifical signal effects are: -+ kill (SIGSTOP) -+ PTRACE_ATTACH -+ /-tkill (SIGCONT), WAITPID: SIGCONT, WAITPID: hang ! -+ //-tkill (SIGCONT), WAITPID: SIGCONT, PTRACE_CONT (SIG_0), WAITPID: wait (OK) -+ \\-tkill (SIGALRM), WAITPID: SIGSTOP, WAITPID: hang ! -+ \-tkill (SIGALRM), WAITPID: SIGSTOP, PTRACE_CONT (SIG_0), WAITPID: SIGALRM ! -+ Therefore we signal artifical SIGCONT and stop waiting after its reception. -+ -+ For the detection whether the process was formerly stopped we need to -+ read `/proc/PID/status'. `PTRACE_CONT, SIGSTOP' returns ESRCH -+ for `S (sleeping)' and succeeds for `T (stopped)' but it unfortunately -+ succeeds even for `T (tracing stop)'. Depending on PTRACE_CONT, SIGSTOP -+ success value for formerly stopped processes would mean a race condition -+ as we would get false stopped processes detection if we get too slow. -+ -+ `waitid (..., WSTOPPED)' hangs the same way as WAITPID. -+ -+ Signals get queued for WAITPID. PTRACE_ATTACH (or TKILL) enqueues SIGSTOP -+ there but WAITPID may return an already pending signal. -+ Redeliver it by PTRACE_CONT, SIGxxx as otherwise it would get lost. -+ Similiar processing is being done in this file by WAIT_LWP. */ -+ -+static int -+linux_ptrace_post_attach (ptid_t ptid, int *cloned_return) -+{ -+ unsigned long sig; -+ int this_thread_was_stopped; -+ int cloned = 0; -+ -+ if (debug_linux_nat) -+ fprintf_unfiltered (gdb_stdlog, -+ "LLAL: PTRACE_ATTACH %s, 0, 0 (OK)\n", -+ target_pid_to_str (ptid)); -+ -+ /* This code should not be run for the threads being attached after the first -+ thread (process) as we would get later spurious SIGCONT otherwise. */ -+ -+ this_thread_was_stopped = pid_is_stopped (GET_LWP (ptid)); -+ if (this_thread_was_stopped) -+ { -+ pid_was_stopped = GET_PID (ptid); -+ if (kill_lwp (GET_LWP (ptid), SIGCONT) != 0) -+ perror_with_name (("kill_lwp (SIGCONT)")); -+ } -+ -+ for (;;) -+ { -+ pid_t pid; -+ int status; -+ -+ pid = my_waitpid (GET_LWP (ptid), &status, 0); -+ if (pid == -1 && errno == ECHILD) -+ { -+ /* Try again with __WCLONE to check cloned processes. */ -+ pid = my_waitpid (GET_LWP (ptid), &status, __WCLONE); -+ cloned = 1; -+ } -+ -+ gdb_assert (pid == GET_LWP (ptid)); -+ -+ if (debug_linux_nat) -+ { -+ fprintf_unfiltered (gdb_stdlog, -+ "LLAL: waitpid %s received %s\n", -+ target_pid_to_str (ptid), -+ status_to_str (status)); -+ } -+ -+ /* Check if the thread has exited. */ -+ if (WIFEXITED (status) || WIFSIGNALED (status)) -+ return status; -+ gdb_assert (WIFSTOPPED (status)); -+ sig = WSTOPSIG (status); -+ gdb_assert (sig != 0); -+ if (sig == SIGSTOP) -+ break; -+ -+ /* As the second signal for stopped processes we send SIGSTOP. */ -+ if (this_thread_was_stopped && sig == SIGCONT) -+ sig = SIGSTOP; -+ -+ printf_unfiltered (_("Redelivering pending %s.\n"), -+ target_signal_to_string (target_signal_from_host (sig))); -+ if (sig == SIGSTOP) -+ { -+ if (kill_lwp (GET_LWP (ptid), sig) != 0) -+ perror_with_name (("kill_lwp")); -+ /* We now must resume the inferior to get SIGSTOP delivered. */ -+ sig = 0; -+ } -+ if (ptrace (PTRACE_CONT, GET_LWP (ptid), NULL, (void *) sig) != 0) -+ perror_with_name (("ptrace")); -+ } -+ *cloned_return = cloned; -+ return 0; -+} -+ - static void - linux_nat_attach (char *args, int from_tty) - { - struct lwp_info *lp; -- pid_t pid; - int status; -- int cloned = 0; -+ int cloned; - - /* FIXME: We should probably accept a list of process id's, and - attach all of them. */ - linux_ops->to_attach (args, from_tty); - -- /* Make sure the initial process is stopped. The user-level threads -- layer might want to poke around in the inferior, and that won't -- work if things haven't stabilized yet. */ -- pid = my_waitpid (GET_PID (inferior_ptid), &status, 0); -- if (pid == -1 && errno == ECHILD) -- { -- warning (_("%s is a cloned process"), target_pid_to_str (inferior_ptid)); -- -- /* Try again with __WCLONE to check cloned processes. */ -- pid = my_waitpid (GET_PID (inferior_ptid), &status, __WCLONE); -- cloned = 1; -- } -- -- gdb_assert (pid == GET_PID (inferior_ptid) -- && WIFSTOPPED (status) && WSTOPSIG (status) == SIGSTOP); -- - /* Add the initial process as the first LWP to the list. */ - inferior_ptid = BUILD_LWP (GET_PID (inferior_ptid), GET_PID (inferior_ptid)); -+ -+ status = linux_ptrace_post_attach (inferior_ptid, &cloned); -+ if (status != 0) -+ error (_("Program %s exited: %s\n"), target_pid_to_str (inferior_ptid), -+ status_to_str (status)); -+ if (cloned) -+ warning (_("%s is a cloned process"), target_pid_to_str (inferior_ptid)); -+ -+ /* ADD_LWP with TID only already after the WAITPID. */ - lp = add_lwp (inferior_ptid); - lp->cloned = cloned; - -@@ -1046,8 +1200,8 @@ linux_nat_attach (char *args, int from_t - lp->resumed = 1; - if (debug_linux_nat) - { -- fprintf_unfiltered (gdb_stdlog, -- "LLA: waitpid %ld, faking SIGSTOP\n", (long) pid); -+ fprintf_unfiltered (gdb_stdlog, "LLA: waitpid %d, faking SIGSTOP\n", -+ GET_PID (inferior_ptid)); - } - } - -@@ -1092,6 +1246,9 @@ detach_callback (struct lwp_info *lp, vo - overall process id just yet. */ - if (GET_LWP (lp->ptid) != GET_PID (lp->ptid)) - { -+ /* None of these threads should be stopped for PID_WAS_STOPPED. Only the -+ last thread (process) will be stopped by LINUX_NAT_DETACH. */ -+ - errno = 0; - if (ptrace (PTRACE_DETACH, GET_LWP (lp->ptid), 0, - WSTOPSIG (lp->status)) < 0) -@@ -1120,6 +1277,9 @@ linux_nat_detach (char *args, int from_t - - trap_ptid = null_ptid; - -+ if (pid_was_stopped == GET_PID (lwp_list->ptid)) -+ args = STRINGIFY (SIGSTOP); -+ - /* Destroy LWP info; it's no longer valid. */ - init_lwp_list (); - -@@ -1255,6 +1415,14 @@ linux_nat_resume (ptid_t ptid, int step_ - resume_callback. */ - lp->stopped = 0; - -+ /* At this point, we are going to resume the inferior and if we -+ have attached to a stopped process, we no longer should leave -+ it as stopped if the user detaches. PTID variable has PID set to LWP -+ while we need to check the real PID here. */ -+ -+ if (!step && lp && pid_was_stopped == GET_PID (lp->ptid)) -+ pid_was_stopped = 0; -+ - if (resume_all) - iterate_over_lwps (resume_callback, NULL); - -Index: gdb-6.8cvs20080219/gdb/doc/gdb.texinfo -=================================================================== ---- gdb-6.8cvs20080219.orig/gdb/doc/gdb.texinfo 2008-02-24 19:36:24.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/doc/gdb.texinfo 2008-02-24 19:36:26.000000000 +0100 -@@ -2176,16 +2176,29 @@ can step and continue; you can modify st - process continue running, you may use the @code{continue} command after - attaching @value{GDBN} to the process. - -+For a process already being stopped before the @code{attach} command executed -+you get the informational message below. Other signals may be occasionally -+shown if they were being delivered right the time the @code{attach} command -+executed. Such process is left still stopped after the @code{detach} command -+as long as you have not used the @code{continue} command (or similiar one) -+during your debugging session. -+ -+@smallexample -+Attaching to program: /bin/sleep, process 16289 -+Redelivering pending Stopped (signal). -+@end smallexample -+ - @table @code - @kindex detach - @item detach - When you have finished debugging the attached process, you can use the --@code{detach} command to release it from @value{GDBN} control. Detaching --the process continues its execution. After the @code{detach} command, --that process and @value{GDBN} become completely independent once more, and you --are ready to @code{attach} another process or start one with @code{run}. --@code{detach} does not repeat if you press @key{RET} again after --executing the command. -+@code{detach} command to release it from @value{GDBN} control. Detaching the -+process continues its execution unless it was already stopped before the -+attachment and a @code{continue} type command has not been executed. After the -+@code{detach} command, that process and @value{GDBN} become completely -+independent once more, and you are ready to @code{attach} another process or -+start one with @code{run}. @code{detach} does not repeat if you press -+@key{RET} again after executing the command. - @end table - - If you exit @value{GDBN} while you have an attached process, you detach diff --git a/gdb-6.7-bz233852-attach-signalled-test.patch b/gdb-6.7-bz233852-attach-signalled-test.patch deleted file mode 100644 index 912ef32..0000000 --- a/gdb-6.7-bz233852-attach-signalled-test.patch +++ /dev/null @@ -1,894 +0,0 @@ -2008-01-09 Jan Kratochvil - - * gdb.threads/attach-into-signal.c, gdb.threads/attach-into-signal.exp, - gdb.threads/attach-stopped.c, gdb.threads/attach-stopped.exp: New files. - -2008-03-29 Jan Kratochvil - - Bugreport by Petr Muller. - * gdb.threads/attach-stopped.exp: Fix the `Second sleep' breakpoint, - add there a comment. - -Formerly gdb-6.3-bz202705-attach-stop-20051011-race-fix-test.patch: - gdb.threads/attachstop-mt.exp, gdb.threads/attachstop-mt.c - -diff -u -X /home/short/.diffi.list -ruNp gdb-6.5-unpatched/gdb/testsuite/gdb.threads/attach-into-signal.c gdb-6.5/gdb/testsuite/gdb.threads/attach-into-signal.c ---- gdb-6.5-unpatched/gdb/testsuite/gdb.threads/attach-into-signal.c 1970-01-01 01:00:00.000000000 +0100 -+++ gdb-6.5/gdb/testsuite/gdb.threads/attach-into-signal.c 2008-01-09 15:26:30.000000000 +0100 -@@ -0,0 +1,70 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2007 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -+ -+#include -+#include -+#include -+#include -+#include -+#ifdef USE_THREADS -+#include -+#endif -+ -+void action(int sig, siginfo_t * info, void *uc) -+{ -+ raise (SIGALRM); -+} -+ -+static void *func (void *arg) -+{ -+ struct sigaction act; -+ -+ memset (&act, 0, sizeof(struct sigaction)); -+ act.sa_sigaction = action; -+ act.sa_flags = SA_RESTART; -+ sigaction (SIGALRM, &act, 0); -+ -+ raise (SIGALRM); -+ -+ /* This should be NOTREACHED but sometimes it is reached - Bug 427860. -+ We never get here without ptrace(2). It may also be a kernel bug. */ -+ for (;;) -+ pause (); -+ -+ abort (); -+ /* NOTREACHED */ -+ return NULL; -+} -+ -+int main () -+{ -+ -+#ifndef USE_THREADS -+ -+ func (NULL); -+ -+#else -+ -+ pthread_t th; -+ pthread_create (&th, NULL, func, NULL); -+ pthread_join (th, NULL); -+ -+#endif -+ -+ return 0; -+} -diff -u -X /home/short/.diffi.list -ruNp gdb-6.5-unpatched/gdb/testsuite/gdb.threads/attach-into-signal.exp gdb-6.5/gdb/testsuite/gdb.threads/attach-into-signal.exp ---- gdb-6.5-unpatched/gdb/testsuite/gdb.threads/attach-into-signal.exp 1970-01-01 01:00:00.000000000 +0100 -+++ gdb-6.5/gdb/testsuite/gdb.threads/attach-into-signal.exp 2008-01-09 15:26:30.000000000 +0100 -@@ -0,0 +1,179 @@ -+# Copyright 2007 -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+ -+# This test was created by modifying attach-stopped.exp. -+# This file was created by Jan Kratochvil . -+ -+if $tracelevel then { -+ strace $tracelevel -+} -+ -+set prms_id 0 -+set bug_id 0 -+ -+set testfile "attach-into-signal" -+set srcfile ${testfile}.c -+set binfile ${objdir}/${subdir}/${testfile} -+set escapedbinfile [string_to_regexp ${objdir}/${subdir}/${testfile}] -+ -+remote_exec build "rm -f ${binfile}" -+# For debugging this test -+# -+#log_user 1 -+ -+proc corefunc { threadtype } { -+ global srcfile -+ global binfile -+ global escapedbinfile -+ global srcdir -+ global subdir -+ global gdb_prompt -+ -+ if [get_compiler_info ${binfile}] { -+ return -1 -+ } -+ -+ # Start the program running and then wait for a bit, to be sure -+ # that it can be attached to. -+ # Statistically there is a better chance without giving process a nice. -+ -+ set testpid [eval exec $binfile &] -+ exec sleep 2 -+ -+ # Run 2 passes of the test. -+ # The C file inferior stops pending its signals if a single one is lost, -+ # we test successful redelivery of the caught signal by the 2nd pass. -+ -+ # linux-2.6.20.4.x86_64 had maximal attempt # 20 in 4 test runs. -+ set attempts 100 -+ set attempt 1 -+ set passes 1 -+ while { $passes < 3 && $attempt <= $attempts } { -+ -+ # Start with clean gdb -+ gdb_exit -+ -+ set stoppedtry 0 -+ while { $stoppedtry < 10 } { -+ if [catch {open /proc/${testpid}/status r} fileid] { -+ set stoppedtry 10 -+ break -+ } -+ gets $fileid line1; -+ gets $fileid line2; -+ close $fileid; -+ -+ if {![string match "*(stopped)*" $line2]} { -+ # No PASS message as we may be looping in multiple attempts. -+ break -+ } -+ sleep 1 -+ set stoppedtry [expr $stoppedtry + 1] -+ } -+ if { $stoppedtry >= 10 } { -+ verbose -log $line2 -+ set test "$threadtype: process is still running on the attempt # $attempt of $attempts" -+ break -+ } -+ -+ gdb_start -+ gdb_reinitialize_dir $srcdir/$subdir -+ gdb_load ${binfile} -+ -+ # No PASS message as we may be looping in multiple attempts. -+ gdb_test "set debug lin-lwp 1" "" "" -+ -+ set test "$threadtype: set file (pass $passes), before attach1 to stopped process" -+ if {[gdb_test_multiple "file $binfile" $test { -+ -re "Load new symbol table from.*y or n. $" { -+ # No PASS message as we may be looping in multiple attempts. -+ gdb_test "y" "Reading symbols from $escapedbinfile\.\.\.*done." "" -+ } -+ -re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $" { -+ # No PASS message as we may be looping in multiple attempts. -+ } -+ }] != 0 } { -+ break -+ } -+ -+ # Main test: -+ set test "$threadtype: attach (pass $passes), pending signal catch" -+ if {[gdb_test_multiple "attach $testpid" $test { -+ -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*Redelivering pending Alarm clock..*$gdb_prompt $" { -+ # nonthreaded: -+ pass $test -+ verbose -log "$test succeeded on the attempt # $attempt of $attempts" -+ set passes [expr $passes + 1] -+ } -+ -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*$gdb_prompt $" { -+ # nonthreaded: -+ # We just lack the luck, we should try it again. -+ set attempt [expr $attempt + 1] -+ } -+ -re "Attaching to process $testpid.*Redelivering pending Alarm clock..*$gdb_prompt $" { -+ # threaded: -+ pass $test -+ verbose -log "$test succeeded on the attempt # $attempt of $attempts" -+ set passes [expr $passes + 1] -+ } -+ -re "Attaching to process $testpid.*$gdb_prompt $" { -+ # threaded: -+ # We just lack the luck, we should try it again. -+ set attempt [expr $attempt - 1] -+ } -+ }] != 0 } { -+ break -+ } -+ } -+ if {$passes < 3} { -+ if {$attempt > $attempts} { -+ unresolved $test -+ } else { -+ fail $test -+ } -+ } -+ -+ # Exit and detach the process. -+ -+ gdb_exit -+ -+ # Make sure we don't leave a process around to confuse -+ # the next test run (and prevent the compile by keeping -+ # the text file busy), in case the "set should_exit" didn't -+ # work. -+ -+ # Continue the program - some Linux kernels need it before -9 if the -+ # process is stopped. -+ remote_exec build "kill -s CONT ${testpid}" -+ -+ remote_exec build "kill -9 ${testpid}" -+} -+ -+# build the test case first without threads -+# -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { -+ gdb_suppress_entire_file "Testcase nonthraded compile failed, so all tests in this file will automatically fail." -+} -+ -+corefunc nonthreaded -+ -+# build the test case also with threads -+# -+if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DUSE_THREADS}] != "" } { -+ gdb_suppress_entire_file "Testcase threaded compile failed, so all tests in this file will automatically fail." -+} -+ -+corefunc threaded -diff -u -X /home/short/.diffi.list -ruNp gdb-6.5-unpatched/gdb/testsuite/gdb.threads/attach-stopped.c gdb-6.5/gdb/testsuite/gdb.threads/attach-stopped.c ---- gdb-6.5-unpatched/gdb/testsuite/gdb.threads/attach-stopped.c 1970-01-01 01:00:00.000000000 +0100 -+++ gdb-6.5/gdb/testsuite/gdb.threads/attach-stopped.c 2008-01-09 15:26:30.000000000 +0100 -@@ -0,0 +1,51 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2005-2007 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -+ -+/* This program is intended to be started outside of gdb, then -+ manually stopped via a signal. */ -+ -+#include -+#include -+#ifdef USE_THREADS -+#include -+#endif -+ -+static void *func (void *arg) -+{ -+ sleep (10000); /* Ridiculous time, but we will eventually kill it. */ -+ sleep (10000); /* Second sleep. */ -+ return NULL; -+} -+ -+int main () -+{ -+ -+#ifndef USE_THREADS -+ -+ func (NULL); -+ -+#else -+ -+ pthread_t th; -+ pthread_create (&th, NULL, func, NULL); -+ pthread_join (th, NULL); -+ -+#endif -+ -+ return 0; -+} -diff -u -X /home/short/.diffi.list -ruNp gdb-6.5-unpatched/gdb/testsuite/gdb.threads/attach-stopped.exp gdb-6.5/gdb/testsuite/gdb.threads/attach-stopped.exp ---- gdb-6.5-unpatched/gdb/testsuite/gdb.threads/attach-stopped.exp 1970-01-01 01:00:00.000000000 +0100 -+++ gdb-6.5/gdb/testsuite/gdb.threads/attach-stopped.exp 2008-01-09 15:26:30.000000000 +0100 -@@ -0,0 +1,222 @@ -+# Copyright 2005-2007 -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+ -+# This test was created by modifying attach.exp. -+# This file was created by Jeff Johnston . -+# This file was updated by Jan Kratochvil . -+ -+if $tracelevel then { -+ strace $tracelevel -+} -+ -+set prms_id 0 -+set bug_id 0 -+ -+# This test only works on Linux -+if { ![istarget "*-*-linux-gnu*"] } { -+ return 0 -+} -+ -+set testfile "attach-stopped" -+set srcfile ${testfile}.c -+set binfile ${objdir}/${subdir}/${testfile} -+set escapedbinfile [string_to_regexp ${objdir}/${subdir}/${testfile}] -+ -+#execute_anywhere "rm -f ${binfile}" -+remote_exec build "rm -f ${binfile}" -+# For debugging this test -+# -+#log_user 1 -+ -+proc corefunc { threadtype } { -+ global srcfile -+ global binfile -+ global escapedbinfile -+ global srcdir -+ global subdir -+ global gdb_prompt -+ -+ if [get_compiler_info ${binfile}] { -+ return -1 -+ } -+ -+ # Start the program running and then wait for a bit, to be sure -+ # that it can be attached to. -+ -+ set testpid [eval exec $binfile &] -+ -+ # Avoid some race: -+ sleep 2 -+ -+ # Stop the program -+ remote_exec build "kill -s STOP ${testpid}" -+ -+ # Start with clean gdb -+ gdb_exit -+ gdb_start -+ gdb_reinitialize_dir $srcdir/$subdir -+ gdb_load ${binfile} -+ -+ # Verify that we can attach to the process by first giving its -+ # executable name via the file command, and using attach with the -+ # process ID. -+ -+ set test "$threadtype: set file, before attach1 to stopped process" -+ gdb_test_multiple "file $binfile" "$test" { -+ -re "Load new symbol table from.*y or n. $" { -+ gdb_test "y" "Reading symbols from $escapedbinfile\.\.\.*done." \ -+ "$test (re-read)" -+ } -+ -re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $" { -+ pass "$test" -+ } -+ } -+ -+ set test "$threadtype: attach1 to stopped, after setting file" -+ gdb_test_multiple "attach $testpid" "$test" { -+ -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*$gdb_prompt $" { -+ pass "$test" -+ } -+ } -+ -+ # ".*sleep.*clone.*" would fail on s390x as bt stops at START_THREAD there. -+ if {[string equal $threadtype threaded]} { -+ gdb_test "thread apply all bt" ".*sleep.*start_thread.*" "$threadtype: attach1 to stopped bt" -+ } else { -+ gdb_test "bt" ".*sleep.*main.*" "$threadtype: attach1 to stopped bt" -+ } -+ -+ # Exit and detach the process. -+ -+ gdb_exit -+ -+ # Avoid some race: -+ sleep 2 -+ -+ if [catch {open /proc/${testpid}/status r} fileid] { -+ set line2 "NOTFOUND" -+ } else { -+ gets $fileid line1; -+ gets $fileid line2; -+ close $fileid; -+ } -+ -+ set test "$threadtype: attach1, exit leaves process stopped" -+ if {[string match "*(stopped)*" $line2]} { -+ pass $test -+ } else { -+ fail $test -+ } -+ -+ # At this point, the process should still be stopped -+ -+ gdb_start -+ gdb_reinitialize_dir $srcdir/$subdir -+ gdb_load ${binfile} -+ -+ # Verify that we can attach to the process just by giving the -+ # process ID. -+ -+ set test "$threadtype: attach2 to stopped, after setting file" -+ gdb_test_multiple "attach $testpid" "$test" { -+ -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*$gdb_prompt $" { -+ pass "$test" -+ } -+ } -+ -+ # ".*sleep.*clone.*" would fail on s390x as bt stops at START_THREAD there. -+ if {[string equal $threadtype threaded]} { -+ gdb_test "thread apply all bt" ".*sleep.*start_thread.*" "$threadtype: attach2 to stopped bt" -+ } else { -+ gdb_test "bt" ".*sleep.*main.*" "$threadtype: attach2 to stopped bt" -+ } -+ # This breakpoint is there for old/non-x86 kernels not restarting syscalls. -+ gdb_breakpoint [gdb_get_line_number "Second sleep"] -+ set test "$threadtype: attach2 continue" -+ send_gdb "continue\n" -+ gdb_expect { -+ -re "Continuing" -+ { pass "continue ($test)" } -+ timeout -+ { fail "continue ($test) (timeout)" } -+ } -+ -+ # For this to work we must be sure to consume the "Continuing." -+ # message first, or GDB's signal handler may not be in place. -+ after 1000 {send_gdb "\003"} -+ set test "$threadtype: attach2 stop interrupt" -+ gdb_expect 10 { -+ -re "Program received signal SIGINT.*$gdb_prompt $" -+ { -+ pass $test -+ } -+ -re "Breakpoint \[0-9\].*$srcfile.*$gdb_prompt $" -+ { -+ pass $test -+ } -+ timeout -+ { -+ fail $test -+ } -+ } -+ -+ gdb_exit -+ -+ # Avoid some race: -+ sleep 2 -+ -+ # At this point, the process should be sleeping -+ -+ if [catch {open /proc/${testpid}/status r} fileid2] { -+ set line2 "NOTFOUND" -+ } else { -+ gets $fileid2 line1; -+ gets $fileid2 line2; -+ close $fileid2; -+ } -+ -+ set test "$threadtype: attach2, exit leaves process sleeping" -+ if {[string match "*(sleeping)*" $line2]} { -+ pass $test -+ } else { -+ fail $test -+ } -+ -+ # Make sure we don't leave a process around to confuse -+ # the next test run (and prevent the compile by keeping -+ # the text file busy), in case the "set should_exit" didn't -+ # work. -+ -+ remote_exec build "kill -9 ${testpid}" -+} -+ -+# build the test case first without threads -+# -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { -+ gdb_suppress_entire_file "Testcase nonthraded compile failed, so all tests in this file will automatically fail." -+} -+ -+corefunc nonthreaded -+ -+# build the test case first without threads -+# -+if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DUSE_THREADS}] != "" } { -+ gdb_suppress_entire_file "Testcase threaded compile failed, so all tests in this file will automatically fail." -+} -+ -+corefunc threaded -+ -+return 0 -diff -u -X /home/short/.diffi.list -ruNp gdb-6.5-unpatched/gdb/testsuite/gdb.threads/attachstop-mt.c gdb-6.5/gdb/testsuite/gdb.threads/attachstop-mt.c ---- gdb-6.5-unpatched/gdb/testsuite/gdb.threads/attachstop-mt.c 1970-01-01 01:00:00.000000000 +0100 -+++ gdb-6.5/gdb/testsuite/gdb.threads/attachstop-mt.c 2008-01-09 15:26:29.000000000 +0100 -@@ -0,0 +1,56 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2005 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -+ -+/* This program is intended to be started outside of gdb, then -+ manually stopped via a signal. */ -+ -+#include -+#include -+#include -+ -+/* Red Hat BZ PR 197584.c */ -+ -+void *func (void *arg) -+{ -+ sleep (10000); /* Ridiculous time, but we will eventually kill it. */ -+ sleep (10000); /* RHEL3U8 kernel-2.4.21-47.EL will cut the sleep time. */ -+ -+ return NULL; /* thread-sleep */ -+} -+ -+int main () -+{ -+ pthread_t t1,t2; -+ int ret; -+ -+ ret = pthread_create (&t1, NULL, func, NULL); -+ if (ret) -+ fprintf(stderr, "pthread_create(): %s", strerror (ret)); -+ ret = pthread_create (&t2, NULL, func, NULL); -+ if (ret) -+ fprintf(stderr, "pthread_create(): %s", strerror (ret)); -+ -+ ret = pthread_join (t1, NULL); -+ if (ret) /* first-join */ -+ fprintf(stderr, "pthread_join(): %s", strerror (ret)); -+ ret = pthread_join (t2, NULL); -+ if (ret) -+ fprintf(stderr, "pthread_join(): %s", strerror (ret)); -+ -+ return 0; -+} -diff -u -X /home/short/.diffi.list -ruNp gdb-6.5-unpatched/gdb/testsuite/gdb.threads/attachstop-mt.exp gdb-6.5/gdb/testsuite/gdb.threads/attachstop-mt.exp ---- gdb-6.5-unpatched/gdb/testsuite/gdb.threads/attachstop-mt.exp 1970-01-01 01:00:00.000000000 +0100 -+++ gdb-6.5/gdb/testsuite/gdb.threads/attachstop-mt.exp 2008-01-09 18:13:49.000000000 +0100 -@@ -0,0 +1,278 @@ -+# Copyright 2006 -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+ -+# This test was created by modifying gdb.threads/attachstop. -+# This file was created by Jan Kratochvil . -+# Regression for: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=197584 -+ -+if $tracelevel then { -+ strace $tracelevel -+} -+ -+set prms_id 0 -+set bug_id 0 -+ -+# This test only works on Linux -+if { ![istarget "*-*-linux-gnu*"] } { -+ return 0 -+} -+ -+set testfile "attachstop-mt" -+set srcfile ${testfile}.c -+set binfile ${objdir}/${subdir}/${testfile} -+set escapedbinfile [string_to_regexp ${objdir}/${subdir}/${testfile}] -+ -+#execute_anywhere "rm -f ${binfile}" -+remote_exec build "rm -f ${binfile}" -+# For debugging this test -+# -+#log_user 1 -+ -+# build the test case -+# -+if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { -+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." -+} -+ -+if [get_compiler_info ${binfile}] { -+ return -1 -+} -+ -+# Start the program running and then wait for a bit, to be sure -+# that it can be attached to. -+ -+set testpid [eval exec $binfile &] -+ -+# No race -+sleep 2 -+ -+# Do not: set testpid2 [expr $testpid + 1] -+# as it will not exist on Red Hat 2.6.9-34.0.2.ELsmp -+set testpid2 [expr $testpid + 2] -+ -+set status2 /proc/${testpid}/task/${testpid2}/status -+if {[expr ! [file exists $status2]]} { -+ # kernel-2.4 -+ set status2 /proc/${testpid2}/status -+} -+ -+# Initial sanity test it is normally sleeping -+set fileid0 [open $status2 r]; -+gets $fileid0 line1; -+gets $fileid0 line2; -+close $fileid0; -+ -+set test "attach0, initial sanity check of the sleeping state" -+if {[string match "*(sleeping)*" $line2]} { -+ pass $test -+} else { -+ fail $test -+} -+ -+# Sttach and detach to test it will not become stopped -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+set test "attach0 to sleeping" -+gdb_test_multiple "attach $testpid" "$test" { -+ -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*$gdb_prompt $" { -+ pass "$test" -+ } -+} -+ -+gdb_test "gcore /dev/null" ".*aved corefile.*" "attach0 to sleeping gcore invocation" -+ -+gdb_test "thread 2" ".*witching to thread 2 .*" "attach0 to sleeping switch thread" -+ -+gdb_test "bt" ".*sleep.*func.*" "attach0 to sleeping bt" -+ -+# Exit and detach the process. -+ -+gdb_exit -+ -+# No race -+sleep 2 -+ -+# Check it did not get stopped by our gdb -+set fileid1 [open $status2 r]; -+gets $fileid1 line1; -+gets $fileid1 line2; -+close $fileid1; -+ -+set test "attach1, post-gdb sanity check of the sleeping state - Red Hat BZ 197584" -+if {[string match "*(sleeping)*" $line2]} { -+ pass $test -+} else { -+ fail $test -+} -+ -+# Stop the program -+remote_exec build "kill -s STOP ${testpid}" -+ -+# No race -+sleep 2 -+ -+# Check it really got stopped by kill(1) -+set fileid2 [open $status2 r]; -+gets $fileid2 line1; -+gets $fileid2 line2; -+close $fileid2; -+ -+set test "attach2, initial sanity check of the stopped state" -+if {[string match "*(stopped)*" $line2]} { -+ pass $test -+} else { -+ fail $test -+} -+ -+# Start with clean gdb -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+# Verify that we can attach to the process by first giving its -+# executable name via the file command, and using attach with the -+# process ID. -+ -+set test "set file, before attach3 to stopped process" -+gdb_test_multiple "file $binfile" "$test" { -+ -re "Load new symbol table from.*y or n. $" { -+ gdb_test "y" "Reading symbols from $escapedbinfile\.\.\.*done." \ -+ "$test (re-read)" -+ } -+ -re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $" { -+ pass "$test" -+ } -+} -+ -+set test "attach3 to stopped, after setting file" -+gdb_test_multiple "attach $testpid" "$test" { -+ -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*$gdb_prompt $" { -+ pass "$test" -+ } -+} -+ -+# We may be already after the threads phase. -+# `thread 2' command is important for the test to switch the current thread to -+# a non-primary one for the detach process. -+ -+gdb_test "thread 2" ".*(witching to thread 2 |hread ID 2 not known).*" "attach3 to stopped switch thread" -+gdb_test "bt" ".*sleep.*(func|main).*" "attach3 to stopped bt" -+ -+# Exit and detach the process. -+gdb_exit -+ -+# No race -+sleep 2 -+ -+set fileid3 [open $status2 r]; -+gets $fileid3 line1; -+gets $fileid3 line2; -+close $fileid3; -+ -+set test "attach3, exit leaves process stopped" -+if {[string match "*(stopped)*" $line2]} { -+ pass $test -+} else { -+ fail $test -+} -+ -+# At this point, the process should still be stopped -+ -+# Continue the test as we would hit another expected bug regarding -+# Program received signal SIGSTOP, Stopped (signal). -+# across NPTL threads. -+ -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+# Verify that we can attach to the process just by giving the -+# process ID. -+ -+set test "attach4 to stopped, after setting file" -+gdb_test_multiple "attach $testpid" "$test" { -+ -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*$gdb_prompt $" { -+ pass "$test" -+ } -+} -+ -+# We may be already after the threads phase. -+# `thread 2' command is important for the test to switch the current thread to -+# a non-primary one for the detach process. -+ -+gdb_test "thread 2" ".*(witching to thread 2 |hread ID 2 not known).*" "attach4 to stopped switch thread" -+gdb_test "bt" ".*sleep.*(func|main).*" "attach4 to stopped bt" -+ -+# RHEL3U8 kernel-2.4.21-47.EL will not return SIGINT but only shorten the sleep. -+gdb_breakpoint [gdb_get_line_number "Ridiculous time"] -+gdb_breakpoint [gdb_get_line_number "cut the sleep time"] -+set test "attach4 continue" -+send_gdb "continue\n" -+gdb_expect { -+ -re "Continuing" -+ { pass "continue ($test)" } -+ timeout -+ { fail "continue ($test) (timeout)" } -+} -+ -+# For this to work we must be sure to consume the "Continuing." -+# message first, or GDB's signal handler may not be in place. -+after 1000 {send_gdb "\003"} -+set test "attach4 stop by interrupt" -+gdb_expect { -+ -re "Program received signal SIGINT.*$gdb_prompt $" -+ { -+ pass $test -+ } -+ -re "Breakpoint \[0-9\].*$srcfile.*$gdb_prompt $" -+ { -+ pass $test -+ } -+ timeout -+ { -+ fail "$test (timeout)" -+ } -+} -+ -+gdb_exit -+ -+# No race -+sleep 2 -+ -+# At this point, the process should be sleeping -+ -+set fileid4 [open $status2 r]; -+gets $fileid4 line1; -+gets $fileid4 line2; -+close $fileid4; -+ -+set test "attach4, exit leaves process sleeping" -+if {[string match "*(sleeping)*" $line2]} { -+ pass $test -+} else { -+ fail $test -+} -+ -+# Make sure we don't leave a process around to confuse -+# the next test run (and prevent the compile by keeping -+# the text file busy), in case the "set should_exit" didn't -+# work. -+ -+remote_exec build "kill -9 ${testpid}" -+ -+return 0 diff --git a/gdb-6.7-testsuite-stable-results.patch b/gdb-6.7-testsuite-stable-results.patch index 1ce8a2e..43cd1ba 100644 --- a/gdb-6.7-testsuite-stable-results.patch +++ b/gdb-6.7-testsuite-stable-results.patch @@ -121,3 +121,22 @@ if (args == NULL) error_no_arg (_("one or more choice numbers")); + + + +Found on RHEL-5.s390x. + +--- sources/gdb/testsuite/gdb.base/dump.exp-orig 2008-08-28 11:44:40.000000000 +0200 ++++ sources/gdb/testsuite/gdb.base/dump.exp 2008-08-28 11:44:49.000000000 +0200 +@@ -493,8 +493,10 @@ if ![string compare $is64bitonly "no"] t + gdb_test "print zero_all ()" "" "" + + # restore with expressions ++ # Address may fit in int32 but its negative result would be 0xffffxxxx for ++ # 64-bit LONGEST addresses. + test_restore_saved_value \ +- "intarr3.srec ${array2_start}-${array_start} &intarray\[3\] &intarray\[4\]" \ ++ "intarr3.srec (long)${array2_start}-${array_start} &intarray\[3\] &intarray\[4\]" \ + "array partial with expressions" 4 "intarray2\[3\]" + + gdb_test "print intarray2\[2\] == 0" " = 1" "element 2 not changed, == 4" diff --git a/gdb-6.8-attach-signalled-detach-stopped.patch b/gdb-6.8-attach-signalled-detach-stopped.patch new file mode 100644 index 0000000..2781a65 --- /dev/null +++ b/gdb-6.8-attach-signalled-detach-stopped.patch @@ -0,0 +1,482 @@ +diff -up -u -X /home/jkratoch2/.diffi.list -rup gdb-6.8-base/gdb/linux-nat.c gdb-6.8/gdb/linux-nat.c +--- gdb-6.8-base/gdb/linux-nat.c 2008-08-27 18:09:35.000000000 +0200 ++++ gdb-6.8/gdb/linux-nat.c 2008-08-27 18:48:40.000000000 +0200 +@@ -117,6 +117,9 @@ + static struct target_ops *linux_ops; + static struct target_ops linux_ops_saved; + ++/* PID of the inferior stopped by SIGSTOP before attaching (or zero). */ ++static pid_t pid_was_stopped; ++ + /* The method to call, if any, when a new thread is attached. */ + static void (*linux_nat_new_thread) (ptid_t); + +@@ -531,6 +534,11 @@ linux_child_follow_fork (struct target_o + } + else + { ++ /* We should check PID_WAS_STOPPED and detach it stopped accordingly. ++ In this point of code it cannot be 1 as we would not get FORK ++ executed without CONTINUE first which resets PID_WAS_STOPPED. ++ We would have to first TARGET_STOP and WAITPID it as with running ++ inferior PTRACE_DETACH, SIGSTOP will ignore the signal. */ + target_detach (NULL, 0); + } + +@@ -936,6 +944,7 @@ linux_nat_post_attach_wait (ptid_t ptid, + if (debug_linux_nat) + fprintf_unfiltered (gdb_stdlog, + "LNPAW: Attaching to a stopped process\n"); ++ pid_was_stopped = GET_PID (ptid); + + /* The process is definitely stopped. It is in a job control + stop, unless the kernel predates the TASK_STOPPED / +@@ -1128,6 +1137,9 @@ get_pending_status (struct lwp_info *lp, + else + *status = lp->status; + ++ if (*status == 0 && GET_PID (lp->ptid) == pid_was_stopped) ++ *status = W_STOPCODE (SIGSTOP); ++ + return 0; + } + +@@ -1207,6 +1219,8 @@ linux_nat_detach (char *args, int from_t + + trap_ptid = null_ptid; + ++ pid_was_stopped = 0; ++ + /* Destroy LWP info; it's no longer valid. */ + init_lwp_list (); + +@@ -1340,6 +1354,14 @@ linux_nat_resume (ptid_t ptid, int step, + resume_callback. */ + lp->stopped = 0; + ++ /* At this point, we are going to resume the inferior and if we ++ have attached to a stopped process, we no longer should leave ++ it as stopped if the user detaches. PTID variable has PID set to LWP ++ while we need to check the real PID here. */ ++ ++ if (!step && lp && pid_was_stopped == GET_PID (lp->ptid)) ++ pid_was_stopped = 0; ++ + if (resume_all) + iterate_over_lwps (resume_callback, NULL); + +diff -up -u -X /home/jkratoch2/.diffi.list -rup gdb-6.8-base/gdb/testsuite/gdb.threads/attach-into-signal.c gdb-6.8/gdb/testsuite/gdb.threads/attach-into-signal.c +--- gdb-6.8-base/gdb/testsuite/gdb.threads/attach-into-signal.c 2008-08-27 17:44:23.000000000 +0200 ++++ gdb-6.8/gdb/testsuite/gdb.threads/attach-into-signal.c 2008-08-27 18:13:41.000000000 +0200 +@@ -1,19 +1,20 @@ + /* This testcase is part of GDB, the GNU debugger. + +- Copyright 2008 Free Software Foundation, Inc. ++ Copyright 2007 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by +- the Free Software Foundation; either version 3 of the License, or ++ the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. +- ++ + You should have received a copy of the GNU General Public License +- along with this program. If not, see . */ ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + + #include + #include +@@ -40,8 +41,10 @@ static void *func (void *arg) + + raise (SIGALRM); + +- /* We must not get past this point, either in a free standing or debugged +- state. */ ++ /* This should be NOTREACHED but sometimes it is reached - Bug 427860. ++ We never get here without ptrace(2). It may also be a kernel bug. */ ++ for (;;) ++ pause (); + + abort (); + /* NOTREACHED */ +diff -up -u -X /home/jkratoch2/.diffi.list -rup gdb-6.8-base/gdb/testsuite/gdb.threads/attach-into-signal.exp gdb-6.8/gdb/testsuite/gdb.threads/attach-into-signal.exp +--- gdb-6.8-base/gdb/testsuite/gdb.threads/attach-into-signal.exp 2008-08-27 17:44:23.000000000 +0200 ++++ gdb-6.8/gdb/testsuite/gdb.threads/attach-into-signal.exp 2008-08-27 18:13:41.000000000 +0200 +@@ -1,27 +1,29 @@ +-# Copyright 2008 +-# Free Software Foundation, Inc. ++# Copyright 2007 + + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by +-# the Free Software Foundation; either version 3 of the License, or ++# the Free Software Foundation; either version 2 of the License, or + # (at your option) any later version. +-# ++# + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details. +-# ++# + # You should have received a copy of the GNU General Public License +-# along with this program. If not, see . ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + # This test was created by modifying attach-stopped.exp. + # This file was created by Jan Kratochvil . + +-# This test only works on Linux +-if { ![isnative] || [is_remote host] || ![istarget *-linux*] } { +- continue ++if $tracelevel then { ++ strace $tracelevel + } + ++set prms_id 0 ++set bug_id 0 ++ + set testfile "attach-into-signal" + set srcfile ${testfile}.c + set binfile ${objdir}/${subdir}/${testfile} +@@ -60,6 +62,10 @@ proc corefunc { threadtype } { + set attempt 1 + set passes 1 + while { $passes < 3 && $attempt <= $attempts } { ++ ++ # Start with clean gdb ++ gdb_exit ++ + set stoppedtry 0 + while { $stoppedtry < 10 } { + if [catch {open /proc/${testpid}/status r} fileid] { +@@ -83,10 +89,30 @@ proc corefunc { threadtype } { + break + } + ++ gdb_start ++ gdb_reinitialize_dir $srcdir/$subdir ++ gdb_load ${binfile} ++ ++ # No PASS message as we may be looping in multiple attempts. ++ gdb_test "set debug lin-lwp 1" "" "" ++ ++ set test "$threadtype: set file (pass $passes), before attach1 to stopped process" ++ if {[gdb_test_multiple "file $binfile" $test { ++ -re "Load new symbol table from.*y or n. $" { ++ # No PASS message as we may be looping in multiple attempts. ++ gdb_test "y" "Reading symbols from $escapedbinfile\.\.\.*done." "" ++ } ++ -re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $" { ++ # No PASS message as we may be looping in multiple attempts. ++ } ++ }] != 0 } { ++ break ++ } ++ + # Main test: + set test "$threadtype: attach (pass $passes), pending signal catch" + if {[gdb_test_multiple "attach $testpid" $test { +- -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*Received Alarm clock.*$gdb_prompt $" { ++ -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*Redelivering pending Alarm clock..*$gdb_prompt $" { + # nonthreaded: + pass $test + verbose -log "$test succeeded on the attempt # $attempt of $attempts" +@@ -97,7 +123,7 @@ proc corefunc { threadtype } { + # We just lack the luck, we should try it again. + set attempt [expr $attempt + 1] + } +- -re "Attaching to process $testpid.*Received Alarm clock.*$gdb_prompt $" { ++ -re "Attaching to process $testpid.*Redelivering pending Alarm clock..*$gdb_prompt $" { + # threaded: + pass $test + verbose -log "$test succeeded on the attempt # $attempt of $attempts" +@@ -111,8 +137,6 @@ proc corefunc { threadtype } { + }] != 0 } { + break + } +- +- gdb_test "detach" "Detaching from.*" "" + } + if {$passes < 3} { + if {$attempt > $attempts} { +@@ -138,20 +162,12 @@ proc corefunc { threadtype } { + remote_exec build "kill -9 ${testpid}" + } + +-# Start with clean gdb +-gdb_exit +- + # build the test case first without threads + # + if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { + gdb_suppress_entire_file "Testcase nonthraded compile failed, so all tests in this file will automatically fail." + } + +-gdb_start +-gdb_reinitialize_dir $srcdir/$subdir +-gdb_load ${binfile} +-gdb_test "set debug lin-lwp 1" "" "" +- + corefunc nonthreaded + + # build the test case also with threads +@@ -160,9 +176,4 @@ if { [gdb_compile_pthreads "${srcdir}/$ + gdb_suppress_entire_file "Testcase threaded compile failed, so all tests in this file will automatically fail." + } + +-gdb_start +-gdb_reinitialize_dir $srcdir/$subdir +-gdb_load ${binfile} +-gdb_test "set debug lin-lwp 1" "" "" +- + corefunc threaded +diff -up -u -X /home/jkratoch2/.diffi.list -rup gdb-6.8-base/gdb/testsuite/gdb.threads/attach-stopped.c gdb-6.8/gdb/testsuite/gdb.threads/attach-stopped.c +--- gdb-6.8-base/gdb/testsuite/gdb.threads/attach-stopped.c 2008-08-27 17:44:23.000000000 +0200 ++++ gdb-6.8/gdb/testsuite/gdb.threads/attach-stopped.c 2008-08-27 18:13:41.000000000 +0200 +@@ -1,19 +1,20 @@ + /* This testcase is part of GDB, the GNU debugger. + +- Copyright 2008 Free Software Foundation, Inc. ++ Copyright 2005-2007 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by +- the Free Software Foundation; either version 3 of the License, or ++ the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. +- ++ + You should have received a copy of the GNU General Public License +- along with this program. If not, see . */ ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + + /* This program is intended to be started outside of gdb, then + manually stopped via a signal. */ +diff -up -u -X /home/jkratoch2/.diffi.list -rup gdb-6.8-base/gdb/testsuite/gdb.threads/attach-stopped.exp gdb-6.8/gdb/testsuite/gdb.threads/attach-stopped.exp +--- gdb-6.8-base/gdb/testsuite/gdb.threads/attach-stopped.exp 2008-08-27 17:44:23.000000000 +0200 ++++ gdb-6.8/gdb/testsuite/gdb.threads/attach-stopped.exp 2008-08-27 18:13:41.000000000 +0200 +@@ -1,26 +1,33 @@ +-# Copyright 2008 +-# Free Software Foundation, Inc. ++# Copyright 2005-2007 + + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by +-# the Free Software Foundation; either version 3 of the License, or ++# the Free Software Foundation; either version 2 of the License, or + # (at your option) any later version. +-# ++# + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details. +-# ++# + # You should have received a copy of the GNU General Public License +-# along with this program. If not, see . ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + # This test was created by modifying attach.exp. + # This file was created by Jeff Johnston . + # This file was updated by Jan Kratochvil . + ++if $tracelevel then { ++ strace $tracelevel ++} ++ ++set prms_id 0 ++set bug_id 0 ++ + # This test only works on Linux +-if { ![isnative] || [is_remote host] || ![istarget *-linux*] } { +- continue ++if { ![istarget "*-*-linux-gnu*"] } { ++ return 0 + } + + set testfile "attach-stopped" +@@ -63,7 +70,65 @@ proc corefunc { threadtype } { + gdb_reinitialize_dir $srcdir/$subdir + gdb_load ${binfile} + +- # Verify that we can attach to the stopped process. ++ # Verify that we can attach to the process by first giving its ++ # executable name via the file command, and using attach with the ++ # process ID. ++ ++ set test "$threadtype: set file, before attach1 to stopped process" ++ gdb_test_multiple "file $binfile" "$test" { ++ -re "Load new symbol table from.*y or n. $" { ++ gdb_test "y" "Reading symbols from $escapedbinfile\.\.\.*done." \ ++ "$test (re-read)" ++ } ++ -re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $" { ++ pass "$test" ++ } ++ } ++ ++ set test "$threadtype: attach1 to stopped, after setting file" ++ gdb_test_multiple "attach $testpid" "$test" { ++ -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*$gdb_prompt $" { ++ pass "$test" ++ } ++ } ++ ++ # ".*sleep.*clone.*" would fail on s390x as bt stops at START_THREAD there. ++ if {[string equal $threadtype threaded]} { ++ gdb_test "thread apply all bt" ".*sleep.*start_thread.*" "$threadtype: attach1 to stopped bt" ++ } else { ++ gdb_test "bt" ".*sleep.*main.*" "$threadtype: attach1 to stopped bt" ++ } ++ ++ # Exit and detach the process. ++ ++ gdb_exit ++ ++ # Avoid some race: ++ sleep 2 ++ ++ if [catch {open /proc/${testpid}/status r} fileid] { ++ set line2 "NOTFOUND" ++ } else { ++ gets $fileid line1; ++ gets $fileid line2; ++ close $fileid; ++ } ++ ++ set test "$threadtype: attach1, exit leaves process stopped" ++ if {[string match "*(stopped)*" $line2]} { ++ pass $test ++ } else { ++ fail $test ++ } ++ ++ # At this point, the process should still be stopped ++ ++ gdb_start ++ gdb_reinitialize_dir $srcdir/$subdir ++ gdb_load ${binfile} ++ ++ # Verify that we can attach to the process just by giving the ++ # process ID. + + set test "$threadtype: attach2 to stopped, after setting file" + gdb_test_multiple "attach $testpid" "$test" { +diff -up -u -X /home/jkratoch2/.diffi.list -rup gdb-6.8-base/gdb/testsuite/gdb.threads/attachstop-mt.c gdb-6.8/gdb/testsuite/gdb.threads/attachstop-mt.c +--- gdb-6.8-base/gdb/testsuite/gdb.threads/attachstop-mt.c 2008-08-27 17:44:23.000000000 +0200 ++++ gdb-6.8/gdb/testsuite/gdb.threads/attachstop-mt.c 2008-08-27 18:13:41.000000000 +0200 +@@ -1,19 +1,20 @@ + /* This testcase is part of GDB, the GNU debugger. + +- Copyright 2008 Free Software Foundation, Inc. ++ Copyright 2005 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by +- the Free Software Foundation; either version 3 of the License, or ++ the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. +- ++ + You should have received a copy of the GNU General Public License +- along with this program. If not, see . */ ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + + /* This program is intended to be started outside of gdb, then + manually stopped via a signal. */ +diff -up -u -X /home/jkratoch2/.diffi.list -rup gdb-6.8-base/gdb/testsuite/gdb.threads/attachstop-mt.exp gdb-6.8/gdb/testsuite/gdb.threads/attachstop-mt.exp +--- gdb-6.8-base/gdb/testsuite/gdb.threads/attachstop-mt.exp 2008-08-27 17:44:23.000000000 +0200 ++++ gdb-6.8/gdb/testsuite/gdb.threads/attachstop-mt.exp 2008-08-27 18:13:41.000000000 +0200 +@@ -1,26 +1,33 @@ +-# Copyright 2008 +-# Free Software Foundation, Inc. ++# Copyright 2006 + + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by +-# the Free Software Foundation; either version 3 of the License, or ++# the Free Software Foundation; either version 2 of the License, or + # (at your option) any later version. +-# ++# + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details. +-# ++# + # You should have received a copy of the GNU General Public License +-# along with this program. If not, see . ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + # This test was created by modifying gdb.threads/attachstop. + # This file was created by Jan Kratochvil . + # Regression for: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=197584 + ++if $tracelevel then { ++ strace $tracelevel ++} ++ ++set prms_id 0 ++set bug_id 0 ++ + # This test only works on Linux +-if { ![isnative] || [is_remote host] || ![istarget *-linux*] } { +- continue ++if { ![istarget "*-*-linux-gnu*"] } { ++ return 0 + } + + set testfile "attachstop-mt" +@@ -169,12 +176,23 @@ gdb_test "bt" ".*sleep.*(func|main).*" " + # Exit and detach the process. + gdb_exit + +-# Stop the program +-remote_exec build "kill -s STOP ${testpid}" +- + # No race + sleep 2 + ++set fileid3 [open $status2 r]; ++gets $fileid3 line1; ++gets $fileid3 line2; ++close $fileid3; ++ ++set test "attach3, exit leaves process stopped" ++if {[string match "*(stopped)*" $line2]} { ++ pass $test ++} else { ++ fail $test ++} ++ ++# At this point, the process should still be stopped ++ + # Continue the test as we would hit another expected bug regarding + # Program received signal SIGSTOP, Stopped (signal). + # across NPTL threads. diff --git a/gdb-6.8-attach-signalled-upstream.patch b/gdb-6.8-attach-signalled-upstream.patch new file mode 100644 index 0000000..a5a8212 --- /dev/null +++ b/gdb-6.8-attach-signalled-upstream.patch @@ -0,0 +1,1245 @@ +diff -up -ruNp gdb-6.8-orig/gdb/NEWS gdb-6.8/gdb/NEWS +--- gdb-6.8-orig/gdb/NEWS 2008-03-27 19:14:10.000000000 +0100 ++++ gdb-6.8/gdb/NEWS 2008-08-27 17:45:03.000000000 +0200 +@@ -1,6 +1,12 @@ + What has changed in GDB? + (Organized release by release) + ++*** Changes since GDB 6.8 ++ ++* On GNU/Linux, GDB can now attach to stopped processes. Several race ++conditions handling signals delivered during attach or thread creation ++have also been fixed. ++ + *** Changes in GDB 6.8 + + * New native configurations +diff -up -ruNp gdb-6.8-orig/gdb/infcmd.c gdb-6.8/gdb/infcmd.c +--- gdb-6.8-orig/gdb/infcmd.c 2008-01-31 14:37:21.000000000 +0100 ++++ gdb-6.8/gdb/infcmd.c 2008-08-27 17:45:31.000000000 +0200 +@@ -48,6 +48,7 @@ + #include "observer.h" + #include "target-descriptions.h" + #include "user-regs.h" ++#include "gdbthread.h" + + /* Functions exported for general use, in inferior.h: */ + +@@ -1974,6 +1975,7 @@ detach_command (char *args, int from_tty + dont_repeat (); /* Not for the faint of heart. */ + target_detach (args, from_tty); + no_shared_libraries (NULL, from_tty); ++ init_thread_list (); + if (deprecated_detach_hook) + deprecated_detach_hook (); + } +@@ -1992,6 +1994,7 @@ disconnect_command (char *args, int from + dont_repeat (); /* Not for the faint of heart */ + target_disconnect (args, from_tty); + no_shared_libraries (NULL, from_tty); ++ init_thread_list (); + if (deprecated_detach_hook) + deprecated_detach_hook (); + } +diff -up -ruNp gdb-6.8-orig/gdb/infrun.c gdb-6.8/gdb/infrun.c +--- gdb-6.8-orig/gdb/infrun.c 2008-01-29 23:47:19.000000000 +0100 ++++ gdb-6.8/gdb/infrun.c 2008-08-27 17:44:23.000000000 +0200 +@@ -1966,13 +1966,15 @@ handle_inferior_event (struct execution_ + + /* This originates from attach_command(). We need to overwrite + the stop_signal here, because some kernels don't ignore a +- SIGSTOP in a subsequent ptrace(PTRACE_SONT,SOGSTOP) call. +- See more comments in inferior.h. */ +- if (stop_soon == STOP_QUIETLY_NO_SIGSTOP) ++ SIGSTOP in a subsequent ptrace(PTRACE_CONT,SIGSTOP) call. ++ See more comments in inferior.h. On the other hand, if we ++ get a non-SIGSTOP, report it to the user - assume the backend ++ will handle the SIGSTOP if it should show up later. */ ++ if (stop_soon == STOP_QUIETLY_NO_SIGSTOP ++ && stop_signal == TARGET_SIGNAL_STOP) + { + stop_stepping (ecs); +- if (stop_signal == TARGET_SIGNAL_STOP) +- stop_signal = TARGET_SIGNAL_0; ++ stop_signal = TARGET_SIGNAL_0; + return; + } + +@@ -2043,7 +2045,7 @@ process_event_stop_test: + target_terminal_ours_for_output (); + print_stop_reason (SIGNAL_RECEIVED, stop_signal); + } +- if (signal_stop[stop_signal]) ++ if (signal_stop_state (stop_signal)) + { + stop_stepping (ecs); + return; +@@ -3306,7 +3308,9 @@ hook_stop_stub (void *cmd) + int + signal_stop_state (int signo) + { +- return signal_stop[signo]; ++ /* Always stop on signals if we're just gaining control of the ++ program. */ ++ return signal_stop[signo] || stop_soon != NO_STOP_QUIETLY; + } + + int +diff -up -ruNp gdb-6.8-orig/gdb/linux-nat.c gdb-6.8/gdb/linux-nat.c +--- gdb-6.8-orig/gdb/linux-nat.c 2008-01-29 23:47:20.000000000 +0100 ++++ gdb-6.8/gdb/linux-nat.c 2008-08-27 18:00:22.000000000 +0200 +@@ -47,6 +47,30 @@ + #include "gdb_stat.h" /* for struct stat */ + #include /* for O_RDONLY */ + ++/* Note on this file's use of signals: ++ ++ We stop threads by sending a SIGSTOP. The use of SIGSTOP instead ++ of another signal is not entirely significant; we just need for a ++ signal to be delivered, so that we can intercept it. SIGSTOP's ++ advantage is that it can not be blocked. A disadvantage is that it ++ is not a real-time signal, so it can only be queued once; we do not ++ keep track of other sources of SIGSTOP. ++ ++ Two other signals that can't be blocked are SIGCONT and SIGKILL. ++ But we can't use them, because they have special behavior when the ++ signal is generated - not when it is delivered. SIGCONT resumes ++ the entire thread group and SIGKILL kills the entire thread group. ++ ++ A delivered SIGSTOP would stop the entire thread group, not just the ++ thread we tkill'd. But we never let the SIGSTOP deliver; we always ++ intercept and cancel it (by PTRACE_CONT without passing SIGSTOP). ++ ++ We could use a real-time signal instead. This would solve those ++ problems; we could use PTRACE_GETSIGINFO to locate the specific ++ stop signals sent by GDB. But we would still have to have some ++ support for SIGSTOP, since PTRACE_ATTACH generates it, and there ++ are races with trying to find a signal that is not blocked. */ ++ + #ifndef O_LARGEFILE + #define O_LARGEFILE 0 + #endif +@@ -624,6 +648,7 @@ static sigset_t blocked_mask; + static int stop_wait_callback (struct lwp_info *lp, void *data); + static int linux_nat_thread_alive (ptid_t ptid); + static char *linux_child_pid_to_exec_file (int pid); ++static int kill_lwp (int lwpid, int signo); + + /* Convert wait status STATUS to a string. Used for printing debug + messages only. */ +@@ -865,10 +890,103 @@ exit_lwp (struct lwp_info *lp) + delete_lwp (lp->ptid); + } + +-/* Attach to the LWP specified by PID. If VERBOSE is non-zero, print +- a message telling the user that a new LWP has been added to the +- process. Return 0 if successful or -1 if the new LWP could not +- be attached. */ ++/* Detect `T (stopped)' in `/proc/PID/status'. ++ Other states including `T (tracing stop)' are reported as false. */ ++ ++static int ++pid_is_stopped (pid_t pid) ++{ ++ FILE *status_file; ++ char buf[100]; ++ int retval = 0; ++ ++ snprintf (buf, sizeof (buf), "/proc/%d/status", (int) pid); ++ status_file = fopen (buf, "r"); ++ if (status_file != NULL) ++ { ++ int have_state = 0; ++ ++ while (fgets (buf, sizeof (buf), status_file)) ++ { ++ if (strncmp (buf, "State:", 6) == 0) ++ { ++ have_state = 1; ++ break; ++ } ++ } ++ if (have_state && strstr (buf, "T (stopped)") != NULL) ++ retval = 1; ++ fclose (status_file); ++ } ++ return retval; ++} ++ ++/* Wait for the LWP specified by LP, which we have just attached to. ++ Returns a wait status for that LWP, to cache. */ ++ ++static int ++linux_nat_post_attach_wait (ptid_t ptid, int first, int *cloned, ++ int *signalled) ++{ ++ pid_t new_pid, pid = GET_LWP (ptid); ++ int status; ++ ++ if (pid_is_stopped (pid)) ++ { ++ if (debug_linux_nat) ++ fprintf_unfiltered (gdb_stdlog, ++ "LNPAW: Attaching to a stopped process\n"); ++ ++ /* The process is definitely stopped. It is in a job control ++ stop, unless the kernel predates the TASK_STOPPED / ++ TASK_TRACED distinction, in which case it might be in a ++ ptrace stop. Make sure it is in a ptrace stop; from there we ++ can kill it, signal it, et cetera. ++ ++ First make sure there is a pending SIGSTOP. Since we are ++ already attached, the process can not transition from stopped ++ to running without a PTRACE_CONT; so we know this signal will ++ go into the queue. The SIGSTOP generated by PTRACE_ATTACH is ++ probably already in the queue (unless this kernel is old ++ enough to use TASK_STOPPED for ptrace stops); but since SIGSTOP ++ is not an RT signal, it can only be queued once. */ ++ kill_lwp (pid, SIGSTOP); ++ ++ /* Finally, resume the stopped process. This will deliver the SIGSTOP ++ (or a higher priority signal, just like normal PTRACE_ATTACH). */ ++ ptrace (PTRACE_CONT, pid, 0, 0); ++ } ++ ++ /* Make sure the initial process is stopped. The user-level threads ++ layer might want to poke around in the inferior, and that won't ++ work if things haven't stabilized yet. */ ++ new_pid = my_waitpid (pid, &status, 0); ++ if (new_pid == -1 && errno == ECHILD) ++ { ++ if (first) ++ warning (_("%s is a cloned process"), target_pid_to_str (ptid)); ++ ++ /* Try again with __WCLONE to check cloned processes. */ ++ new_pid = my_waitpid (pid, &status, __WCLONE); ++ *cloned = 1; ++ } ++ ++ gdb_assert (pid == new_pid && WIFSTOPPED (status)); ++ ++ if (WSTOPSIG (status) != SIGSTOP) ++ { ++ *signalled = 1; ++ if (debug_linux_nat) ++ fprintf_unfiltered (gdb_stdlog, ++ "LNPAW: Received %s after attaching\n", ++ status_to_str (status)); ++ } ++ ++ return status; ++} ++ ++/* Attach to the LWP specified by PID. Return 0 if successful or -1 ++ if the new LWP could not be attached. */ + + int + lin_lwp_attach_lwp (ptid_t ptid) +@@ -895,9 +1013,7 @@ lin_lwp_attach_lwp (ptid_t ptid) + to happen. */ + if (GET_LWP (ptid) != GET_PID (ptid) && lp == NULL) + { +- pid_t pid; +- int status; +- int cloned = 0; ++ int status, cloned = 0, signalled = 0; + + if (ptrace (PTRACE_ATTACH, GET_LWP (ptid), 0, 0) < 0) + { +@@ -916,24 +1032,18 @@ lin_lwp_attach_lwp (ptid_t ptid) + "LLAL: PTRACE_ATTACH %s, 0, 0 (OK)\n", + target_pid_to_str (ptid)); + +- pid = my_waitpid (GET_LWP (ptid), &status, 0); +- if (pid == -1 && errno == ECHILD) ++ status = linux_nat_post_attach_wait (ptid, 0, &cloned, &signalled); ++ lp = add_lwp (ptid); ++ lp->stopped = 1; ++ lp->cloned = cloned; ++ lp->signalled = signalled; ++ if (WSTOPSIG (status) != SIGSTOP) + { +- /* Try again with __WCLONE to check cloned processes. */ +- pid = my_waitpid (GET_LWP (ptid), &status, __WCLONE); +- cloned = 1; ++ lp->resumed = 1; ++ lp->status = status; + } + +- gdb_assert (pid == GET_LWP (ptid) +- && WIFSTOPPED (status) && WSTOPSIG (status)); +- +- if (lp == NULL) +- lp = add_lwp (ptid); +- lp->cloned = cloned; +- +- target_post_attach (pid); +- +- lp->stopped = 1; ++ target_post_attach (GET_LWP (lp->ptid)); + + if (debug_linux_nat) + { +@@ -963,45 +1073,62 @@ static void + linux_nat_attach (char *args, int from_tty) + { + struct lwp_info *lp; +- pid_t pid; + int status; +- int cloned = 0; + + /* FIXME: We should probably accept a list of process id's, and + attach all of them. */ + linux_ops->to_attach (args, from_tty); + +- /* Make sure the initial process is stopped. The user-level threads +- layer might want to poke around in the inferior, and that won't +- work if things haven't stabilized yet. */ +- pid = my_waitpid (GET_PID (inferior_ptid), &status, 0); +- if (pid == -1 && errno == ECHILD) +- { +- warning (_("%s is a cloned process"), target_pid_to_str (inferior_ptid)); +- +- /* Try again with __WCLONE to check cloned processes. */ +- pid = my_waitpid (GET_PID (inferior_ptid), &status, __WCLONE); +- cloned = 1; +- } +- +- gdb_assert (pid == GET_PID (inferior_ptid) +- && WIFSTOPPED (status) && WSTOPSIG (status) == SIGSTOP); +- + /* Add the initial process as the first LWP to the list. */ + inferior_ptid = BUILD_LWP (GET_PID (inferior_ptid), GET_PID (inferior_ptid)); + lp = add_lwp (inferior_ptid); +- lp->cloned = cloned; + ++ status = linux_nat_post_attach_wait (lp->ptid, 1, &lp->cloned, ++ &lp->signalled); + lp->stopped = 1; + +- /* Fake the SIGSTOP that core GDB expects. */ +- lp->status = W_STOPCODE (SIGSTOP); ++ /* Save the wait status to report later. */ + lp->resumed = 1; + if (debug_linux_nat) ++ fprintf_unfiltered (gdb_stdlog, ++ "LNA: waitpid %ld, saving status %s\n", ++ (long) GET_PID (lp->ptid), status_to_str (status)); ++ ++ lp->status = status; ++ if (debug_linux_nat) + { + fprintf_unfiltered (gdb_stdlog, +- "LLA: waitpid %ld, faking SIGSTOP\n", (long) pid); ++ "LLA: waitpid %ld, faking SIGSTOP\n", ++ (long) GET_PID (lp->ptid)); ++ } ++} ++ ++/* Get pending status of LP. */ ++static int ++get_pending_status (struct lwp_info *lp, int *status) ++{ ++ struct target_waitstatus last; ++ ptid_t last_ptid; ++ ++ get_last_target_status (&last_ptid, &last); ++ ++ /* If this lwp is the ptid that GDB is processing an event from, the ++ signal will be in stop_signal. Otherwise, in all-stop + sync ++ mode, we may cache pending events in lp->status while trying to ++ stop all threads (see stop_wait_callback). In async mode, the ++ events are always cached in waitpid_queue. */ ++ ++ *status = 0; ++ if (GET_LWP (lp->ptid) == GET_LWP (last_ptid)) ++ { ++ if (stop_signal != TARGET_SIGNAL_0 ++ && signal_pass_state (stop_signal)) ++ *status = W_STOPCODE (target_signal_to_host (stop_signal)); + } ++ else ++ *status = lp->status; ++ ++ return 0; + } + + static int +@@ -1014,40 +1141,30 @@ detach_callback (struct lwp_info *lp, vo + strsignal (WSTOPSIG (lp->status)), + target_pid_to_str (lp->ptid)); + +- while (lp->signalled && lp->stopped) ++ /* If there is a pending SIGSTOP, get rid of it. */ ++ if (lp->signalled) + { +- errno = 0; +- if (ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, +- WSTOPSIG (lp->status)) < 0) +- error (_("Can't continue %s: %s"), target_pid_to_str (lp->ptid), +- safe_strerror (errno)); +- + if (debug_linux_nat) + fprintf_unfiltered (gdb_stdlog, +- "DC: PTRACE_CONTINUE (%s, 0, %s) (OK)\n", +- target_pid_to_str (lp->ptid), +- status_to_str (lp->status)); ++ "DC: Sending SIGCONT to %s\n", ++ target_pid_to_str (lp->ptid)); + +- lp->stopped = 0; ++ kill_lwp (GET_LWP (lp->ptid), SIGCONT); + lp->signalled = 0; +- lp->status = 0; +- /* FIXME drow/2003-08-26: There was a call to stop_wait_callback +- here. But since lp->signalled was cleared above, +- stop_wait_callback didn't do anything; the process was left +- running. Shouldn't we be waiting for it to stop? +- I've removed the call, since stop_wait_callback now does do +- something when called with lp->signalled == 0. */ +- +- gdb_assert (lp->status == 0 || WIFSTOPPED (lp->status)); + } + + /* We don't actually detach from the LWP that has an id equal to the + overall process id just yet. */ + if (GET_LWP (lp->ptid) != GET_PID (lp->ptid)) + { ++ int status = 0; ++ ++ /* Pass on any pending signal for this LWP. */ ++ get_pending_status (lp, &status); ++ + errno = 0; + if (ptrace (PTRACE_DETACH, GET_LWP (lp->ptid), 0, +- WSTOPSIG (lp->status)) < 0) ++ WSTOPSIG (status)) < 0) + error (_("Can't detach %s: %s"), target_pid_to_str (lp->ptid), + safe_strerror (errno)); + +@@ -1066,11 +1183,28 @@ detach_callback (struct lwp_info *lp, vo + static void + linux_nat_detach (char *args, int from_tty) + { ++ int status; ++ + iterate_over_lwps (detach_callback, NULL); + + /* Only the initial process should be left right now. */ + gdb_assert (num_lwps == 1); + ++ /* Pass on any pending signal for the last LWP. */ ++ if ((args == NULL || *args == '\0') ++ && get_pending_status (lwp_list, &status) != -1 ++ && WIFSTOPPED (status)) ++ { ++ /* Put the signal number in ARGS so that inf_ptrace_detach will ++ pass it along with PTRACE_DETACH. */ ++ args = alloca (8); ++ sprintf (args, "%d", (int) WSTOPSIG (status)); ++ fprintf_unfiltered (gdb_stdlog, ++ "LND: Sending signal %s to %s\n", ++ args, ++ target_pid_to_str (lwp_list->ptid)); ++ } ++ + trap_ptid = null_ptid; + + /* Destroy LWP info; it's no longer valid. */ +@@ -2490,7 +2624,9 @@ linux_nat_pid_to_str (ptid_t ptid) + { + static char buf[64]; + +- if (lwp_list && lwp_list->next && is_lwp (ptid)) ++ if (is_lwp (ptid) ++ && ((lwp_list && lwp_list->next) ++ || GET_PID (ptid) != GET_LWP (ptid))) + { + snprintf (buf, sizeof (buf), "LWP %ld", GET_LWP (ptid)); + return buf; +@@ -3424,4 +3560,3 @@ lin_thread_get_thread_signals (sigset_t + /* ... except during a sigsuspend. */ + sigdelset (&suspend_mask, cancel); + } +- +diff -up -ruNp gdb-6.8-orig/gdb/testsuite/gdb.threads/attach-into-signal.c gdb-6.8/gdb/testsuite/gdb.threads/attach-into-signal.c +--- gdb-6.8-orig/gdb/testsuite/gdb.threads/attach-into-signal.c 1970-01-01 01:00:00.000000000 +0100 ++++ gdb-6.8/gdb/testsuite/gdb.threads/attach-into-signal.c 2008-08-27 17:44:23.000000000 +0200 +@@ -0,0 +1,67 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2008 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++#include ++#include ++#include ++#include ++#include ++#ifdef USE_THREADS ++#include ++#endif ++ ++void action(int sig, siginfo_t * info, void *uc) ++{ ++ raise (SIGALRM); ++} ++ ++static void *func (void *arg) ++{ ++ struct sigaction act; ++ ++ memset (&act, 0, sizeof(struct sigaction)); ++ act.sa_sigaction = action; ++ act.sa_flags = SA_RESTART; ++ sigaction (SIGALRM, &act, 0); ++ ++ raise (SIGALRM); ++ ++ /* We must not get past this point, either in a free standing or debugged ++ state. */ ++ ++ abort (); ++ /* NOTREACHED */ ++ return NULL; ++} ++ ++int main () ++{ ++ ++#ifndef USE_THREADS ++ ++ func (NULL); ++ ++#else ++ ++ pthread_t th; ++ pthread_create (&th, NULL, func, NULL); ++ pthread_join (th, NULL); ++ ++#endif ++ ++ return 0; ++} +diff -up -ruNp gdb-6.8-orig/gdb/testsuite/gdb.threads/attach-into-signal.exp gdb-6.8/gdb/testsuite/gdb.threads/attach-into-signal.exp +--- gdb-6.8-orig/gdb/testsuite/gdb.threads/attach-into-signal.exp 1970-01-01 01:00:00.000000000 +0100 ++++ gdb-6.8/gdb/testsuite/gdb.threads/attach-into-signal.exp 2008-08-27 17:44:23.000000000 +0200 +@@ -0,0 +1,168 @@ ++# Copyright 2008 ++# Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++# This test was created by modifying attach-stopped.exp. ++# This file was created by Jan Kratochvil . ++ ++# This test only works on Linux ++if { ![isnative] || [is_remote host] || ![istarget *-linux*] } { ++ continue ++} ++ ++set testfile "attach-into-signal" ++set srcfile ${testfile}.c ++set binfile ${objdir}/${subdir}/${testfile} ++set escapedbinfile [string_to_regexp ${objdir}/${subdir}/${testfile}] ++ ++remote_exec build "rm -f ${binfile}" ++# For debugging this test ++# ++#log_user 1 ++ ++proc corefunc { threadtype } { ++ global srcfile ++ global binfile ++ global escapedbinfile ++ global srcdir ++ global subdir ++ global gdb_prompt ++ ++ if [get_compiler_info ${binfile}] { ++ return -1 ++ } ++ ++ # Start the program running and then wait for a bit, to be sure ++ # that it can be attached to. ++ # Statistically there is a better chance without giving process a nice. ++ ++ set testpid [eval exec $binfile &] ++ exec sleep 2 ++ ++ # Run 2 passes of the test. ++ # The C file inferior stops pending its signals if a single one is lost, ++ # we test successful redelivery of the caught signal by the 2nd pass. ++ ++ # linux-2.6.20.4.x86_64 had maximal attempt # 20 in 4 test runs. ++ set attempts 100 ++ set attempt 1 ++ set passes 1 ++ while { $passes < 3 && $attempt <= $attempts } { ++ set stoppedtry 0 ++ while { $stoppedtry < 10 } { ++ if [catch {open /proc/${testpid}/status r} fileid] { ++ set stoppedtry 10 ++ break ++ } ++ gets $fileid line1; ++ gets $fileid line2; ++ close $fileid; ++ ++ if {![string match "*(stopped)*" $line2]} { ++ # No PASS message as we may be looping in multiple attempts. ++ break ++ } ++ sleep 1 ++ set stoppedtry [expr $stoppedtry + 1] ++ } ++ if { $stoppedtry >= 10 } { ++ verbose -log $line2 ++ set test "$threadtype: process is still running on the attempt # $attempt of $attempts" ++ break ++ } ++ ++ # Main test: ++ set test "$threadtype: attach (pass $passes), pending signal catch" ++ if {[gdb_test_multiple "attach $testpid" $test { ++ -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*Received Alarm clock.*$gdb_prompt $" { ++ # nonthreaded: ++ pass $test ++ verbose -log "$test succeeded on the attempt # $attempt of $attempts" ++ set passes [expr $passes + 1] ++ } ++ -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*$gdb_prompt $" { ++ # nonthreaded: ++ # We just lack the luck, we should try it again. ++ set attempt [expr $attempt + 1] ++ } ++ -re "Attaching to process $testpid.*Received Alarm clock.*$gdb_prompt $" { ++ # threaded: ++ pass $test ++ verbose -log "$test succeeded on the attempt # $attempt of $attempts" ++ set passes [expr $passes + 1] ++ } ++ -re "Attaching to process $testpid.*$gdb_prompt $" { ++ # threaded: ++ # We just lack the luck, we should try it again. ++ set attempt [expr $attempt - 1] ++ } ++ }] != 0 } { ++ break ++ } ++ ++ gdb_test "detach" "Detaching from.*" "" ++ } ++ if {$passes < 3} { ++ if {$attempt > $attempts} { ++ unresolved $test ++ } else { ++ fail $test ++ } ++ } ++ ++ # Exit and detach the process. ++ ++ gdb_exit ++ ++ # Make sure we don't leave a process around to confuse ++ # the next test run (and prevent the compile by keeping ++ # the text file busy), in case the "set should_exit" didn't ++ # work. ++ ++ # Continue the program - some Linux kernels need it before -9 if the ++ # process is stopped. ++ remote_exec build "kill -s CONT ${testpid}" ++ ++ remote_exec build "kill -9 ${testpid}" ++} ++ ++# Start with clean gdb ++gdb_exit ++ ++# build the test case first without threads ++# ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { ++ gdb_suppress_entire_file "Testcase nonthraded compile failed, so all tests in this file will automatically fail." ++} ++ ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++gdb_test "set debug lin-lwp 1" "" "" ++ ++corefunc nonthreaded ++ ++# build the test case also with threads ++# ++if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DUSE_THREADS}] != "" } { ++ gdb_suppress_entire_file "Testcase threaded compile failed, so all tests in this file will automatically fail." ++} ++ ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++gdb_test "set debug lin-lwp 1" "" "" ++ ++corefunc threaded +diff -up -ruNp gdb-6.8-orig/gdb/testsuite/gdb.threads/attach-stopped.c gdb-6.8/gdb/testsuite/gdb.threads/attach-stopped.c +--- gdb-6.8-orig/gdb/testsuite/gdb.threads/attach-stopped.c 1970-01-01 01:00:00.000000000 +0100 ++++ gdb-6.8/gdb/testsuite/gdb.threads/attach-stopped.c 2008-08-27 17:44:23.000000000 +0200 +@@ -0,0 +1,50 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2008 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++/* This program is intended to be started outside of gdb, then ++ manually stopped via a signal. */ ++ ++#include ++#include ++#ifdef USE_THREADS ++#include ++#endif ++ ++static void *func (void *arg) ++{ ++ sleep (10000); /* Ridiculous time, but we will eventually kill it. */ ++ sleep (10000); /* Second sleep. */ ++ return NULL; ++} ++ ++int main () ++{ ++ ++#ifndef USE_THREADS ++ ++ func (NULL); ++ ++#else ++ ++ pthread_t th; ++ pthread_create (&th, NULL, func, NULL); ++ pthread_join (th, NULL); ++ ++#endif ++ ++ return 0; ++} +diff -up -ruNp gdb-6.8-orig/gdb/testsuite/gdb.threads/attach-stopped.exp gdb-6.8/gdb/testsuite/gdb.threads/attach-stopped.exp +--- gdb-6.8-orig/gdb/testsuite/gdb.threads/attach-stopped.exp 1970-01-01 01:00:00.000000000 +0100 ++++ gdb-6.8/gdb/testsuite/gdb.threads/attach-stopped.exp 2008-08-27 17:44:23.000000000 +0200 +@@ -0,0 +1,157 @@ ++# Copyright 2008 ++# Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++# This test was created by modifying attach.exp. ++# This file was created by Jeff Johnston . ++# This file was updated by Jan Kratochvil . ++ ++# This test only works on Linux ++if { ![isnative] || [is_remote host] || ![istarget *-linux*] } { ++ continue ++} ++ ++set testfile "attach-stopped" ++set srcfile ${testfile}.c ++set binfile ${objdir}/${subdir}/${testfile} ++set escapedbinfile [string_to_regexp ${objdir}/${subdir}/${testfile}] ++ ++#execute_anywhere "rm -f ${binfile}" ++remote_exec build "rm -f ${binfile}" ++# For debugging this test ++# ++#log_user 1 ++ ++proc corefunc { threadtype } { ++ global srcfile ++ global binfile ++ global escapedbinfile ++ global srcdir ++ global subdir ++ global gdb_prompt ++ ++ if [get_compiler_info ${binfile}] { ++ return -1 ++ } ++ ++ # Start the program running and then wait for a bit, to be sure ++ # that it can be attached to. ++ ++ set testpid [eval exec $binfile &] ++ ++ # Avoid some race: ++ sleep 2 ++ ++ # Stop the program ++ remote_exec build "kill -s STOP ${testpid}" ++ ++ # Start with clean gdb ++ gdb_exit ++ gdb_start ++ gdb_reinitialize_dir $srcdir/$subdir ++ gdb_load ${binfile} ++ ++ # Verify that we can attach to the stopped process. ++ ++ set test "$threadtype: attach2 to stopped, after setting file" ++ gdb_test_multiple "attach $testpid" "$test" { ++ -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*$gdb_prompt $" { ++ pass "$test" ++ } ++ } ++ ++ # ".*sleep.*clone.*" would fail on s390x as bt stops at START_THREAD there. ++ if {[string equal $threadtype threaded]} { ++ gdb_test "thread apply all bt" ".*sleep.*start_thread.*" "$threadtype: attach2 to stopped bt" ++ } else { ++ gdb_test "bt" ".*sleep.*main.*" "$threadtype: attach2 to stopped bt" ++ } ++ # This breakpoint is there for old/non-x86 kernels not restarting syscalls. ++ gdb_breakpoint [gdb_get_line_number "Second sleep"] ++ set test "$threadtype: attach2 continue" ++ send_gdb "continue\n" ++ gdb_expect { ++ -re "Continuing" ++ { pass "continue ($test)" } ++ timeout ++ { fail "continue ($test) (timeout)" } ++ } ++ ++ # For this to work we must be sure to consume the "Continuing." ++ # message first, or GDB's signal handler may not be in place. ++ after 1000 {send_gdb "\003"} ++ set test "$threadtype: attach2 stop interrupt" ++ gdb_expect 10 { ++ -re "Program received signal SIGINT.*$gdb_prompt $" ++ { ++ pass $test ++ } ++ -re "Breakpoint \[0-9\].*$srcfile.*$gdb_prompt $" ++ { ++ pass $test ++ } ++ timeout ++ { ++ fail $test ++ } ++ } ++ ++ gdb_exit ++ ++ # Avoid some race: ++ sleep 2 ++ ++ # At this point, the process should be sleeping ++ ++ if [catch {open /proc/${testpid}/status r} fileid2] { ++ set line2 "NOTFOUND" ++ } else { ++ gets $fileid2 line1; ++ gets $fileid2 line2; ++ close $fileid2; ++ } ++ ++ set test "$threadtype: attach2, exit leaves process sleeping" ++ if {[string match "*(sleeping)*" $line2]} { ++ pass $test ++ } else { ++ fail $test ++ } ++ ++ # Make sure we don't leave a process around to confuse ++ # the next test run (and prevent the compile by keeping ++ # the text file busy), in case the "set should_exit" didn't ++ # work. ++ ++ remote_exec build "kill -9 ${testpid}" ++} ++ ++# build the test case first without threads ++# ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { ++ gdb_suppress_entire_file "Testcase nonthraded compile failed, so all tests in this file will automatically fail." ++} ++ ++corefunc nonthreaded ++ ++# build the test case first without threads ++# ++if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DUSE_THREADS}] != "" } { ++ gdb_suppress_entire_file "Testcase threaded compile failed, so all tests in this file will automatically fail." ++} ++ ++corefunc threaded ++ ++return 0 +diff -up -ruNp gdb-6.8-orig/gdb/testsuite/gdb.threads/attachstop-mt.c gdb-6.8/gdb/testsuite/gdb.threads/attachstop-mt.c +--- gdb-6.8-orig/gdb/testsuite/gdb.threads/attachstop-mt.c 1970-01-01 01:00:00.000000000 +0100 ++++ gdb-6.8/gdb/testsuite/gdb.threads/attachstop-mt.c 2008-08-27 17:44:23.000000000 +0200 +@@ -0,0 +1,55 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2008 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++/* This program is intended to be started outside of gdb, then ++ manually stopped via a signal. */ ++ ++#include ++#include ++#include ++ ++/* Red Hat BZ PR 197584.c */ ++ ++void *func (void *arg) ++{ ++ sleep (10000); /* Ridiculous time, but we will eventually kill it. */ ++ sleep (10000); /* RHEL3U8 kernel-2.4.21-47.EL will cut the sleep time. */ ++ ++ return NULL; /* thread-sleep */ ++} ++ ++int main () ++{ ++ pthread_t t1,t2; ++ int ret; ++ ++ ret = pthread_create (&t1, NULL, func, NULL); ++ if (ret) ++ fprintf(stderr, "pthread_create(): %s", strerror (ret)); ++ ret = pthread_create (&t2, NULL, func, NULL); ++ if (ret) ++ fprintf(stderr, "pthread_create(): %s", strerror (ret)); ++ ++ ret = pthread_join (t1, NULL); ++ if (ret) /* first-join */ ++ fprintf(stderr, "pthread_join(): %s", strerror (ret)); ++ ret = pthread_join (t2, NULL); ++ if (ret) ++ fprintf(stderr, "pthread_join(): %s", strerror (ret)); ++ ++ return 0; ++} +diff -up -ruNp gdb-6.8-orig/gdb/testsuite/gdb.threads/attachstop-mt.exp gdb-6.8/gdb/testsuite/gdb.threads/attachstop-mt.exp +--- gdb-6.8-orig/gdb/testsuite/gdb.threads/attachstop-mt.exp 1970-01-01 01:00:00.000000000 +0100 ++++ gdb-6.8/gdb/testsuite/gdb.threads/attachstop-mt.exp 2008-08-27 17:44:23.000000000 +0200 +@@ -0,0 +1,260 @@ ++# Copyright 2008 ++# Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++# This test was created by modifying gdb.threads/attachstop. ++# This file was created by Jan Kratochvil . ++# Regression for: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=197584 ++ ++# This test only works on Linux ++if { ![isnative] || [is_remote host] || ![istarget *-linux*] } { ++ continue ++} ++ ++set testfile "attachstop-mt" ++set srcfile ${testfile}.c ++set binfile ${objdir}/${subdir}/${testfile} ++set escapedbinfile [string_to_regexp ${objdir}/${subdir}/${testfile}] ++ ++#execute_anywhere "rm -f ${binfile}" ++remote_exec build "rm -f ${binfile}" ++# For debugging this test ++# ++#log_user 1 ++ ++# build the test case ++# ++if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { ++ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." ++} ++ ++if [get_compiler_info ${binfile}] { ++ return -1 ++} ++ ++# Start the program running and then wait for a bit, to be sure ++# that it can be attached to. ++ ++set testpid [eval exec $binfile &] ++ ++# No race ++sleep 2 ++ ++# Do not: set testpid2 [expr $testpid + 1] ++# as it will not exist on Red Hat 2.6.9-34.0.2.ELsmp ++set testpid2 [expr $testpid + 2] ++ ++set status2 /proc/${testpid}/task/${testpid2}/status ++if {[expr ! [file exists $status2]]} { ++ # kernel-2.4 ++ set status2 /proc/${testpid2}/status ++} ++ ++# Initial sanity test it is normally sleeping ++set fileid0 [open $status2 r]; ++gets $fileid0 line1; ++gets $fileid0 line2; ++close $fileid0; ++ ++set test "attach0, initial sanity check of the sleeping state" ++if {[string match "*(sleeping)*" $line2]} { ++ pass $test ++} else { ++ fail $test ++} ++ ++# Sttach and detach to test it will not become stopped ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++ ++set test "attach0 to sleeping" ++gdb_test_multiple "attach $testpid" "$test" { ++ -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*$gdb_prompt $" { ++ pass "$test" ++ } ++} ++ ++gdb_test "gcore /dev/null" ".*aved corefile.*" "attach0 to sleeping gcore invocation" ++ ++gdb_test "thread 2" ".*witching to thread 2 .*" "attach0 to sleeping switch thread" ++ ++gdb_test "bt" ".*sleep.*func.*" "attach0 to sleeping bt" ++ ++# Exit and detach the process. ++ ++gdb_exit ++ ++# No race ++sleep 2 ++ ++# Check it did not get stopped by our gdb ++set fileid1 [open $status2 r]; ++gets $fileid1 line1; ++gets $fileid1 line2; ++close $fileid1; ++ ++set test "attach1, post-gdb sanity check of the sleeping state - Red Hat BZ 197584" ++if {[string match "*(sleeping)*" $line2]} { ++ pass $test ++} else { ++ fail $test ++} ++ ++# Stop the program ++remote_exec build "kill -s STOP ${testpid}" ++ ++# No race ++sleep 2 ++ ++# Check it really got stopped by kill(1) ++set fileid2 [open $status2 r]; ++gets $fileid2 line1; ++gets $fileid2 line2; ++close $fileid2; ++ ++set test "attach2, initial sanity check of the stopped state" ++if {[string match "*(stopped)*" $line2]} { ++ pass $test ++} else { ++ fail $test ++} ++ ++# Start with clean gdb ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++ ++# Verify that we can attach to the process by first giving its ++# executable name via the file command, and using attach with the ++# process ID. ++ ++set test "set file, before attach3 to stopped process" ++gdb_test_multiple "file $binfile" "$test" { ++ -re "Load new symbol table from.*y or n. $" { ++ gdb_test "y" "Reading symbols from $escapedbinfile\.\.\.*done." \ ++ "$test (re-read)" ++ } ++ -re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $" { ++ pass "$test" ++ } ++} ++ ++set test "attach3 to stopped, after setting file" ++gdb_test_multiple "attach $testpid" "$test" { ++ -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*$gdb_prompt $" { ++ pass "$test" ++ } ++} ++ ++# We may be already after the threads phase. ++# `thread 2' command is important for the test to switch the current thread to ++# a non-primary one for the detach process. ++ ++gdb_test "thread 2" ".*(witching to thread 2 |hread ID 2 not known).*" "attach3 to stopped switch thread" ++gdb_test "bt" ".*sleep.*(func|main).*" "attach3 to stopped bt" ++ ++# Exit and detach the process. ++gdb_exit ++ ++# Stop the program ++remote_exec build "kill -s STOP ${testpid}" ++ ++# No race ++sleep 2 ++ ++# Continue the test as we would hit another expected bug regarding ++# Program received signal SIGSTOP, Stopped (signal). ++# across NPTL threads. ++ ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++ ++# Verify that we can attach to the process just by giving the ++# process ID. ++ ++set test "attach4 to stopped, after setting file" ++gdb_test_multiple "attach $testpid" "$test" { ++ -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*$gdb_prompt $" { ++ pass "$test" ++ } ++} ++ ++# We may be already after the threads phase. ++# `thread 2' command is important for the test to switch the current thread to ++# a non-primary one for the detach process. ++ ++gdb_test "thread 2" ".*(witching to thread 2 |hread ID 2 not known).*" "attach4 to stopped switch thread" ++gdb_test "bt" ".*sleep.*(func|main).*" "attach4 to stopped bt" ++ ++# RHEL3U8 kernel-2.4.21-47.EL will not return SIGINT but only shorten the sleep. ++gdb_breakpoint [gdb_get_line_number "Ridiculous time"] ++gdb_breakpoint [gdb_get_line_number "cut the sleep time"] ++set test "attach4 continue" ++send_gdb "continue\n" ++gdb_expect { ++ -re "Continuing" ++ { pass "continue ($test)" } ++ timeout ++ { fail "continue ($test) (timeout)" } ++} ++ ++# For this to work we must be sure to consume the "Continuing." ++# message first, or GDB's signal handler may not be in place. ++after 1000 {send_gdb "\003"} ++set test "attach4 stop by interrupt" ++gdb_expect { ++ -re "Program received signal SIGINT.*$gdb_prompt $" ++ { ++ pass $test ++ } ++ -re "Breakpoint \[0-9\].*$srcfile.*$gdb_prompt $" ++ { ++ pass $test ++ } ++ timeout ++ { ++ fail "$test (timeout)" ++ } ++} ++ ++gdb_exit ++ ++# No race ++sleep 2 ++ ++# At this point, the process should be sleeping ++ ++set fileid4 [open $status2 r]; ++gets $fileid4 line1; ++gets $fileid4 line2; ++close $fileid4; ++ ++set test "attach4, exit leaves process sleeping" ++if {[string match "*(sleeping)*" $line2]} { ++ pass $test ++} else { ++ fail $test ++} ++ ++# Make sure we don't leave a process around to confuse ++# the next test run (and prevent the compile by keeping ++# the text file busy), in case the "set should_exit" didn't ++# work. ++ ++remote_exec build "kill -9 ${testpid}" ++ ++return 0 diff --git a/gdb-6.8-breakpoint-gone.patch b/gdb-6.8-breakpoint-gone.patch new file mode 100644 index 0000000..509aa36 --- /dev/null +++ b/gdb-6.8-breakpoint-gone.patch @@ -0,0 +1,18 @@ +A part of: + http://sourceware.org/ml/gdb-cvs/2008-06/msg00160.html + +It was crashing the RH testcase `gdb.threads/watchthreads2.exp'. + +diff -up -u -X /root/jkratoch/.diffi.list -rup gdb-6.8/gdb/breakpoint.c gdb-6.8-patched/gdb/breakpoint.c +--- gdb-6.8/gdb/breakpoint.c 2008-08-28 11:56:56.000000000 +0200 ++++ gdb-6.8-patched/gdb/breakpoint.c 2008-08-28 11:53:43.000000000 +0200 +@@ -3173,6 +3173,9 @@ bpstat_what (bpstat bs) + /* I suspect this can happen if it was a momentary breakpoint + which has since been deleted. */ + continue; ++ if (bs->breakpoint_at->owner == NULL) ++ bs_class = bp_nostop; ++ else + switch (bs->breakpoint_at->owner->type) + { + case bp_none: diff --git a/gdb.spec b/gdb.spec index b020636..298c782 100644 --- a/gdb.spec +++ b/gdb.spec @@ -16,7 +16,7 @@ Version: 6.8 # 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: 20%{?_with_upstream:.upstream}%{?dist} +Release: 21%{?_with_upstream:.upstream}%{?dist} License: GPLv3+ Group: Development/Debuggers @@ -281,11 +281,6 @@ Patch249: gdb-6.6-gcore32-test.patch # Avoid too long timeouts on failing cases of "annota1.exp annota3.exp". Patch254: gdb-6.6-testsuite-timeouts.patch -# Fix attaching to stopped processes (BZ 219118, 233852). -# Fix attaching during a pending signal being delivered. -Patch256: gdb-6.7-bz233852-attach-signalled-fix.patch -Patch275: gdb-6.7-bz233852-attach-signalled-test.patch - # Support for stepping over PPC atomic instruction sequences (BZ 237572). Patch258: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch @@ -393,6 +388,13 @@ Patch333: gdb-6.8-fortran-module-ignore.patch # bare names of constructors and destructors should be unique for GDB-6.8+. Patch334: gdb-6.8-ctors-dtors-unique.patch +# Fix attaching to stopped processes and/or pending signals. +Patch336: gdb-6.8-attach-signalled-upstream.patch +Patch337: gdb-6.8-attach-signalled-detach-stopped.patch + +# Fix occasional crash on a removed watchpoint. +Patch338: gdb-6.8-breakpoint-gone.patch + BuildRequires: ncurses-devel glibc-devel gcc make gzip texinfo dejagnu gettext BuildRequires: flex bison sharutils expat-devel Requires: readline @@ -544,7 +546,6 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c %patch247 -p1 %patch249 -p1 %patch254 -p1 -###%patch256 -p1 %patch258 -p1 %patch260 -p1 %patch261 -p1 @@ -553,7 +554,6 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c %patch266 -p1 %patch271 -p1 %patch274 -p1 -%patch275 -p1 %patch277 -p1 %patch280 -p1 %patch282 -p1 @@ -583,6 +583,9 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c %patch332 -p1 %patch333 -p1 %patch334 -p1 +%patch336 -p1 +%patch337 -p1 +%patch338 -p1 %patch124 -p1 find -name "*.orig" | xargs rm -f @@ -835,6 +838,14 @@ fi %endif %changelog +* Thu Aug 28 2008 Jan Kratochvil - 6.8-21 +- Fix attaching to stopped processes, based on the upstream version now. + - Just kernel-2.6.25 neither upstream nor utrace work with it; 2.6.9 works. +- Fix occasional crash on a removed watchpoint. +- Fix false testcase FAILs for `gdb.pie/break.exp'. +- Fix a false warning (+a testcase FAIL) on s390x watchpoints. +- Fix a false FAIL on s390x `gdb.base/dump.exp'. + * Wed Aug 27 2008 Jan Kratochvil - 6.8-20 - Remove `gdb-6.3-nonthreaded-wp-20050117.patch' as obsoleted + regressing now. - Make the GDB quit processing non-abortable to cleanup everything properly.