2002-11-02 Andrew Cagney <cagney@redhat.com>
[deliverable/binutils-gdb.git] / gdb / thread-db.c
index 924464394ebc7438cc3bdb703003be32191deff5..34b5c558b4c1b485713db23dec1e0971d891a0cc 100644 (file)
@@ -37,7 +37,8 @@
 #define LIBTHREAD_DB_SO "libthread_db.so.1"
 #endif
 
-/* If we're running on Linux, we must explicitly attach to any new threads.  */
+/* If we're running on GNU/Linux, we must explicitly attach to any new
+   threads.  */
 
 /* FIXME: There is certainly some room for improvements:
    - Cache LWP ids.
@@ -238,7 +239,7 @@ thread_from_lwp (ptid_t ptid)
 
   err = td_ta_map_lwp2thr_p (thread_agent, GET_LWP (ptid), &th);
   if (err != TD_OK)
-    error ("Cannot find user-level thread for LWP %d: %s",
+    error ("Cannot find user-level thread for LWP %ld: %s",
           GET_LWP (ptid), thread_db_err_str (err));
 
   err = td_thr_get_info_p (&th, &ti);
@@ -482,7 +483,9 @@ thread_db_new_objfile (struct objfile *objfile)
 {
   td_err_e err;
 
-  if (objfile == NULL)
+  /* Don't attempt to use thread_db on targets which can not run
+     (core files).  */
+  if (objfile == NULL || !target_has_execution)
     {
       /* All symbols have been discarded.  If the thread_db target is
          active, deactivate it now.  */
@@ -574,7 +577,7 @@ attach_thread (ptid_t ptid, const td_thrhandle_t *th_p,
   if (ti_p->ti_state == TD_THR_UNKNOWN || ti_p->ti_state == TD_THR_ZOMBIE)
     return;                    /* A zombie thread -- do not attach.  */
 
-  /* Under Linux, we have to attach to each and every thread.  */
+  /* Under GNU/Linux, we have to attach to each and every thread.  */
 #ifdef ATTACH_LWP
   ATTACH_LWP (BUILD_LWP (ti_p->ti_lid, GET_PID (ptid)), 0);
 #endif
@@ -826,7 +829,7 @@ thread_db_store_registers (int regno)
     {
       char raw[MAX_REGISTER_RAW_SIZE];
 
-      read_register_gen (regno, raw);
+      deprecated_read_register_gen (regno, raw);
       thread_db_fetch_registers (-1);
       supply_register (regno, raw);
     }
This page took 0.029063 seconds and 4 git commands to generate.