753f5e6
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=182116
753f5e6
753f5e6
753f5e6
Index: gdb-6.5/gdb/linux-thread-db.c
753f5e6
===================================================================
753f5e6
--- gdb-6.5.orig/gdb/linux-thread-db.c	2006-08-24 02:55:24.000000000 -0300
753f5e6
+++ gdb-6.5/gdb/linux-thread-db.c	2006-08-24 02:56:16.000000000 -0300
753f5e6
@@ -939,6 +939,15 @@ thread_db_wait (ptid_t ptid, struct targ
753f5e6
       || ourstatus->kind == TARGET_WAITKIND_SIGNALLED)
753f5e6
     return pid_to_ptid (-1);
753f5e6
 
753f5e6
+  if (ourstatus->kind == TARGET_WAITKIND_EXECD)
753f5e6
+    {
753f5e6
+      remove_thread_event_breakpoints ();
753f5e6
+      unpush_target (&thread_db_ops);
753f5e6
+      using_thread_db = 0;
753f5e6
+
753f5e6
+      return pid_to_ptid (GET_PID (ptid));
753f5e6
+    }
753f5e6
+
753f5e6
   if (ourstatus->kind == TARGET_WAITKIND_STOPPED
753f5e6
       && (ourstatus->value.sig == TARGET_SIGNAL_TRAP
753f5e6
           || ourstatus->value.sig == TARGET_SIGNAL_ILL))