* gdb.texinfo (SVR4 Process Information, The isatty call)
[deliverable/binutils-gdb.git] / gdb / dwarf2loc.c
index fc864701739d0188e0bfaab6320c89262ccea937..47c8101d763105be84b7fa8c7855c6cc2f5c3e88 100644 (file)
@@ -186,17 +186,28 @@ static CORE_ADDR
 dwarf_expr_tls_address (void *baton, CORE_ADDR offset)
 {
   struct dwarf_expr_baton *debaton = (struct dwarf_expr_baton *) baton;
-  CORE_ADDR addr;
+  volatile CORE_ADDR addr = 0;
 
-  if (target_get_thread_local_address_p ())
+  if (target_get_thread_local_address_p ()
+      && gdbarch_fetch_tls_load_module_address_p (current_gdbarch))
     {
       ptid_t ptid = inferior_ptid;
       struct objfile *objfile = debaton->objfile;
-      volatile struct exception ex;
+      volatile struct gdb_exception ex;
 
       TRY_CATCH (ex, RETURN_MASK_ALL)
        {
-         addr = target_get_thread_local_address (ptid, objfile, offset);
+         CORE_ADDR lm_addr;
+         
+         /* Fetch the load module address for this objfile.  */
+         lm_addr = gdbarch_fetch_tls_load_module_address (current_gdbarch,
+                                                          objfile);
+         /* If it's 0, throw the appropriate exception.  */
+         if (lm_addr == 0)
+           throw_error (TLS_LOAD_MODULE_NOT_FOUND_ERROR,
+                        _("TLS load module not found"));
+
+         addr = target_get_thread_local_address (ptid, lm_addr, offset);
        }
       /* If an error occurred, print TLS related messages here.  Otherwise,
          throw the error to some higher catcher.  */
This page took 0.024939 seconds and 4 git commands to generate.