* Makefile.in (mips-tdep.o, target-descriptions.o): Update.
[deliverable/binutils-gdb.git] / gdb / gdbserver / thread-db.c
index b47f576d2e98f49b2e0aa0c04ad834468c9f5327..78bc6434076a0b6de675d2348d11a365736d6515 100644 (file)
@@ -266,6 +266,7 @@ found:
   process->lwpid = ti_p->ti_lid;
 
   process->thread_known = 1;
+  process->th = *th_p;
   err = td_thr_event_enable (th_p, 1);
   if (err != TD_OK)
     error ("Cannot enable thread event reporting for %d: %s",
@@ -319,6 +320,33 @@ thread_db_look_up_symbols (void)
     look_up_one_symbol (*sym_list, &unused);
 }
 
+int
+thread_db_get_tls_address (struct thread_info *thread, CORE_ADDR offset,
+                          CORE_ADDR load_module, CORE_ADDR *address)
+{
+#if HAVE_TD_THR_TLS_GET_ADDR
+  psaddr_t addr;
+  td_err_e err;
+  struct process_info *process;
+
+  process = get_thread_process (thread);
+  if (!process->thread_known)
+    return TD_NOTHR;
+
+  err = td_thr_tls_get_addr (&process->th, (psaddr_t) load_module, offset,
+                            &addr);
+  if (err == TD_OK)
+    {
+      *address = (CORE_ADDR) addr;
+      return 0;
+    }
+  else
+    return err;
+#else
+  return -1;
+#endif
+}
+
 int
 thread_db_init ()
 {
@@ -336,6 +364,9 @@ thread_db_init ()
      process in the list is the thread group leader.  */
   proc_handle.pid = ((struct inferior_list_entry *)current_inferior)->id;
 
+  /* Allow new symbol lookups.  */
+  all_symbols_looked_up = 0;
+
   err = td_ta_new (&proc_handle, &thread_agent);
   switch (err)
     {
@@ -350,6 +381,7 @@ thread_db_init ()
        return 0;
       thread_db_find_new_threads ();
       thread_db_look_up_symbols ();
+      all_symbols_looked_up = 1;
       return 1;
 
     default:
This page took 0.02511 seconds and 4 git commands to generate.