* gdb.threads/sigstep-threads.exp: New file.
* gdb.threads/sigstep-threads.c: New file.
-Index: gdb-7.2.50.20110117/gdb/linux-nat.c
+Index: gdb-7.4.50.20111218/gdb/linux-nat.c
===================================================================
---- gdb-7.2.50.20110117.orig/gdb/linux-nat.c 2011-01-17 15:53:14.000000000 +0100
-+++ gdb-7.2.50.20110117/gdb/linux-nat.c 2011-01-17 16:05:57.000000000 +0100
-@@ -2803,6 +2803,8 @@ stop_wait_callback (struct lwp_info *lp,
+--- gdb-7.4.50.20111218.orig/gdb/linux-nat.c 2011-12-19 01:25:42.000000000 +0100
++++ gdb-7.4.50.20111218/gdb/linux-nat.c 2011-12-19 02:17:05.412607735 +0100
+@@ -2843,6 +2843,8 @@ stop_wait_callback (struct lwp_info *lp,
{
int status;
status = wait_lwp (lp);
if (status == 0)
return 0;
-@@ -2828,110 +2830,61 @@ stop_wait_callback (struct lwp_info *lp,
+@@ -2868,110 +2870,61 @@ stop_wait_callback (struct lwp_info *lp,
if (WSTOPSIG (status) != SIGSTOP)
{
- status_to_str ((int) status));
- kill_lwp (GET_LWP (lp->ptid), WSTOPSIG (lp->status));
- }
-+ /* Save the trap's siginfo in case we need it later. */
-+ save_siginfo (lp);
-
+-
- /* Save the sigtrap event. */
- lp->status = status;
- return 0;
- {
- /* The thread was stopped with a signal other than
- SIGSTOP, and didn't accidentally trip a breakpoint. */
-+ save_sigtrap (lp);
++ /* Save the trap's siginfo in case we need it later. */
++ save_siginfo (lp);
- if (debug_linux_nat)
- {
- "SWC: PTRACE_CONT %s, 0, 0 (%s)\n",
- target_pid_to_str (lp->ptid),
- errno ? safe_strerror (errno) : "OK");
--
++ save_sigtrap (lp);
+
- /* Hold this event/waitstatus while we check to see if
- there are any more (we still want to get that SIGSTOP). */
- stop_wait_callback (lp, NULL);
lp->signalled = 0;
}
}
-@@ -3514,52 +3467,6 @@ retry:
+@@ -3627,54 +3580,6 @@ retry:
lp = NULL;
}
-- if (lp && lp->signalled)
+- if (lp && lp->signalled && lp->last_resume_kind != resume_stop)
- {
- /* A pending SIGSTOP may interfere with the normal stream of
- events. In a typical case where interference is a problem,
- /* Resume the thread. It should halt immediately returning the
- pending SIGSTOP. */
- registers_changed ();
+- if (linux_nat_prepare_to_resume != NULL)
+- linux_nat_prepare_to_resume (lp);
- linux_ops->to_resume (linux_ops, pid_to_ptid (GET_LWP (lp->ptid)),
- lp->step, TARGET_SIGNAL_0);
- if (debug_linux_nat)
if (!target_can_async_p ())
{
/* Causes SIGINT to be passed on to the attached process. */
-Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.threads/siginfo-threads.c
+Index: gdb-7.4.50.20111218/gdb/testsuite/gdb.threads/siginfo-threads.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.2.50.20110117/gdb/testsuite/gdb.threads/siginfo-threads.c 2011-01-17 16:02:40.000000000 +0100
++++ gdb-7.4.50.20111218/gdb/testsuite/gdb.threads/siginfo-threads.c 2011-12-19 02:16:35.236720272 +0100
@@ -0,0 +1,447 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+
+ return EXIT_SUCCESS;
+}
-Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.threads/siginfo-threads.exp
+Index: gdb-7.4.50.20111218/gdb/testsuite/gdb.threads/siginfo-threads.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.2.50.20110117/gdb/testsuite/gdb.threads/siginfo-threads.exp 2011-01-17 16:02:40.000000000 +0100
++++ gdb-7.4.50.20111218/gdb/testsuite/gdb.threads/siginfo-threads.exp 2011-12-19 02:16:35.237720268 +0100
@@ -0,0 +1,94 @@
+# Copyright 2010 Free Software Foundation, Inc.
+
+}
+
+gdb_continue_to_breakpoint break-at-exit ".*break-at-exit.*"
-Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.threads/sigstep-threads.c
+Index: gdb-7.4.50.20111218/gdb/testsuite/gdb.threads/sigstep-threads.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.2.50.20110117/gdb/testsuite/gdb.threads/sigstep-threads.c 2011-01-17 16:02:40.000000000 +0100
++++ gdb-7.4.50.20111218/gdb/testsuite/gdb.threads/sigstep-threads.c 2011-12-19 02:16:35.237720268 +0100
@@ -0,0 +1,54 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ start (NULL); /* main-start */
+ return 0;
+}
-Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.threads/sigstep-threads.exp
+Index: gdb-7.4.50.20111218/gdb/testsuite/gdb.threads/sigstep-threads.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.2.50.20110117/gdb/testsuite/gdb.threads/sigstep-threads.exp 2011-01-17 16:02:40.000000000 +0100
++++ gdb-7.4.50.20111218/gdb/testsuite/gdb.threads/sigstep-threads.exp 2011-12-19 02:16:35.237720268 +0100
@@ -0,0 +1,74 @@
+# Copyright 2010 Free Software Foundation, Inc.
+