* gdb.threads/manythreads.c (thread_function, main): Don't cast
authorDaniel Jacobowitz <drow@false.org>
Tue, 17 Oct 2006 15:52:53 +0000 (15:52 +0000)
committerDaniel Jacobowitz <drow@false.org>
Tue, 17 Oct 2006 15:52:53 +0000 (15:52 +0000)
int to pointer or pointer to int.
* gdb.threads/manythreads.exp: Don't expect the string "LWP".

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.threads/manythreads.c
gdb/testsuite/gdb.threads/manythreads.exp

index 34fb073dfe1e35b119069da46810263b1dd08d94..440fde90fb99726d3efe41a59d310ade98847b46 100644 (file)
@@ -1,3 +1,9 @@
+2006-10-17  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * gdb.threads/manythreads.c (thread_function, main): Don't cast
+       int to pointer or pointer to int.
+       * gdb.threads/manythreads.exp: Don't expect the string "LWP".
+
 2006-10-12  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * gdb.base/annota1.exp, gdb.base/maint.exp: Use string_to_regexp.
index e39412cde8f97b25a2fefeefce19b74cb989c8c3..1c23567393b1255496acab95acc79a1f50257cd7 100644 (file)
@@ -1,5 +1,5 @@
 /* Manythreads test program.
-   Copyright 2004
+   Copyright 2004, 2006
    Free Software Foundation, Inc.
 
    Written by Jeff Johnston <jjohnstn@redhat.com> 
@@ -29,7 +29,7 @@
 void *
 thread_function (void *arg)
 {
-  int x = (int)arg;
+  int x = * (int *) arg;
 
   printf ("Thread <%d> executing\n", x);
 
@@ -41,6 +41,7 @@ main (int argc, char **argv)
 {
   pthread_attr_t attr;
   pthread_t threads[256];
+  int args[256];
   int i, j;
 
   pthread_attr_init (&attr);
@@ -52,8 +53,8 @@ main (int argc, char **argv)
     {
       for (j = 0; j < 256; ++j)
        {
-         pthread_create (&threads[j], &attr, thread_function, 
-                         (void *)(i * 1000 + j));
+         args[j] = i * 1000 + j;
+         pthread_create (&threads[j], &attr, thread_function, &args[j]);
        }
 
       for (j = 0; j < 256; ++j)
index a2baf846aa985bb19e07243baf29bfb1f54c2912..2a9721d471993567a6a06606dd69683b7884c61e 100644 (file)
@@ -1,5 +1,5 @@
 # manythreads.exp -- Expect script to test stopping many threads
-# Copyright (C) 2004 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2006 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
@@ -81,7 +81,7 @@ gdb_test_multiple "" "stop threads 1" {
   }
 }
 
-gdb_test "info threads" ".*1 Thread.*.LWP.*"
+gdb_test "info threads" ".*1 Thread .*"
 
 set message "second continue"
 gdb_test_multiple "continue" "second continue" {
This page took 0.066186 seconds and 4 git commands to generate.