Don't emit symbols seen only in dynamic object, don't read duplicate
[deliverable/binutils-gdb.git] / gdb / linux-thread-db.c
index c49c89585b4f7ae7b2edc2bafca63822009c825e..fe75a8331f7faf9d20fadc41b33401ba1e4bdc06 100644 (file)
@@ -39,6 +39,8 @@
 #include "gdbcore.h"
 #include "linux-nat.h"
 
+#include <signal.h>
+
 #ifdef HAVE_GNU_LIBC_VERSION_H
 #include <gnu/libc-version.h>
 #endif
@@ -599,6 +601,10 @@ check_for_thread_db (void)
   if (!target_has_execution)
     return;
 
+  /* Don't attempt to use thread_db for remote targets.  */
+  if (!target_can_run (&current_target))
+    return;
+
   /* Initialize the structure that identifies the child process.  */
   proc_handle.pid = GET_PID (inferior_ptid);
 
@@ -872,9 +878,19 @@ thread_db_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
        post-processing and bail out early.  */
     return ptid;
 
-  if (ourstatus->kind == TARGET_WAITKIND_EXITED)
+  if (ourstatus->kind == TARGET_WAITKIND_EXITED
+    || ourstatus->kind == TARGET_WAITKIND_SIGNALLED)
     return pid_to_ptid (-1);
 
+  if (ourstatus->kind == TARGET_WAITKIND_EXECD)
+    {
+      remove_thread_event_breakpoints ();
+      unpush_target (&thread_db_ops);
+      using_thread_db = 0;
+
+      return pid_to_ptid (GET_PID (ptid));
+    }
+
   if (ourstatus->kind == TARGET_WAITKIND_STOPPED
       && ourstatus->value.sig == TARGET_SIGNAL_TRAP)
     /* Check for a thread event.  */
@@ -1071,7 +1087,8 @@ thread_db_get_thread_local_address (ptid_t ptid,
       thread_db_map_id2thr (thread_info, 1);
 
       /* Finally, get the address of the variable.  */
-      err = td_thr_tls_get_addr_p (&thread_info->private->th, (void *) lm,
+      err = td_thr_tls_get_addr_p (&thread_info->private->th,
+                                  (void *)(size_t) lm,
                                   offset, &address);
 
 #ifdef THREAD_DB_HAS_TD_NOTALLOC
This page took 0.034829 seconds and 4 git commands to generate.