| Index: gdb/testsuite/gdb.multi/watchpoint-multi.c
|
| diff --git a/gdb/testsuite/gdb.threads/leader-exit.c b/gdb/testsuite/gdb.multi/watchpoint-multi.c
|
| similarity index 72%
|
| copy from gdb/testsuite/gdb.threads/leader-exit.c
|
| copy to gdb/testsuite/gdb.multi/watchpoint-multi.c
|
| index fb97a6cd5eed882ebf65a935c89eb338325cf1d6..51697b0b3e34a1dc7725c281b247de4bb49575b5 100644
|
| --- a/gdb/testsuite/gdb.threads/leader-exit.c
|
| +++ b/gdb/testsuite/gdb.multi/watchpoint-multi.c
|
| @@ -1,6 +1,6 @@
|
| -/* Clean exit of the thread group leader should not break GDB.
|
| +/* This testcase is part of GDB, the GNU debugger.
|
|
|
| - Copyright 2007, 2011-2012 Free Software Foundation, Inc.
|
| + Copyright 2012 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
|
| @@ -17,19 +17,22 @@
|
|
|
| #include <pthread.h>
|
| #include <assert.h>
|
| -#include <unistd.h>
|
|
|
| -static volatile pthread_t main_thread;
|
| +static volatile int a, b, c;
|
| +
|
| +static void
|
| +marker_exit (void)
|
| +{
|
| + a = 1;
|
| +}
|
|
|
| static void *
|
| start (void *arg)
|
| {
|
| - int i;
|
| + b = 2;
|
| + c = 3;
|
|
|
| - i = pthread_join (main_thread, NULL);
|
| - assert (i == 0);
|
| -
|
| - return arg; /* break-here */
|
| + return NULL;
|
| }
|
|
|
| int
|
| @@ -38,12 +41,11 @@ main (void)
|
| pthread_t thread;
|
| int i;
|
|
|
| - main_thread = pthread_self ();
|
| -
|
| i = pthread_create (&thread, NULL, start, NULL);
|
| assert (i == 0);
|
| + i = pthread_join (thread, NULL);
|
| + assert (i == 0);
|
|
|
| - pthread_exit (NULL);
|
| - /* NOTREACHED */
|
| + marker_exit ();
|
| return 0;
|
| }
|
|
|