aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.threads
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2006-10-17 15:52:53 +0000
committerDaniel Jacobowitz <drow@false.org>2006-10-17 15:52:53 +0000
commit5bd2f6e2a6179014300f75f86231e0e37736eb6b (patch)
treef43a0331fa39ff11f53a9cdad0024f5a867c2837 /gdb/testsuite/gdb.threads
parente95de06338c51f03d29a7fe5d2f1c374054c9e44 (diff)
downloadgdb-5bd2f6e2a6179014300f75f86231e0e37736eb6b.zip
gdb-5bd2f6e2a6179014300f75f86231e0e37736eb6b.tar.gz
gdb-5bd2f6e2a6179014300f75f86231e0e37736eb6b.tar.bz2
* 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".
Diffstat (limited to 'gdb/testsuite/gdb.threads')
-rw-r--r--gdb/testsuite/gdb.threads/manythreads.c9
-rw-r--r--gdb/testsuite/gdb.threads/manythreads.exp4
2 files changed, 7 insertions, 6 deletions
diff --git a/gdb/testsuite/gdb.threads/manythreads.c b/gdb/testsuite/gdb.threads/manythreads.c
index e39412c..1c23567 100644
--- a/gdb/testsuite/gdb.threads/manythreads.c
+++ b/gdb/testsuite/gdb.threads/manythreads.c
@@ -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)
diff --git a/gdb/testsuite/gdb.threads/manythreads.exp b/gdb/testsuite/gdb.threads/manythreads.exp
index a2baf84..2a9721d 100644
--- a/gdb/testsuite/gdb.threads/manythreads.exp
+++ b/gdb/testsuite/gdb.threads/manythreads.exp
@@ -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" {