Include <signal.h>.
[deliverable/binutils-gdb.git] / gdb / linux-thread-db.c
index d91a894166d5cbc6bc84840d133e34c99e4f414b..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,7 +878,8 @@ 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)
@@ -1080,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.02425 seconds and 4 git commands to generate.