mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-29 08:24:05 +08:00
* linux-low.c (STACK_SIZE): Define.
(linux_tracefork_child): Use it. Use __clone2 on ia64. (linux_test_for_tracefork): Likewise.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2007-12-20 Andreas Schwab <schwab@suse.de>
|
||||||
|
|
||||||
|
* linux-low.c (STACK_SIZE): Define.
|
||||||
|
(linux_tracefork_child): Use it. Use __clone2 on ia64.
|
||||||
|
(linux_test_for_tracefork): Likewise.
|
||||||
|
|
||||||
2007-12-18 Daniel Jacobowitz <dan@codesourcery.com>
|
2007-12-18 Daniel Jacobowitz <dan@codesourcery.com>
|
||||||
|
|
||||||
* linux-low.c (linux_wait_for_event): Update messages. Do not
|
* linux-low.c (linux_wait_for_event): Update messages. Do not
|
||||||
|
@ -1743,12 +1743,20 @@ linux_tracefork_grandchild (void *arg)
|
|||||||
_exit (0);
|
_exit (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define STACK_SIZE 4096
|
||||||
|
|
||||||
static int
|
static int
|
||||||
linux_tracefork_child (void *arg)
|
linux_tracefork_child (void *arg)
|
||||||
{
|
{
|
||||||
ptrace (PTRACE_TRACEME, 0, 0, 0);
|
ptrace (PTRACE_TRACEME, 0, 0, 0);
|
||||||
kill (getpid (), SIGSTOP);
|
kill (getpid (), SIGSTOP);
|
||||||
clone (linux_tracefork_grandchild, arg, CLONE_VM | SIGCHLD, NULL);
|
#ifdef __ia64__
|
||||||
|
__clone2 (linux_tracefork_grandchild, arg, STACK_SIZE,
|
||||||
|
CLONE_VM | SIGCHLD, NULL);
|
||||||
|
#else
|
||||||
|
clone (linux_tracefork_grandchild, arg + STACK_SIZE,
|
||||||
|
CLONE_VM | SIGCHLD, NULL);
|
||||||
|
#endif
|
||||||
_exit (0);
|
_exit (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1776,13 +1784,18 @@ linux_test_for_tracefork (void)
|
|||||||
{
|
{
|
||||||
int child_pid, ret, status;
|
int child_pid, ret, status;
|
||||||
long second_pid;
|
long second_pid;
|
||||||
char *stack = malloc (8192);
|
char *stack = malloc (STACK_SIZE * 4);
|
||||||
|
|
||||||
linux_supports_tracefork_flag = 0;
|
linux_supports_tracefork_flag = 0;
|
||||||
|
|
||||||
/* Use CLONE_VM instead of fork, to support uClinux (no MMU). */
|
/* Use CLONE_VM instead of fork, to support uClinux (no MMU). */
|
||||||
child_pid = clone (linux_tracefork_child, stack + 2048,
|
#ifdef __ia64__
|
||||||
CLONE_VM | SIGCHLD, stack + 6144);
|
child_pid = __clone2 (linux_tracefork_child, stack, STACK_SIZE,
|
||||||
|
CLONE_VM | SIGCHLD, stack + STACK_SIZE * 2);
|
||||||
|
#else
|
||||||
|
child_pid = clone (linux_tracefork_child, stack + STACK_SIZE,
|
||||||
|
CLONE_VM | SIGCHLD, stack + STACK_SIZE * 2);
|
||||||
|
#endif
|
||||||
if (child_pid == -1)
|
if (child_pid == -1)
|
||||||
perror_with_name ("clone");
|
perror_with_name ("clone");
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user