Roland McGrath [Mon, 20 Jan 2003 09:04:33 +0000 (09:04 +0000)]
2003-01-20 Roland McGrath <roland@redhat.com>
* process.c [LINUX] (sys_clone) [S390 || S390X]: Argument order is
reversed from other architectures.
* process.c (sys_execve) [LINUX]: Make setting TCB_WAITEXECVE flag
conditional on [TCB_WAITEXECVE] instead of list of processors.
Roland McGrath [Tue, 14 Jan 2003 09:59:00 +0000 (09:59 +0000)]
2003-01-14 Roland McGrath <roland@redhat.com>
* configure.ac: Match powerpc* (includes powerpc64), and don't match
ppc (never comes out of config.sub).
* process.c (sys_ptrace): Use #lx format for address argument.
[POWERPC]: Use sizeof(unsigned long) in place of 4 for multipliers.
* process.c [POWERPC]: Likewise.
* signal.c (sys_sigreturn) [POWERPC]: Likewise.
* syscall.c (get_scno) [POWERPC]: Likewise.
* util.c [POWERPC]: Likewise.
(printnum): Use long for NUM.
From Anton Blanchard <anton@samba.org>.
Roland McGrath [Tue, 14 Jan 2003 09:46:23 +0000 (09:46 +0000)]
2003-01-14 Roland McGrath <roland@redhat.com>
* defs.h [_LARGEFILE64_SOURCE] (_LFS64_LARGEFILE): Define it.
* linux/syscallent.h: Use sys_getdents64, sys_truncate64,
sys_ftruncate64, instead of printargs, for those syscalls.
Roland McGrath [Tue, 14 Jan 2003 09:46:21 +0000 (09:46 +0000)]
2003-01-14 Roland McGrath <roland@redhat.com>
* process.c: Use <linux/ptrace.h> regardless of <sys/reg.h>.
(sys_ptrace): Use printxval.
(ptrace_cmds): Make PTRACE_GETREGS et al conditional on #ifdef PTRACE_*
instead of only #ifdef SUNOS4. Add PTRACE_[GS]ETFPXREGS.
Roland McGrath [Tue, 14 Jan 2003 09:46:18 +0000 (09:46 +0000)]
2003-01-14 Roland McGrath <roland@redhat.com>
* defs.h (ALIGN64): Fix defn for PPC, same as FreeBSD one.
* defs.h [_LARGEFILE64_SOURCE] (_LFS64_LARGEFILE): Define it.
* linux/syscallent.h: Use sys_getdents64, sys_truncate64,
sys_ftruncate64, instead of printargs, for those syscalls.
Roland McGrath [Tue, 14 Jan 2003 09:46:15 +0000 (09:46 +0000)]
2003-01-14 Roland McGrath <roland@redhat.com>
* util.c [LINUX] (restore_arg0, restore_arg1): New macros, defined
appropriately via set_arg0 or no-ops for each architecture.
(clearbpt): Use those instead of set_arg0 and set_arg1.
Roland McGrath [Tue, 14 Jan 2003 07:53:37 +0000 (07:53 +0000)]
2003-01-13 Roland McGrath <roland@redhat.com>
* linux/powerpc/syscallent.h: Add missing system calls.
Decode more system calls, we were just printargs for many things.
Remove some x86-specific system calls.
Remove two syscalls between the socket and ipc syscalls,
it was resulting in all IPC syscalls being off by two.
Roland McGrath [Fri, 10 Jan 2003 10:44:57 +0000 (10:44 +0000)]
2003-01-10 Roland McGrath <roland@redhat.com>
* strace.spec: New file.
* debian/changelog: 4.4.90-1
* debian/rules (binary-arch): Depend on build.
(clean): Don't try to run Makefile.in.
* debian/control (Standards-Version): Now 3.5.8.
Roland McGrath [Thu, 9 Jan 2003 06:53:34 +0000 (06:53 +0000)]
2003-01-08 Roland McGrath <roland@redhat.com>
Revamp -f support for Linux.
* util.c [LINUX] (setbpt, clearbpt): New implementations that tweak
the system call to be clone with CLONE_PTRACE set. Various new static
helper functions.
* process.c (internal_clone): Define also #ifdef SYS_clone2.
Initialize TCPCHILD->parent field.
[CLONE_PTRACE]: Don't do PTRACE_ATTACH here, because it's preattached.
Check in case the new child is in the tcb already.
(internal_fork) [LINUX]: Just call internal_clone.
* strace.c (trace) [LINUX]: Under -f/-F, grok an unknown pid
reporting to wait, put it in the TCB with TCB_ATTACHED|TCB_SUSPENDED.
Roland McGrath [Thu, 9 Jan 2003 06:53:31 +0000 (06:53 +0000)]
2003-01-08 Roland McGrath <roland@redhat.com>
Support for new Linux 2.5 thread features.
* defs.h [LINUX]: Define __NR_exit_group if not defined.
(struct tcb): New members nclone_threads, nclone_detached,
and nclone_waiting.
(TCB_CLONE_DETACHED, TCB_CLONE_THREAD, TCB_GROUP_EXITING): New macros.
(waiting_parent): Macro removed.
(pid2tcb): Declare it.
* process.c (internal_clone) [TCB_CLONE_THREAD]: Reparent the new
child to our parent if we are a CLONE_THREAD child ourselves.
Maintain TCB_CLONE_THREAD and TCB_CLONE_DETACHED flags and counts.
(internal_wait) [TCB_CLONE_THREAD]: Factor out detached children when
determining if we have any. If TCB_CLONE_THREAD is set, check
parent's children instead of our own, and bump nclone_waiting count.
(internal_exit) [__NR_exit_group]: Set the TCB_GROUP_EXITING flag if
the syscall was exit_group.
* syscall.c (internal_syscall): Use internal_exit for exit_group.
* strace.c (pid2tcb): No longer static.
(alloctcb) [TCB_CLONE_THREAD]: Initialize new fields.
(droptcb) [TCB_CLONE_THREAD]: Maintain new fields.
If we have thread children, set TCB_EXITING and don't clear the TCB.
(resume) [TCB_CLONE_THREAD]: Decrement parent's nclone_waiting.
(detach) [TCB_CLONE_THREAD]: When calling resume, check all thread
children of our parent that might be waiting for us too.
[TCB_GROUP_EXITING] (handle_group_exit): New function.
(trace) [TCB_GROUP_EXITING]: Use that in place of detach or droptcb.
Revamp -f support for Linux.
* util.c [LINUX] (setbpt, clearbpt): New implementations that tweak
the system call to be clone with CLONE_PTRACE set. Various new static
helper functions.
* process.c (internal_clone): Define also #ifdef SYS_clone2.
Initialize TCPCHILD->parent field.
[CLONE_PTRACE]: Don't do PTRACE_ATTACH here, because it's preattached.
Check in case the new child is in the tcb already.
(internal_fork) [LINUX]: Just call internal_clone.
* strace.c (trace) [LINUX]: Under -f/-F, grok an unknown pid
reporting to wait, put it in the TCB with TCB_ATTACHED|TCB_SUSPENDED.
Roland McGrath [Thu, 9 Jan 2003 06:53:27 +0000 (06:53 +0000)]
2003-01-08 Roland McGrath <roland@redhat.com>
Support for new Linux 2.5 thread features.
* defs.h [LINUX]: Define __NR_exit_group if not defined.
(struct tcb): New members nclone_threads, nclone_detached,
and nclone_waiting.
(TCB_CLONE_DETACHED, TCB_CLONE_THREAD, TCB_GROUP_EXITING): New macros.
(waiting_parent): Macro removed.
(pid2tcb): Declare it.
* process.c (internal_clone) [TCB_CLONE_THREAD]: Reparent the new
child to our parent if we are a CLONE_THREAD child ourselves.
Maintain TCB_CLONE_THREAD and TCB_CLONE_DETACHED flags and counts.
(internal_wait) [TCB_CLONE_THREAD]: Factor out detached children when
determining if we have any. If TCB_CLONE_THREAD is set, check
parent's children instead of our own, and bump nclone_waiting count.
(internal_exit) [__NR_exit_group]: Set the TCB_GROUP_EXITING flag if
the syscall was exit_group.
* syscall.c (internal_syscall): Use internal_exit for exit_group.
* strace.c (pid2tcb): No longer static.
(alloctcb) [TCB_CLONE_THREAD]: Initialize new fields.
(droptcb) [TCB_CLONE_THREAD]: Maintain new fields.
If we have thread children, set TCB_EXITING and don't clear the TCB.
(resume) [TCB_CLONE_THREAD]: Decrement parent's nclone_waiting.
(detach) [TCB_CLONE_THREAD]: When calling resume, check all thread
children of our parent that might be waiting for us too.
[TCB_GROUP_EXITING] (handle_group_exit): New function.
(trace) [TCB_GROUP_EXITING]: Use that in place of detach or droptcb.
Roland McGrath [Mon, 30 Dec 2002 10:23:00 +0000 (10:23 +0000)]
2002-12-30 Roland McGrath <roland@redhat.com>
* syscall.c (qualify_one): New function.
(qual_options): Replace lookup field with qualify, update initializer.
(qualify): Update caller.
(qual_signal, qual_fault, qual_desc): Rewritten from lookup_*.
(qual_syscall): Rewritten lookup_syscall, match name more than once.
Fixes RH#70579, bites IA64 -efoo when foo exists on IA32.
Roland McGrath [Mon, 30 Dec 2002 00:51:23 +0000 (00:51 +0000)]
2002-12-26 Roland McGrath <roland@redhat.com>
* linux/Makefile.am: New file.
* linux/Makefile.in: File removed.
* freebsd/Makefile.am: New file.
* freebsd/i386/Makefile.am: New file.
* freebsd/i386/Makefile.in: File removed.
2002-12-22 Roland McGrath <roland@redhat.com>
* linux/Makefile.in (ioctldefs.h ioctls.h): Use $(SHELL) instead of
sh, and use $(srcdir) to find the script.
* linux/powerpc/Makefile.in (ioctlent.raw): Find ioctlent.sh in ../.
(ioctlsort.o): Use ../ioctlsort.c, not ../../ioctlsort.c.
* linux/x86_64/Makefile.in (headers): Renamed to all.
* linux/alpha/Makefile.in: Add empty install target.
* linux/x86_64/Makefile.in: Likewise.
* linux/powerpc/Makefile.in: Likewise.
* linux/Makefile.in: Likewise.
Roland McGrath [Mon, 30 Dec 2002 00:51:23 +0000 (00:51 +0000)]
2002-12-22 Roland McGrath <roland@redhat.com>
* linux/Makefile.in (ioctldefs.h ioctls.h): Use $(SHELL) instead of
sh, and use $(srcdir) to find the script.
* linux/powerpc/Makefile.in (ioctlent.raw): Find ioctlent.sh in ../.
(ioctlsort.o): Use ../ioctlsort.c, not ../../ioctlsort.c.
* linux/x86_64/Makefile.in (headers): Renamed to all.
* linux/alpha/Makefile.in: Add empty install target.
* linux/x86_64/Makefile.in: Likewise.
* linux/powerpc/Makefile.in: Likewise.
* linux/Makefile.in: Likewise.
* linux/Makefile.in (ioctldefs.h ioctls.h): Use $(SHELL) instead of
sh, and use $(srcdir) to find the script.
* linux/powerpc/Makefile.in (ioctlent.raw): Find ioctlent.sh in ../.
(ioctlsort.o): Use ../ioctlsort.c, not ../../ioctlsort.c.
* linux/x86_64/Makefile.in (headers): Renamed to all.
* linux/alpha/Makefile.in: Add empty install target.
* linux/x86_64/Makefile.in: Likewise.
* linux/powerpc/Makefile.in: Likewise.
* linux/Makefile.in: Likewise.
Roland McGrath [Sun, 22 Dec 2002 03:34:39 +0000 (03:34 +0000)]
2002-12-21 Roland McGrath <roland@redhat.com>
* linux/syscall.h [I386 || IA64] (SYS_socket_subcall): Bump to 300 for
safety, since up to 260 are already used in 2.5 kernels.
* linux/syscallent.h: Update the table.
* linux/ia64/syscallent.h: Likewise.
Roland McGrath [Sun, 22 Dec 2002 03:34:36 +0000 (03:34 +0000)]
2002-12-21 Roland McGrath <roland@redhat.com>
* linux/syscallent.h: Add some new 2.5 syscall names.
Now clone takes 5 args.
* process.c [LINUX] (clone_flags): Update with 2.5 flag bits.
[LINUX] (sys_clone): Print new args.
* mem.c (print_ldt_entry): Make global.
Roland McGrath [Sun, 22 Dec 2002 03:34:34 +0000 (03:34 +0000)]
2002-12-21 Roland McGrath <roland@redhat.com>
* linux/syscallent.h: Add some new 2.5 syscall names.
Now clone takes 5 args.
* process.c [LINUX] (clone_flags): Update with 2.5 flag bits.
[LINUX] (sys_clone): Print new args.
* mem.c (print_ldt_entry): Make global.
* linux/syscall.h [I386 || IA64] (SYS_socket_subcall): Bump to 300 for
safety, since up to 260 are already used in 2.5 kernels.
* linux/syscallent.h: Update the table.
* linux/ia64/syscallent.h: Likewise.
Roland McGrath [Sat, 21 Dec 2002 23:25:18 +0000 (23:25 +0000)]
2002-12-21 Roland McGrath <roland@redhat.com>
* syscall.c (force_result): New function.
* process.c (internal_wait): Handle ECHILD exit from wait call with
WNOHANG flag set; force the return value to 0 in the inferior when it
has live children we are tracing.