aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.mi/non-stop.c
diff options
context:
space:
mode:
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);