aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2009-10-20 11:09:01 +0000
committerPedro Alves <palves@redhat.com>2009-10-20 11:09:01 +0000
commitc069425482903a72eadc818c9c3c685df6170238 (patch)
tree7a275c1bb27f5ec91032741c0e0e157255a0a9c4 /gdb/target.c
parentdbde1c12721304ec89ee0326187ecedebd9da4ed (diff)
downloadgdb-c069425482903a72eadc818c9c3c685df6170238.zip
gdb-c069425482903a72eadc818c9c3c685df6170238.tar.gz
gdb-c069425482903a72eadc818c9c3c685df6170238.tar.bz2
* linux-nat.c (linux_nat_thread_address_space): New.
(linux_nat_add_target): Install it. * progspace.c (address_space_num): New. * progspace.h (address_space_num): Declare. * target.c (target_thread_address_space): Really query the target. * target.h (struct target_ops) <to_thread_address_space>: New field.
Diffstat (limited to 'gdb/target.c')
-rw-r--r--gdb/target.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/gdb/target.c b/gdb/target.c
index ac1010b..2f5f556 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -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));