patches/gdb/6.5/500-thread-timeout.patch
changeset 747 d3e603e7c17c
parent 746 b150d6f590fc
child 748 61cd4eb6034d
     1.1 --- a/patches/gdb/6.5/500-thread-timeout.patch	Mon Jul 28 21:08:01 2008 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,33 +0,0 @@
     1.4 ---- gdb-6.5/./gdb/gdbserver/thread-db.c.orig	2006-03-15 08:13:29.000000000 -0800
     1.5 -+++ gdb-6.5/./gdb/gdbserver/thread-db.c	2008-04-01 21:21:23.000000000 -0700
     1.6 -@@ -21,6 +21,7 @@
     1.7 -    Foundation, Inc., 51 Franklin Street, Fifth Floor,
     1.8 -    Boston, MA 02110-1301, USA.  */
     1.9 - 
    1.10 -+#include <unistd.h>
    1.11 - #include "server.h"
    1.12 - 
    1.13 - #include "linux-low.h"
    1.14 -@@ -134,6 +135,7 @@ thread_db_create_event (CORE_ADDR where)
    1.15 -   td_event_msg_t msg;
    1.16 -   td_err_e err;
    1.17 -   struct inferior_linux_data *tdata;
    1.18 -+  int timeout;
    1.19 - 
    1.20 -   if (debug_threads)
    1.21 -     fprintf (stderr, "Thread creation event.\n");
    1.22 -@@ -144,7 +146,13 @@ thread_db_create_event (CORE_ADDR where)
    1.23 -      In the LinuxThreads implementation, this is safe,
    1.24 -      because all events come from the manager thread
    1.25 -      (except for its own creation, of course).  */
    1.26 --  err = td_ta_event_getmsg (thread_agent, &msg);
    1.27 -+  for (timeout = 0; timeout < 50000; timeout++)
    1.28 -+    {
    1.29 -+      err = td_ta_event_getmsg (thread_agent, &msg);
    1.30 -+      if (err != TD_NOMSG)
    1.31 -+	break;
    1.32 -+      usleep(1000);
    1.33 -+    }
    1.34 -   if (err != TD_OK)
    1.35 -     fprintf (stderr, "thread getmsg err: %s\n",
    1.36 - 	     thread_db_err_str (err));