summaryrefslogtreecommitdiff
path: root/gdb/inf-ttrace.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2008-09-22 15:16:51 +0000
committerPedro Alves <palves@redhat.com>2008-09-22 15:16:51 +0000
commit7f9f62ba187205cd123fd2e96909e6d19ad708eb (patch)
tree1580fd0c5e8c56ec5a6c873101b33cc4f1962e14 /gdb/inf-ttrace.c
parentb77209e0003218790c76f67c5ee3e5802168ecaa (diff)
downloadbinutils-gdb-7f9f62ba187205cd123fd2e96909e6d19ad708eb.tar.gz
* gnu-nat.c (gnu_attach): Add process to inferiors table.
(gnu_detach): Remove it. * go32-nat.c (go32_create_inferior): Add process to gdb's inferior table. * inf-ptrace.c (inf_ptrace_follow_fork): Delete and add inferiors to inferior table accordingly. (inf_ptrace_attach): Add new process to inferior table. (inf_ptrace_detach): Remove it. * inf-ttrace.c (inf_ttrace_follow_fork): Delete and add inferiors to inferior table accordingly. (inf_ttrace_attach): Add process to inferior table. (inf_ttrace_detach): Remove it. * linux-fork.c (init_fork_list): Delete any left over inferior. (linux_fork_mourn_inferior, detach_fork_command): Also delete processes from inferior list. * monitor.c (monitor_open): Add process to inferior list. (monitor_close): Remove it. * nto-procfs.c (procfs_attach): Add process to inferior list. Find threads after pushing the target. (procfs_detach): Remove process from inferior list. (procfs_create_inferior): Add process to inferior list. * procfs.c (procfs_detach): Remove process from inferior list. (do_attach): Add process to inferior list. * remote-sim.c (sim_create_inferior): Add process to inferior list. (gdbsim_close): Remove it. * target.c (generic_mourn_inferior): If inferior_ptid is not null_ptid, remove the corresponding inferior from inferior list. * win32-nat.c (do_initial_win32_stuff): Add process to inferior list. (win32_detach): Remove it. * linux-nat.c (linux_child_follow_fork): Delete and add inferiors to inferior list accordingly. * fork-child.c (fork_inferior): Add process to inferior list. * corelow.c (CORELOW_PID): Define. (core_close): Remove core from inferior list. (core_open): Add it.
Diffstat (limited to 'gdb/inf-ttrace.c')
-rw-r--r--gdb/inf-ttrace.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gdb/inf-ttrace.c b/gdb/inf-ttrace.c
index 5521eab160a..b34e02e4607 100644
--- a/gdb/inf-ttrace.c
+++ b/gdb/inf-ttrace.c
@@ -468,6 +468,7 @@ inf_ttrace_follow_fork (struct target_ops *ops, int follow_child)
last_tp->step_resume_breakpoint = NULL;
inferior_ptid = ptid_build (fpid, flwpid, 0);
+ add_inferior (fpid);
detach_breakpoints (pid);
target_terminal_ours ();
@@ -537,8 +538,9 @@ Detaching after fork from child process %ld.\n"), (long)fpid);
/* Delete parent. */
delete_thread_silent (ptid_build (pid, lwpid, 0));
+ detach_inferior (pid);
- /* Add child. inferior_ptid was already set above. */
+ /* Add child thread. inferior_ptid was already set above. */
ti = add_thread_silent (inferior_ptid);
ti->private =
xmalloc (sizeof (struct inf_ttrace_private_thread_info));
@@ -742,6 +744,8 @@ inf_ttrace_attach (char *args, int from_tty)
perror_with_name (("ttrace"));
attach_flag = 1;
+ add_inferior (pid);
+
/* Set the initial event mask. */
memset (&tte, 0, sizeof (tte));
tte.tte_events |= TTEVT_EXEC | TTEVT_EXIT | TTEVT_FORK | TTEVT_VFORK;
@@ -796,8 +800,10 @@ inf_ttrace_detach (char *args, int from_tty)
inf_ttrace_num_lwps = 0;
inf_ttrace_num_lwps_in_syscall = 0;
- unpush_target (ttrace_ops_hack);
inferior_ptid = null_ptid;
+ detach_inferior (pid);
+
+ unpush_target (ttrace_ops_hack);
}
static void