mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-18 21:34:13 +08:00
2006-03-09 Michael Snyder <msnyder@redhat.com>
* linux-nat.c (kill_inferior): Just call target_mourn_inferior instead of getting tricky for the multi-fork case. * linux-fork.c (linux_fork_killall): Call PT_KILL and waitpid for each fork, and then use init_fork_list to delete them.
This commit is contained in:
@ -1,6 +1,9 @@
|
|||||||
2006-03-09 Joel Brobecker <brobecker@adacore.com>
|
2006-03-09 Michael Snyder <msnyder@redhat.com>
|
||||||
|
|
||||||
* MAINTAINERS (Patch Champions): Remove self.
|
* linux-nat.c (kill_inferior): Just call target_mourn_inferior
|
||||||
|
instead of getting tricky for the multi-fork case.
|
||||||
|
* linux-fork.c (linux_fork_killall): Call PT_KILL and waitpid
|
||||||
|
for each fork, and then use init_fork_list to delete them.
|
||||||
|
|
||||||
2006-03-08 Alexandre Oliva <aoliva@redhat.com>
|
2006-03-08 Alexandre Oliva <aoliva@redhat.com>
|
||||||
|
|
||||||
|
@ -72,8 +72,7 @@ add_fork (pid_t pid)
|
|||||||
{
|
{
|
||||||
struct fork_info *fp;
|
struct fork_info *fp;
|
||||||
|
|
||||||
if (fork_list == NULL &&
|
if (fork_list == NULL && pid != PIDGET (inferior_ptid))
|
||||||
pid != PIDGET (inferior_ptid))
|
|
||||||
{
|
{
|
||||||
/* Special case -- if this is the first fork in the list
|
/* Special case -- if this is the first fork in the list
|
||||||
(the list is hitherto empty), and if this new fork is
|
(the list is hitherto empty), and if this new fork is
|
||||||
@ -322,17 +321,22 @@ linux_fork_killall (void)
|
|||||||
status for it) -- however any process may be a child
|
status for it) -- however any process may be a child
|
||||||
or a parent, so may get a SIGCHLD from a previously
|
or a parent, so may get a SIGCHLD from a previously
|
||||||
killed child. Wait them all out. */
|
killed child. Wait them all out. */
|
||||||
|
struct fork_info *fp;
|
||||||
pid_t pid, ret;
|
pid_t pid, ret;
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
do {
|
for (fp = fork_list; fp; fp = fp->next)
|
||||||
pid = PIDGET (fork_list->ptid);
|
{
|
||||||
do {
|
pid = PIDGET (fp->ptid);
|
||||||
ptrace (PT_KILL, pid, 0, 0);
|
do {
|
||||||
ret = waitpid (pid, &status, 0);
|
ptrace (PT_KILL, pid, 0, 0);
|
||||||
} while (ret == pid && WIFSTOPPED (status));
|
ret = waitpid (pid, &status, 0);
|
||||||
delete_fork (fork_list->ptid);
|
/* We might get a SIGCHLD instead of an exit status. This is
|
||||||
} while (fork_list != NULL);
|
aggravated by the first kill above - a child has just
|
||||||
|
died. MVS comment cut-and-pasted from linux-nat. */
|
||||||
|
} while (ret == pid && WIFSTOPPED (status));
|
||||||
|
}
|
||||||
|
init_fork_list (); /* Clear list, prepare to start fresh. */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The current inferior_ptid has exited, but there are other viable
|
/* The current inferior_ptid has exited, but there are other viable
|
||||||
|
@ -616,8 +616,6 @@ kill_inferior (void)
|
|||||||
if (forks_exist_p ())
|
if (forks_exist_p ())
|
||||||
{
|
{
|
||||||
linux_fork_killall ();
|
linux_fork_killall ();
|
||||||
pop_target ();
|
|
||||||
generic_mourn_inferior ();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -646,8 +644,8 @@ kill_inferior (void)
|
|||||||
ptrace (PT_KILL, pid, 0, 0);
|
ptrace (PT_KILL, pid, 0, 0);
|
||||||
ret = wait (&status);
|
ret = wait (&status);
|
||||||
}
|
}
|
||||||
target_mourn_inferior ();
|
|
||||||
}
|
}
|
||||||
|
target_mourn_inferior ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* On GNU/Linux there are no real LWP's. The closest thing to LWP's
|
/* On GNU/Linux there are no real LWP's. The closest thing to LWP's
|
||||||
|
Reference in New Issue
Block a user