gdb on Cygwin can not attach to a running process if the main thread has exited via a call to pthread_exit(). The attach just hangs.
Here is the test case: w/o GDB_HANG defined, all is well; with GDB_HANG defined, attaching is not possible. #include <pthread.h> #include <unistd.h> void * spinner(void *v) { for (;;) sleep(500); return NULL; } int main(void) { pthread_t tid; pthread_create(&tid, NULL, spinner, NULL); #ifdef GDB_HANG pthread_exit(NULL); #else for (;;) sleep(500); #endif return 0; } Thanks. -- Brian Ford Senior Realtime Software Engineer VITAL - Visual Simulation Systems FlightSafety International Phone: 314-551-8460 Fax: 314-551-8444 -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/