gdb/
PR libc/11214: * linux-low.c (linux_tracefork_child) [!(__UCLIBC__ && HAS_NOMMU)]: New. (linux_test_for_tracefork): Move `stack' into [__UCLIBC__ && HAS_NOMMU]. (linux_test_for_tracefork) [!(__UCLIBC__ && HAS_NOMMU)]: New. gdb/testsuite/ PR libc/11214: * gdb.threads/current-lwp-dead.c: Include features.h. (HAS_NOMMU): New. (fn, main): Move CLONE_VM into [__UCLIBC__ && HAS_NOMMU].
This commit is contained in:
parent
7618e12bcb
commit
e4b7f41c57
|
@ -1,7 +1,14 @@
|
||||||
|
2010-02-01 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
|
PR libc/11214:
|
||||||
|
* linux-low.c (linux_tracefork_child) [!(__UCLIBC__ && HAS_NOMMU)]: New.
|
||||||
|
(linux_test_for_tracefork): Move `stack' into [__UCLIBC__ && HAS_NOMMU].
|
||||||
|
(linux_test_for_tracefork) [!(__UCLIBC__ && HAS_NOMMU)]: New.
|
||||||
|
|
||||||
2010-02-01 Michael Matz <matz@suse.de>
|
2010-02-01 Michael Matz <matz@suse.de>
|
||||||
Daniel Jacobowitz <dan@codesourcery.com>
|
Daniel Jacobowitz <dan@codesourcery.com>
|
||||||
|
|
||||||
* i386-tdep.c (i386_frame_cache): Assume valid anonymous
|
* i386-tdep.c (i386_frame_cache): Assume valid anonymous
|
||||||
functions use a frame pointer.
|
functions use a frame pointer.
|
||||||
|
|
||||||
2010-02-01 Jan Kratochvil <jan.kratochvil@redhat.com>
|
2010-02-01 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
|
@ -2597,6 +2597,14 @@ linux_tracefork_child (void *arg)
|
||||||
{
|
{
|
||||||
ptrace (PTRACE_TRACEME, 0, 0, 0);
|
ptrace (PTRACE_TRACEME, 0, 0, 0);
|
||||||
kill (getpid (), SIGSTOP);
|
kill (getpid (), SIGSTOP);
|
||||||
|
|
||||||
|
#if !(defined(__UCLIBC__) && defined(HAS_NOMMU))
|
||||||
|
|
||||||
|
if (fork () == 0)
|
||||||
|
linux_tracefork_grandchild (NULL);
|
||||||
|
|
||||||
|
#else /* defined(__UCLIBC__) && defined(HAS_NOMMU) */
|
||||||
|
|
||||||
#ifdef __ia64__
|
#ifdef __ia64__
|
||||||
__clone2 (linux_tracefork_grandchild, arg, STACK_SIZE,
|
__clone2 (linux_tracefork_grandchild, arg, STACK_SIZE,
|
||||||
CLONE_VM | SIGCHLD, NULL);
|
CLONE_VM | SIGCHLD, NULL);
|
||||||
|
@ -2604,6 +2612,9 @@ linux_tracefork_child (void *arg)
|
||||||
clone (linux_tracefork_grandchild, arg + STACK_SIZE,
|
clone (linux_tracefork_grandchild, arg + STACK_SIZE,
|
||||||
CLONE_VM | SIGCHLD, NULL);
|
CLONE_VM | SIGCHLD, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif /* defined(__UCLIBC__) && defined(HAS_NOMMU) */
|
||||||
|
|
||||||
_exit (0);
|
_exit (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2616,18 +2627,31 @@ linux_test_for_tracefork (void)
|
||||||
{
|
{
|
||||||
int child_pid, ret, status;
|
int child_pid, ret, status;
|
||||||
long second_pid;
|
long second_pid;
|
||||||
|
#if defined(__UCLIBC__) && defined(HAS_NOMMU)
|
||||||
char *stack = xmalloc (STACK_SIZE * 4);
|
char *stack = xmalloc (STACK_SIZE * 4);
|
||||||
|
#endif /* defined(__UCLIBC__) && defined(HAS_NOMMU) */
|
||||||
|
|
||||||
linux_supports_tracefork_flag = 0;
|
linux_supports_tracefork_flag = 0;
|
||||||
|
|
||||||
|
#if !(defined(__UCLIBC__) && defined(HAS_NOMMU))
|
||||||
|
|
||||||
|
child_pid = fork ();
|
||||||
|
if (child_pid == 0)
|
||||||
|
linux_tracefork_child (NULL);
|
||||||
|
|
||||||
|
#else /* defined(__UCLIBC__) && defined(HAS_NOMMU) */
|
||||||
|
|
||||||
/* Use CLONE_VM instead of fork, to support uClinux (no MMU). */
|
/* Use CLONE_VM instead of fork, to support uClinux (no MMU). */
|
||||||
#ifdef __ia64__
|
#ifdef __ia64__
|
||||||
child_pid = __clone2 (linux_tracefork_child, stack, STACK_SIZE,
|
child_pid = __clone2 (linux_tracefork_child, stack, STACK_SIZE,
|
||||||
CLONE_VM | SIGCHLD, stack + STACK_SIZE * 2);
|
CLONE_VM | SIGCHLD, stack + STACK_SIZE * 2);
|
||||||
#else
|
#else /* !__ia64__ */
|
||||||
child_pid = clone (linux_tracefork_child, stack + STACK_SIZE,
|
child_pid = clone (linux_tracefork_child, stack + STACK_SIZE,
|
||||||
CLONE_VM | SIGCHLD, stack + STACK_SIZE * 2);
|
CLONE_VM | SIGCHLD, stack + STACK_SIZE * 2);
|
||||||
#endif
|
#endif /* !__ia64__ */
|
||||||
|
|
||||||
|
#endif /* defined(__UCLIBC__) && defined(HAS_NOMMU) */
|
||||||
|
|
||||||
if (child_pid == -1)
|
if (child_pid == -1)
|
||||||
perror_with_name ("clone");
|
perror_with_name ("clone");
|
||||||
|
|
||||||
|
@ -2696,7 +2720,9 @@ linux_test_for_tracefork (void)
|
||||||
}
|
}
|
||||||
while (WIFSTOPPED (status));
|
while (WIFSTOPPED (status));
|
||||||
|
|
||||||
|
#if defined(__UCLIBC__) && defined(HAS_NOMMU)
|
||||||
free (stack);
|
free (stack);
|
||||||
|
#endif /* defined(__UCLIBC__) && defined(HAS_NOMMU) */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,10 @@
|
||||||
|
2010-02-01 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
|
PR libc/11214:
|
||||||
|
* gdb.threads/current-lwp-dead.c: Include features.h.
|
||||||
|
(HAS_NOMMU): New.
|
||||||
|
(fn, main): Move CLONE_VM into [__UCLIBC__ && HAS_NOMMU].
|
||||||
|
|
||||||
2010-02-01 Jan Kratochvil <jan.kratochvil@redhat.com>
|
2010-02-01 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
* gdb.base/symbol-without-target_section.exp,
|
* gdb.base/symbol-without-target_section.exp,
|
||||||
|
|
|
@ -30,6 +30,13 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include <features.h>
|
||||||
|
#ifdef __UCLIBC__
|
||||||
|
#if !(defined(__UCLIBC_HAS_MMU__) || defined(__ARCH_HAS_MMU__))
|
||||||
|
#define HAS_NOMMU
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#define STACK_SIZE 0x1000
|
#define STACK_SIZE 0x1000
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -51,8 +58,11 @@ fn (void *unused)
|
||||||
stack = malloc (STACK_SIZE);
|
stack = malloc (STACK_SIZE);
|
||||||
assert (stack != NULL);
|
assert (stack != NULL);
|
||||||
|
|
||||||
new_pid = clone (fn_return, stack + STACK_SIZE, CLONE_FILES | CLONE_VM, NULL,
|
new_pid = clone (fn_return, stack + STACK_SIZE, CLONE_FILES
|
||||||
NULL, NULL, NULL);
|
#if defined(__UCLIBC__) && defined(HAS_NOMMU)
|
||||||
|
| CLONE_VM
|
||||||
|
#endif /* defined(__UCLIBC__) && defined(HAS_NOMMU) */
|
||||||
|
, NULL, NULL, NULL, NULL);
|
||||||
assert (new_pid > 0);
|
assert (new_pid > 0);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -67,8 +77,11 @@ main (int argc, char **argv)
|
||||||
stack = malloc (STACK_SIZE);
|
stack = malloc (STACK_SIZE);
|
||||||
assert (stack != NULL);
|
assert (stack != NULL);
|
||||||
|
|
||||||
new_pid = clone (fn, stack + STACK_SIZE, CLONE_FILES | CLONE_VM, NULL, NULL,
|
new_pid = clone (fn, stack + STACK_SIZE, CLONE_FILES
|
||||||
NULL, NULL);
|
#if defined(__UCLIBC__) && defined(HAS_NOMMU)
|
||||||
|
| CLONE_VM
|
||||||
|
#endif /* defined(__UCLIBC__) && defined(HAS_NOMMU) */
|
||||||
|
, NULL, NULL, NULL, NULL);
|
||||||
assert (new_pid > 0);
|
assert (new_pid > 0);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue