Hi! Does someone know how to work with threads in radare2?
For example I have the following little C program:
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
void *thread(void *nothing) {
while (1) {
printf("Hello\n");
sleep(1);
}
return NULL;
}
int main(void) {
pthread_t t;
pthread_create(&t, NULL, thread, NULL);
while (1) {
printf("World\n");
sleep(1);
}
return 0;
}
When I start it with radare2 -d a.out
and break behind the pthread_create()
call. I just get the output of the two threads:
Hello
World
Hello
World
But I was expecting to get a new radare2 prompt and having rip set to the position I breaked at. I cannot find any documentation about the topic. Does anyone know how to debug threads with radare2?