summaryrefslogtreecommitdiff
path: root/gdb/linux-fork.c
diff options
context:
space:
mode:
authorPedro Alves <pedro@codesourcery.com>2008-09-22 15:16:51 +0000
committerPedro Alves <pedro@codesourcery.com>2008-09-22 15:16:51 +0000
commit9034ac5e53533df531088c9ef0a9f33ba08d214c (patch)
tree2d3347f5ccb875d84a816a38f5aa637a27a9c21d /gdb/linux-fork.c
parent699fd3029bf1748f8d4c3e92e0cf2262f5a628c2 (diff)
downloadgdb-9034ac5e53533df531088c9ef0a9f33ba08d214c.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/linux-fork.c')
-rw-r--r--gdb/linux-fork.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c
index 443b63de9fb..f80fe5fa0a8 100644
--- a/gdb/linux-fork.c
+++ b/gdb/linux-fork.c
@@ -210,6 +210,7 @@ init_fork_list (void)
for (fp = fork_list; fp; fp = fpnext)
{
fpnext = fp->next;
+ delete_inferior (ptid_get_pid (fp->ptid));
free_fork (fp);
}
@@ -369,6 +370,8 @@ linux_fork_mourn_inferior (void)
We need to delete that one from the fork_list, and switch
to the next available fork. */
delete_fork (inferior_ptid);
+ /* Delete process from GDB's inferior list. */
+ delete_inferior (ptid_get_pid (inferior_ptid));
/* There should still be a fork - if there's only one left,
delete_fork won't remove it, because we haven't updated
@@ -408,6 +411,8 @@ delete_fork_command (char *args, int from_tty)
printf_filtered (_("Killed %s\n"), target_pid_to_str (ptid));
delete_fork (ptid);
+ /* Delete process from GDB's inferior list. */
+ delete_inferior (ptid_get_pid (ptid));
}
static void
@@ -432,6 +437,8 @@ detach_fork_command (char *args, int from_tty)
printf_filtered (_("Detached %s\n"), target_pid_to_str (ptid));
delete_fork (ptid);
+ /* Delete process from GDB's process table. */
+ detach_inferior (ptid_get_pid (ptid));
}
/* Print information about currently known forks. */