aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.mi/non-stop.c
diff options
context:
space:
mode:
authorVladimir Prus <vladimir@codesourcery.com>2008-08-21 15:09:42 +0000
committerVladimir Prus <vladimir@codesourcery.com>2008-08-21 15:09:42 +0000
commit80f73d716b037b1ad4f8e8582852887ba1016d1d (patch)
tree5db75e974091c565c62051e7e553e2436119ce51 /gdb/testsuite/gdb.mi/non-stop.c
parentaded6f54f0cb9d9b44d72d06af7b940cdeb1876b (diff)
downloadfsf-binutils-gdb-80f73d716b037b1ad4f8e8582852887ba1016d1d.zip
fsf-binutils-gdb-80f73d716b037b1ad4f8e8582852887ba1016d1d.tar.gz
fsf-binutils-gdb-80f73d716b037b1ad4f8e8582852887ba1016d1d.tar.bz2
* gdb.mi/mi-nonstop.exp: Fix the check for non-stop
support. Adjust the order of "*running" notifications. * gdb.mi/non-stop.c: Don't cast from int to void* and back.
Diffstat (limited to 'gdb/testsuite/gdb.mi/non-stop.c')
-rw-r--r--gdb/testsuite/gdb.mi/non-stop.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gdb/testsuite/gdb.mi/non-stop.c b/gdb/testsuite/gdb.mi/non-stop.c
index 9b006eb..83acc82 100644
--- a/gdb/testsuite/gdb.mi/non-stop.c
+++ b/gdb/testsuite/gdb.mi/non-stop.c
@@ -42,7 +42,7 @@ void break_at_me (int id, int i)
void *
worker (void *arg)
{
- int id = (int)arg;
+ int id = *(int *)arg;
int i = 0;
/* When gdb is running, it sets hidden breakpoints in the thread
@@ -66,8 +66,11 @@ pthread_t
create_thread (int id)
{
pthread_t tid;
+ /* This memory will be leaked, we don't care for a test. */
+ int *id2 = malloc (sizeof (int));
+ *id2 = id;
- if (pthread_create (&tid, PTHREAD_CREATE_NULL_ARG2, worker, (void *) id))
+ if (pthread_create (&tid, PTHREAD_CREATE_NULL_ARG2, worker, (void *) id2))
{
perror ("pthread_create 1");
exit (1);