]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/testsuite/gdb.threads/wp-replication.c
Simplify gdb.threads/wp-replication.exp on counting HW watchpoints
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.threads / wp-replication.c
index a7250b08a0cb5c4b6fae56c2765907b0619bbe5a..9fdc87abc99d79e82e805b4ea6eea060c13d9f9c 100644 (file)
@@ -47,11 +47,6 @@ int test_ready = 0;
    watchpoint triggers.  */
 int can_terminate = 0;
 
-/* Used to push the program out of the waiting loop after the
-   testcase is done counting the number of hardware watchpoints
-   available for our target.  */
-int watch_count_done = 0;
-
 /* Number of watchpoints GDB is capable of using (this is provided
    by GDB during the test run).  */
 int hw_watch_count = 0;
@@ -60,14 +55,6 @@ int hw_watch_count = 0;
 static int watched_data[NR_THREADS];
 pthread_mutex_t data_mutex;
 
-/* Wait function to keep threads busy while the testcase does
-   what it needs to do.  */
-void
-empty_cycle (void)
-{
-  usleep (1);
-}
-
 int
 main ()
 {
@@ -75,17 +62,6 @@ main ()
   pthread_t threads[NR_THREADS];
   int i;
 
-  /* Something to ensure that the breakpoint used to run to main
-     is only hit once.  */
-  empty_cycle ();
-
-  while (watch_count_done == 0)
-    {
-      /* GDB will modify the value of "watch_count_done" at runtime and we
-        will get past this point.  */
-      empty_cycle ();
-    }
-
   pthread_mutex_init (&data_mutex, NULL);
 
   for (i = 0; i < NR_THREADS; i++)