* linux-nat.c (linux_nat_thread_address_space): New.
[deliverable/binutils-gdb.git] / gdb / target.c
index ac1010b2d0f7ec245c274aaae02753cf4c41e4a3..2f5f55681a465ed0a6f6192f0d41bc4d0a8d55ae 100644 (file)
@@ -2555,10 +2555,25 @@ target_get_osdata (const char *type)
 struct address_space *
 target_thread_address_space (ptid_t ptid)
 {
+  struct address_space *aspace;
   struct inferior *inf;
+  struct target_ops *t;
+
+  for (t = current_target.beneath; t != NULL; t = t->beneath)
+    {
+      if (t->to_thread_address_space != NULL)
+       {
+         aspace = t->to_thread_address_space (t, ptid);
+         gdb_assert (aspace);
 
-  /* For now, assume frame chains and inferiors only see one address
-     space.  */
+         if (targetdebug)
+           fprintf_unfiltered (gdb_stdlog,
+                               "target_thread_address_space (%s) = %d\n",
+                               target_pid_to_str (ptid),
+                               address_space_num (aspace));
+         return aspace;
+       }
+    }
 
   /* Fall-back to the "main" address space of the inferior.  */
   inf = find_inferior_pid (ptid_get_pid (ptid));
This page took 0.025341 seconds and 4 git commands to generate.