patches/gdb/6.5/120-thread-timeout.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun May 03 09:50:16 2009 +0000 (2009-05-03)
branchnewlib
changeset 1366 5e5d1e6f55d3
parent 438 d75624a9268b
permissions -rw-r--r--
Update the newlib devel branch with stuff from /trunk@1498.

-------- diffstat follows --------
/devel/newlib/configure | 336 176 160 0 +++++++------
/devel/newlib/Makefile.in | 12 3 9 0 -
/devel/newlib/scripts/build/kernel/linux.sh | 2 1 1 0
/devel/newlib/scripts/build/internals.sh | 1 0 1 0 -
/devel/newlib/scripts/build/libc/eglibc.sh | 1 0 1 0 -
/devel/newlib/scripts/build/mpfr.sh | 2 1 1 0
/devel/newlib/scripts/functions | 111 5 106 0 ----
/devel/newlib/scripts/config.guess | 7 5 2 0 +
/devel/newlib/scripts/config.sub | 3 2 1 0 +
/devel/newlib/scripts/saveSample.sh.in | 4 2 2 0
/devel/newlib/docs/overview.txt | 8 6 2 0 +
/devel/newlib/samples/armeb-unknown-linux-uclibc/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/sh4-unknown-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/x86_64-unknown-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/arm-unknown-elf/crosstool.config | 12 3 9 0 -
/devel/newlib/samples/armeb-unknown-eabi/crosstool.config | 2 0 2 0 -
/devel/newlib/samples/arm-unknown-linux-gnueabi/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/ia64-unknown-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/x86_64-unknown-linux-uclibc/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/armeb-unknown-linux-gnueabi/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/powerpc-e500v2-linux-gnuspe/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/i686-nptl-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/arm-unknown-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/powerpc-unknown-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/mips-unknown-linux-uclibc/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/arm-unknown-linux-uclibcgnueabi/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/arm-iphone-linux-gnueabi/crosstool.config | 8 4 4 0
/devel/newlib/samples/armeb-unknown-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/powerpc-unknown_nofpu-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/i586-geode-linux-uclibc/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/arm-unknown-linux-uclibc/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/powerpc-unknown-linux-uclibc/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/mips-unknown-elf/crosstool.config | 2 0 2 0 -
/devel/newlib/samples/powerpc-405-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/armeb-unknown-linux-uclibcgnueabi/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/arm-unknown-eabi/crosstool.config | 12 3 9 0 -
/devel/newlib/samples/mipsel-unknown-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/powerpc64-unknown-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/alphaev56-unknown-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/powerpc-860-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/config/kernel/linux.in | 108 2 106 0 ----
/devel/newlib/config/global/ct-behave.in | 22 13 9 0 +
/devel/newlib/config/global/download.in | 210 15 195 0 +-------
/devel/newlib/config/libc/glibc.in | 7 7 0 0 +
/devel/newlib/config/libc/glibc-eglibc.in-common | 15 14 1 0 +
45 files changed, 382 insertions(+), 839 deletions(-)
yann@438
     1
--- gdb-6.5/./gdb/gdbserver/thread-db.c.orig	2006-03-15 08:13:29.000000000 -0800
yann@438
     2
+++ gdb-6.5/./gdb/gdbserver/thread-db.c	2008-04-01 21:21:23.000000000 -0700
yann@96
     3
@@ -21,6 +21,7 @@
yann@438
     4
    Foundation, Inc., 51 Franklin Street, Fifth Floor,
yann@438
     5
    Boston, MA 02110-1301, USA.  */
yann@96
     6
 
yann@96
     7
+#include <unistd.h>
yann@96
     8
 #include "server.h"
yann@96
     9
 
yann@96
    10
 #include "linux-low.h"
yann@438
    11
@@ -134,6 +135,7 @@ thread_db_create_event (CORE_ADDR where)
yann@96
    12
   td_event_msg_t msg;
yann@96
    13
   td_err_e err;
yann@96
    14
   struct inferior_linux_data *tdata;
yann@96
    15
+  int timeout;
yann@96
    16
 
yann@96
    17
   if (debug_threads)
yann@96
    18
     fprintf (stderr, "Thread creation event.\n");
yann@438
    19
@@ -144,7 +146,13 @@ thread_db_create_event (CORE_ADDR where)
yann@96
    20
      In the LinuxThreads implementation, this is safe,
yann@96
    21
      because all events come from the manager thread
yann@96
    22
      (except for its own creation, of course).  */
yann@96
    23
-  err = td_ta_event_getmsg (thread_agent, &msg);
yann@96
    24
+  for (timeout = 0; timeout < 50000; timeout++)
yann@96
    25
+    {
yann@96
    26
+      err = td_ta_event_getmsg (thread_agent, &msg);
yann@96
    27
+      if (err != TD_NOMSG)
yann@96
    28
+	break;
yann@96
    29
+      usleep(1000);
yann@96
    30
+    }
yann@96
    31
   if (err != TD_OK)
yann@96
    32
     fprintf (stderr, "thread getmsg err: %s\n",
yann@96
    33
 	     thread_db_err_str (err));