| Index: gdb/testsuite/gdb.threads/stepi-random-signal.c
|
| diff --git a/gdb/testsuite/gdb.multi/watchpoint-multi.c b/gdb/testsuite/gdb.threads/stepi-random-signal.c
|
| similarity index 66%
|
| copy from gdb/testsuite/gdb.multi/watchpoint-multi.c
|
| copy to gdb/testsuite/gdb.threads/stepi-random-signal.c
|
| index 51697b0b3e34a1dc7725c281b247de4bb49575b5..2aec7f1bedfc9a7f615194567a60f29308b9e87a 100644
|
| --- a/gdb/testsuite/gdb.multi/watchpoint-multi.c
|
| +++ b/gdb/testsuite/gdb.threads/stepi-random-signal.c
|
| @@ -1,6 +1,6 @@
|
| /* This testcase is part of GDB, the GNU debugger.
|
|
|
| - Copyright 2012 Free Software Foundation, Inc.
|
| + Copyright 2013 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
|
| @@ -16,36 +16,33 @@
|
| along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
|
| #include <pthread.h>
|
| -#include <assert.h>
|
| +#include <signal.h>
|
| +#include <unistd.h>
|
|
|
| -static volatile int a, b, c;
|
| -
|
| -static void
|
| -marker_exit (void)
|
| -{
|
| - a = 1;
|
| -}
|
| +static pthread_t main_thread;
|
|
|
| static void *
|
| start (void *arg)
|
| {
|
| - b = 2;
|
| - c = 3;
|
| + /* A signal whose default action is ignore. */
|
| + pthread_kill (main_thread, SIGCHLD);
|
|
|
| + while (1)
|
| + sleep (1); /* set break here */
|
| return NULL;
|
| }
|
|
|
| int
|
| main (void)
|
| {
|
| + unsigned int counter = 1;
|
| pthread_t thread;
|
| - int i;
|
|
|
| - i = pthread_create (&thread, NULL, start, NULL);
|
| - assert (i == 0);
|
| - i = pthread_join (thread, NULL);
|
| - assert (i == 0);
|
| + main_thread = pthread_self ();
|
| + pthread_create (&thread, NULL, start, NULL);
|
| +
|
| + while (counter != 0)
|
| + counter++; /* set break 2 here */
|
|
|
| - marker_exit ();
|
| return 0;
|
| }
|
|
|