aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/testsuite/ChangeLog10
-rw-r--r--gdb/testsuite/gdb.threads/watchpoint-fork-child.c4
-rw-r--r--gdb/testsuite/gdb.threads/watchpoint-fork-mt.c7
-rw-r--r--gdb/testsuite/gdb.threads/watchpoint-fork-st.c4
-rw-r--r--gdb/testsuite/gdb.threads/watchpoint-fork.h3
5 files changed, 19 insertions, 9 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 49e87bc..c992a59 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,15 @@
2016-03-01 Pedro Alves <palves@redhat.com>
+ * gdb.threads/watchpoint-fork-child.c: Include "watchpoint-fork.h"
+ before anything else.
+ * gdb.threads/watchpoint-fork-mt.c: Likewise. Don't define
+ _GNU_SOURCE here.
+ * gdb.threads/watchpoint-fork-st.c: Include "watchpoint-fork.h"
+ before anything else.
+ * gdb.threads/watchpoint-fork.h: Define _GNU_SOURCE.
+
+2016-03-01 Pedro Alves <palves@redhat.com>
+
* gdb.base/catch-fork-kill.c: Include <sys/wait.h>.
2016-03-01 Yao Qi <yao.qi@linaro.org>
diff --git a/gdb/testsuite/gdb.threads/watchpoint-fork-child.c b/gdb/testsuite/gdb.threads/watchpoint-fork-child.c
index 92ca0e5..b84a122 100644
--- a/gdb/testsuite/gdb.threads/watchpoint-fork-child.c
+++ b/gdb/testsuite/gdb.threads/watchpoint-fork-child.c
@@ -17,6 +17,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
+#include "watchpoint-fork.h"
+
#include <string.h>
#include <errno.h>
#include <unistd.h>
@@ -24,8 +26,6 @@
#include <signal.h>
#include <stdio.h>
-#include "watchpoint-fork.h"
-
/* `pid_t' may not be available. */
static volatile int usr1_got;
diff --git a/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c b/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c
index f603b6d..bc967ce 100644
--- a/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c
+++ b/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c
@@ -17,22 +17,19 @@
You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
+#include "watchpoint-fork.h"
+
#include <assert.h>
#include <unistd.h>
#include <sys/wait.h>
#include <stdio.h>
#include <stdlib.h>
-
-/* pthread_yield is a GNU extension. */
-#define _GNU_SOURCE
#include <pthread.h>
#include <asm/unistd.h>
#include <unistd.h>
#define gettid() syscall (__NR_gettid)
-#include "watchpoint-fork.h"
-
/* Non-atomic `var++' should not hurt as we synchronize the threads by the STEP
variable. Hit-comments need to be duplicated there to catch both at-stops
and behind-stops, depending on the target. */
diff --git a/gdb/testsuite/gdb.threads/watchpoint-fork-st.c b/gdb/testsuite/gdb.threads/watchpoint-fork-st.c
index 41ddf13..bd3a3f2 100644
--- a/gdb/testsuite/gdb.threads/watchpoint-fork-st.c
+++ b/gdb/testsuite/gdb.threads/watchpoint-fork-st.c
@@ -17,14 +17,14 @@
You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
+#include "watchpoint-fork.h"
+
#include <assert.h>
#include <unistd.h>
#include <sys/wait.h>
#include <stdio.h>
#include <stdlib.h>
-#include "watchpoint-fork.h"
-
volatile int var;
void
diff --git a/gdb/testsuite/gdb.threads/watchpoint-fork.h b/gdb/testsuite/gdb.threads/watchpoint-fork.h
index 8ea1937..87307ae 100644
--- a/gdb/testsuite/gdb.threads/watchpoint-fork.h
+++ b/gdb/testsuite/gdb.threads/watchpoint-fork.h
@@ -17,6 +17,9 @@
You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
+/* pthread_yield is a GNU extension. */
+#define _GNU_SOURCE
+
#ifdef THREAD
#include <pthread.h>