aboutsummaryrefslogtreecommitdiff
path: root/gdb/inf-ptrace.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/inf-ptrace.c')
-rw-r--r--gdb/inf-ptrace.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c
index 736154a..a138701 100644
--- a/gdb/inf-ptrace.c
+++ b/gdb/inf-ptrace.c
@@ -67,6 +67,8 @@ inf_ptrace_follow_fork (struct target_ops *ops, int follow_child)
child_inf = add_inferior (fpid);
child_inf->attach_flag = parent_inf->attach_flag;
copy_terminal_info (child_inf, parent_inf);
+ inf->pspace = parent_inf->pspace;
+ inf->pspace = parent_inf->aspace;
/* Before detaching from the parent, remove all breakpoints from
it. */
@@ -223,10 +225,10 @@ inf_ptrace_attach (struct target_ops *ops, char *args, int from_tty)
error (_("This system does not support attaching to a process"));
#endif
- inferior_ptid = pid_to_ptid (pid);
-
- inf = add_inferior (pid);
+ inf = current_inferior ();
+ inferior_appeared (inf, pid);
inf->attach_flag = 1;
+ inferior_ptid = pid_to_ptid (pid);
/* Always add a main thread. If some target extends the ptrace
target, it should decorate the ptid later with more info. */