Commit Graph

237 Commits

Author SHA1 Message Date
b2f869997a 2006-12-20 Dmitry V. Levin <ldv@altlinux.org>
* syscall.c (internal_syscall): Change conditions for internal_exit,
	internal_fork, internal_clone, internal_exec and internal_wait
	calls from switching on known scno values to switching on known
	sysent[tcp->scno].sys_func values.
	Fixes RH#179740.
2006-12-21 11:44:28 +00:00
3abe8b20f6 2006-12-20 Dmitry V. Levin <ldv@altlinux.org>
Show system call summary for each personality.
	* syscall.c (countv): New call_counts pointers array.
	(counts): Convert to macro wrapper around countv.
	(call_summary_pers): New function.
	(call_summary): Use it for each personality.
	Fixes RH#192193.
2006-12-20 22:37:21 +00:00
b9fe011cdf 2006-12-10 Dmitry V. Levin <ldv@altlinux.org>
Make several global variables static.
	#ifdef definitions of rarely unused functions.
	* defs.h (rflag, tflag, outfname): Remove.
	* strace.c (iflag, interactive, pflag_seen, rflag, tflag,
	outfname, username): Make static.
	* desc.c (sys_getdtablesize): Define only for
	ALPHA || FREEBSD || SUNOS4.
	* file.c (sys_fchroot): Define only for SUNOS4 || SVR4.
	(sys_mkfifo): Define only for FREEBSD.
	* mem.c (sys_sbrk): Define only for FREEBSD || SUNOS4.
	(sys_getpagesize): Define only for
	ALPHA || FREEBSD || IA64 || SUNOS4 || SVR4.
	* net.c (sys_so_socket): Define only for SVR4.
	* process.c (sys_gethostid): Define only for
	FREEBSD || SUNOS4 || SVR4.
	(sys_gethostname): Define only for
	ALPHA || FREEBSD || SUNOS4 || SVR4.
	(sys_setpgrp): Define only for ALPHA || SUNOS4 || SVR4.
	(sys_execv): Define only for SPARC || SPARC64 || SUNOS4.
	* signal.c (sys_sigblock): Define only for FREEBSD || SUNOS4.
	(sys_sighold, sys_sigwait): Define only for SVR4.
	(sys_killpg): Define only for FREEBSD || SUNOS4.
	* stream.c (sys_getmsg): Define only for
	SPARC || SPARC64 || SUNOS4 || SVR4.
	* syscall.c (sys_indir): Define only for SUNOS4.
2006-12-13 16:59:44 +00:00
Roland McGrath
f691bd2a4f 2006-03-30 Daniel Jacobowitz <dan@codesourcery.com>
* process.c (change_syscall): Add ARM support.
	* syscall.c (get_scno): Handle ARM EABI.
	Fixes Debian#360152.
2006-04-25 07:34:41 +00:00
Roland McGrath
4b2dccaf94 2006-01-12 Roland McGrath <roland@redhat.com>
* defs.h [LINUXSPARC] (PERSONALITY0_WORDSIZE, PERSONALITY1_WORDSIZE):
	New macros.
	[SPARC64] (PERSONALITY2_WORDSIZE): New macro.
	[X86_64] (PERSONALITY0_WORDSIZE, PERSONALITY1_WORDSIZE): New macros.
	* syscall.c (PERSONALITY0_WORDSIZE): New macro if undefined.
	(personality_wordsize): New variable.
	(decode_subcall): Use it for size of argument words.
	Fixes RH#174354.
2006-01-12 10:18:53 +00:00
Roland McGrath
138c6a334f 2005-11-17 Dmitry V. Levin <ldv@altlinux.org>
Implement qual_flags support for each personality.
	* strace.c (main): Move qualify calls after set_personality call.
	* syscall.c (qual_flags0): New variable..
	[SUPPORTED_PERSONALITIES >= 2] (qual_flags1): New variable.
	[SUPPORTED_PERSONALITIES >= 3] (qual_flags2): New variable.
	(qual_flags): Change variable definition from array to pointer.
	(set_personality): Initialize qual_flags variable.
	(qualify_one): Add "pers" argument to specify personality.
	[SUPPORTED_PERSONALITIES >= 2]: Set qual_flags1 if requested.
	[SUPPORTED_PERSONALITIES >= 3]: Set qual_flags2 if requested.
	(qual_syscall): Pass personality to qualify_one.
	[SUPPORTED_PERSONALITIES >= 2]: Look for syscall also in sysent1
	table.
	[SUPPORTED_PERSONALITIES >= 3]: Look for syscall also in sysent2
	table.
	(qual_signal): Pass personality to qualify_one.
	(qual_desc): Likewise.
	(qualify): Use qualify_one instead of manual qual_flags
	manipulations.
	[SUPPORTED_PERSONALITIES >= 2]: Look for syscall also in sysent1
	table.
	[SUPPORTED_PERSONALITIES >= 3]: Look for syscall also in sysent2
	table.
	* defs.h: Update qual_flags declaration.
	Fixes RH#173986.
2006-01-12 09:50:49 +00:00
Roland McGrath
48a035fb6f 2005-11-14 Dmitry V. Levin <ldv@altlinux.org>
* syscall.c (qual_syscall): Handle numeric syscall specification.
	Fixes RH#174798.
	* syscall.c (qual_signal, qual_options): Remove redundant argument
	check.
2006-01-12 09:45:56 +00:00
Roland McGrath
2fe7b13b2f 2005-06-08 Dmitry V. Levin <ldv@altlinux.org>
Introduce "-e trace=desc".
	* defs.h (TRACE_DESC): New flag.
	* syscall.c: Define TD macro before include of syscallent files
	and undefine it afterwards.
	(lookup_class): Recognize "desc" keyword.
	* strace.1: Document "-e trace=desc".
	* freebsd/i386/syscallent.h: Mark those syscalls which take a
	file descriptor as an argument or return a file descriptor with
	TD flag.
	* linux/alpha/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/mips/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/sparc64/syscallent2.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* sunos4/syscallent.h: Likewise.
	* svr4/syscallent.h: Likewise.
	Fixes RH#159400.
2005-07-05 03:25:35 +00:00
Roland McGrath
a4d4853f67 2005-06-08 Dmitry V. Levin <ldv@altlinux.org>
Minor namespace cleanup.
	* defs.h (string_quote): Remove declaration.
	* file.c (openmodessol) [LINUXSPARC]: Make static.
	(fileflags): Likewise.
	(aclcmds, aclipc) [HAVE_SYS_ACL_H]: Likewise.
	(direnttypes) [FREEBSD || LINUX]: Likewise.
	(xattrflags): Likewise.
	* process.c (unalignctl_string): Make static.
	(setarg): Disable.
	* syscall.c (subcalls_table): Make static.
	(socket_map) [!(LINUX && (ALPHA || MIPS))]: Likewise.
	(sparc_socket_decode): Make static, define for [SPARC || SPARC64] only.
	(decode_subcall): Make static.
	(syscall_fixup): Likewise.
	(get_error): Likewise.
	(syscall_enter): Likewise.
	* util.c (tv_tv): Disable.
	(getpc): Likewise.
	(string_quote): Make static.
	Fixes RH#159688.
2005-06-08 20:45:28 +00:00
Roland McGrath
173527948f 2005-06-06 Roland McGrath <roland@redhat.com>
* linux/syscall.h (SYS_socket, SYS_bind, SYS_connect, SYS_listen)
	(SYS_accept, SYS_getsockname, SYS_getpeername, SYS_socketpair)
	(SYS_send, SYS_recv, SYS_sendto, SYS_recvfrom, SYS_shutdown)
	(SYS_setsockopt, SYS_getsockopt, SYS_sendmsg, SYS_recvmsg)
	(SYS_getsockname, SYS_semop, SYS_semgsub_et, SYS_semget, SYS_semctl)
	(SYS_semtimedop, SYS_msgsnd, SYS_msgrcv, SYS_msgget)
	(SYS_msgctl, SYS_shmat, SYS_shmdt, SYS_shmget)
	(SYS_shmctl): Macros renamed to SYS_sub_*.
	* syscall.c (dumpio): Match SYS_sub_* if defined instead of SYS_*.
	* defs.h (struct sysent): New member `native_scno'.
	(known_scno): Declare new function.
	* linux/syscallent.h: Add new final field to interesting syscalls.
	* syscall.c (known_scno): New function.
	(dumpio, internal_syscall, syscall_fixup, trace_syscall): Use it.
	* process.c (internal_fork, internal_exit): Likewise.
	[IA64] (ARG_STACKSIZE, ARG_PTID, ARG_CTID, ARG_TLS): Likewise.
	* strace.c (proc_open): Likewise.
	* util.c [LINUX] (setbpt): Likewise.
	* linux/syscall.h: Remove [!defined(X86_64)] from conditional
	for defining SYS_socket_subcall et al.
	* linux/syscallent.h: Likewise for #error check.
	* syscall.c (trace_syscall): Likewise for SYS_{socketcall,ipc} cases.
	Fixes RH#158934.
2005-06-07 23:21:26 +00:00
Roland McGrath
920e6bb712 2005-02-28 Andreas Schwab <schwab@suse.de>
* syscall.c (getrval2): Move #ifdef IA64 inside #ifdef LINUX.
2005-03-15 02:15:20 +00:00
Roland McGrath
b77d0934b3 2004-12-20 Dmitry V. Levin <ldv@altlinux.org>
* syscall.c (call_summary): Fix potential NULL dereference.
	Fixes RH#143369.
2005-02-02 04:42:25 +00:00
Roland McGrath
fe6b352f8d 2004-12-19 Dmitry V. Levin <ldv@altlinux.org>
* syscall.c (qual_signal): Check bounds for numeric signal names.
	Fix parser of symbolic signal names.
	Fix return code, as required by qualify() function.
	* syscall.c (qual_desc): Check bounds for descriptor number.
	* syscall.c (qual_syscall): Correct return code, to be consistent
	with qualify() and other qual_* functions.
	Fixes RH#143362.
2005-02-02 04:40:11 +00:00
Roland McGrath
76421df9b2 2005-02-01 Roland McGrath <roland@redhat.com>
* syscall.c (qual_signal): Fix inverted return value and bogus
	argument to qualify_one in the named case.
2005-02-02 03:51:18 +00:00
Roland McGrath
5a9c6ade89 2005-02-01 Roland McGrath <roland@redhat.com>
* syscall.c (syscall_enter) [X86_64]: Fix 32-bit argument register map
	not to double the middle entry!
2005-02-02 03:06:52 +00:00
Roland McGrath
e10e62a03c 2004-09-03 Roland McGrath <roland@redhat.com>
* syscall.c (qual_options): Add const to defn.
	Update all uses.
	(call_count, error_count, tv_count): Variables removed.
	(struct call_counts, counts): New type and variable.
	Update all users of the old three to use the new array of structs.
	(trace_syscall): Allocate counts on first use.
	(sorted_count): Variable removed.
	(call_summary): Allocate locally.
2004-09-04 04:20:43 +00:00
Roland McGrath
ee36ce19e0 2004-09-03 Roland McGrath <roland@redhat.com>
* syscall.c (sysent0, sysent1, sysent2, sysent): Add const to defn.
	(nsyscalls0, nsyscalls1, nsyscalls2): Likewise.
	(errnoent0, errnoent1, errnoent2, errnoent): Likewise.
	(nerrnos0, nerrnos1, nerrnos2): Likewise.
	* signal.c (signalent0, signalent1, signalent2): Likewise.
	(nsignals0, nsignals1, nsignals2): Likewise.
	(signame): LIkewise.
	* ioctl.c (ioctlent0, ioctlent1, ioctlent2): Likewise.
	(nioctlents0, nioctlents1, nioctlents2): Likewise.
	(ioctl_lookup, ioctl_next_match): Likewise.
	* defs.h: Update decls.
	* io.c (sys_ioctl): Update users.
2004-09-04 03:53:10 +00:00
Roland McGrath
c74c0b732b 2004-09-01 Roland McGrath <roland@redhat.com>
* process.c (internal_wait): Take second arg giving index of flags
	argument.
	* defs.h: Update prototype.
	* syscall.c (internal_syscall): Update caller.
	Also use internal_wait for SYS_waitid.
	* process.c (sys_waitid): Define for [LINUX] as well.
	Don't tweak TCB_SUSPENDED--internal_wait does that.
	(waitid_types): Conditionalize use of nonstandard P_* macros.
2004-09-01 19:39:46 +00:00
Roland McGrath
aa510629c7 2004-08-31 Roland McGrath <roland@redhat.com>
* syscall.c (dumpio): Match pread and pwrite system calls too.
	Fixes Debian bug #239947.
2004-08-31 07:47:45 +00:00
Roland McGrath
6d1a65c759 2004-07-07 David S. Miller <davem@nuts.davemloft.net>
* linux/sparc/syscallent.h: Sync with reality.
	* linux/sparc/syscall.h (sys_sendfile64, sys_futex, sys_gettid,
	sys_sched_setaffinity, sys_sched_getaffinity, sys_setxattr,
	sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr,
	sys_fgetxattr, sys_listxattr, sys_llistxattr, sys_flistxattr,
	sys_removexattr, sys_lremovexattr, sys_fremovexattr,
	sys_remap_file_pages, sys_readahead, sys_tgkill, sys_statfs64,
	sys_fstatfs64, sys_clock_settime, sys_clock_gettime,
	sys_clock_getres, sys_clock_nanosleep, sys_timer_create,
	sys_timer_settime, sys_timer_gettime): New declarations.
	* linux/sparc64/dummy2.h, linux/sparc64/syscallent2.h,
	linux/sparc64/syscall.h, linux/sparc64/errnoent.h,
	linux/sparc64/errnoent1.h, linux/sparc64/errnoent2.h,
	linux/sparc64/ioctlent.h, linux/sparc64/ioctlent1.h,
	linux/sparc64/ioctlent2.h, linux/sparc64/signalent.h,
	linux/sparc64/signalent.h, linux/sparc64/signalent.h,
	linux/sparc64/signalent1.h, linux/sparc64/signalent2.h,
	linux/sparc64/syscall1.h, linux/sparc64/syscallent.h,
	linux/sparc64/syscallent1.h: New files.
	* defs.h (LINUXSPARC): Define also when SPARC64.
	(LINUX && SPARC64): Set SUPPORTED_PERSONALITIES to 3.
	Ignore SIGTRAP after execve by defining TCB_WAITEXECVE.
	Define possibly missing __NR_exit_group.  Declare getrval2.
	* configure.ac (sparc64): New architecture case.
	* config.h.in (SPARC64): New define.
	* file.c (stat_sparc64): New structure.
	(printstat_sparc64): New output routine for that.
	(printstat): Call it, if personality is 2.
	(printstat64): Likewise.
	* util.c: Conditionalize ptrace defines on LINUXSPARC
	not LINUX && SPARC.
	(SPARC64 && LINUX): Define r_pc to r_tpc, and PTRACE_FOOREGS
	to PTRACE_FOOREGS64 so that more sparc code can be shared
	between 64-bit and 32-bit.
	(_hack_syscall5): Correct trap number when SPARC64.
	(PTRACE_WRITE{TEXT,DATA}): Add SPARC64 to ifdef guard.
	(getpc): Handle SPARC64 && LINUX.
	(printcall): Likewise.
	(arg fetching/setting): Use same code for SPARC64 LINUX
	as for SPARC.
	(setbpt): Handle SPARC64 && LINUX.
	(clearbpt): Likewise.
	* signal.c: Conditionalize ptrace defines on SPARC and
	SPARC64.
	(SPARC64 && LINUX): Define r_pc to r_tpc, and PTRACE_FOOREGS
	to PTRACE_FOOREGS64 so that more sparc code can be shared
	between 64-bit and 32-bit.
	(m_siginfo): Use same definition on SPARC64 as SPARC.
	(sys_sigreturn): Handle LINUX && SPARC64.
	* syscall.c: Conditionalize ptrace defines on SPARC and
	SPARC64.
	(SPARC64 && LINUX): Define r_pc to r_tpc, and PTRACE_FOOREGS
	to PTRACE_FOOREGS64 so that more sparc code can be shared
	between 64-bit and 32-bit.
	(getscno): Use same static state on SPARC64 as SPARC,
	and add SPARC64 handling.
	(get_error): Handle LINUX && SPARC64.
	(force_result): Likewise.
	(syscall_enter): Likewise.
	(trace_syscall): Handle sys_socketcall and sys_ipc on SPARC64
	just like SPARC.
	(getrval2): Handle LINUX && SPARC64.
	* process.c: Conditionalize ptrace defines on SPARC and
	SPARC64.
	(SPARC64 && LINUX): Define r_pc to r_tpc, and PTRACE_FOOREGS
	to PTRACE_FOOREGS64 so that more sparc code can be shared
	between 64-bit and 32-bit.
	(change_syscall): Handle LINUX && SPARC64.
	(struct_user_offsets): Ifdef out those which do not exist
	on SPARC64.
	* net.c (sys_pipe): Handle LINUX && SPARC64.
	* ioctl.c: Fix initializer typo for nioctlents2, was
	nioctlents1 by accident.
2004-07-12 07:44:08 +00:00
Roland McGrath
998fac7049 2004-06-22 Roland McGrath <roland@redhat.com>
* syscall.c (syscall_fixup) [LINUX && X86_64]: For 32-bit process,
	sign extend the low 32 bits of RAX to 64 bits.
	* syscall.c (force_result): [LINUX && X86_64]: Fix RAX*4 -> RAX*8.
2004-06-23 01:40:45 +00:00
Roland McGrath
d62b6711b4 2004-03-01 Roland McGrath <roland@redhat.com>
* strace.c (main): Avoid potential buffer overruns from ludicrous
	arguments or PATH values.
	* syscall.c (qual_signal): Bail out for too-long string.
2004-03-02 06:52:01 +00:00
Roland McGrath
ce9f0740d3 2004-03-01 Roland McGrath <roland@redhat.com>
* configure.ac: Check for `struct pt_all_user_regs'
	and `struct ia64_fpreg' in <sys/ptrace.h>.
	* util.c, process.c, syscall.c: Work around conflicts between
	<sys/ptrace.h> and <linux/ptrace.h> for defining those types.
2004-03-01 21:29:22 +00:00
Roland McGrath
b4ce17690f 2004-02-26 Andreas Schwab <schwab@suse.de>
* defs.h [LINUX && IA64]: Declare getrval2 also on IA64.
	* net.c (sys_pipe) [LINUX && IA64]: For IA64 use the two return values.
	* syscall.c (getrval2) [LINUX && IA64]: Implement for IA64.
2004-03-01 20:30:48 +00:00
Roland McGrath
08267b8d67 2003-12-31 David Mosberger <davidm@hpl.hp.com>
* process.c (internal_exit): For ia64, also recognize IA-32 252
	as exit_group().
	(change_syscall): For IA64, also support changing IA-32 syscalls.
	* syscall.c (internal_syscall): For IA64, also recognize IA-32
        syscall 252 (exit_group) as an internal_exit() syscall.
	* util.c (SYS_fork): For IA64, define them to the IA-32 syscall
	number.
	(SYS_vfork): Likewise.
	(arg_setup): For IA64 version, also support IA-32 syscalls.
	(get_arg0): Likewise.
	(get_arg1): Likewise.
	(set_arg0): Likewise.
	(set_arg1): Likewise.
2004-02-20 22:56:43 +00:00
Roland McGrath
182aa38bb2 2004-01-13 Roland McGrath <roland@redhat.com>
* syscall.c (force_result) [LINUX] [S390 || S390X]: Remove bogus upeek
	call.
2004-02-20 02:23:30 +00:00
Roland McGrath
190f8dd7b1 2003-12-14 Anton Blanchard <anton@samba.org>
* syscall.c (get_error) [POWERPC]: Cast result to unsigned long for
	ppc64, we were misreporting syscalls that really succeeded as having
	failed.
2004-01-13 10:13:44 +00:00
Roland McGrath
ee9c5b5d63 2003-11-01 Roland McGrath <roland@redhat.com>
* syscall.c (trace_syscall) [LINUX]: Calculate ONE_TICK once using
	setitimer rather than hard-coding a value based on HZ.
2003-11-01 22:11:22 +00:00
Roland McGrath
bb4833f1ae 2003-10-21 Roland McGrath <roland@redhat.com>
* syscall.c: Revert last change, was broken.
2003-10-22 06:11:30 +00:00
Roland McGrath
a9da8cd179 2003-09-24 Roland McGrath <roland@redhat.com>
* syscall.c (get_scno) [LINUX] [S390 || S390X]: Bail out of
	instruction decoding branch if TCB_INSYSCALL is clear.
	Reported by <jochen@penguin-breeder.org>.
2003-09-24 22:22:41 +00:00
Roland McGrath
9c555e71d2 2003-07-05 Richard Henderson <rth@twiddle.net>
* process.c (sys_clone): Order arguments for alpha the same as x86_64.
	* syscall.c (ERESTART_RESTARTBLOCK): New.
	(trace_syscall): Print it.
	* linux/alpha/syscallent.h (osf_syscall): Name properly.
	(osf_set_program_attributes): Fix typo.
	(osf_nfssvc): Likewise.
	(osf_sigsendset): Likewise.
	(getdents64, gettid, readahead, tkill, setxattr, lsetxattr, fsetxattr,
	getxattr, lgetxattr, fgetxattr, listxattr, llistxattr, flistxattr,
	removexattr, lremovexattr, fremovexattr, futex, sched_setaffinity,
	sched_getaffinity, tuxcall, io_setup, io_destroy, io_getevents,
	io_submit, io_cancel, exit_group, lookup_dcookie, epoll_create,
	epoll_ctl, epoll_wait, remap_file_pages, set_tid_address,
	restart_syscall, fadvise, timer_create, timer_settime, timer_gettime,
	timer_getoverrun, timer_delete, clock_settime, clock_gettime,
	clock_getres, clock_nanosleep, semtimedop): New.
2003-07-09 09:47:59 +00:00
Roland McGrath
f5a477788e 2003-06-26 Roland McGrath <roland@redhat.com>
* configure.ac: SHMEDIA -> SH64
	* defs.h: Likewise.
	* mem.c: Likewise.
	* process.c: Likewise.
	* sock.c: Likewise.
	* syscall.c: Likewise.
	* util.c: Likewise.
	* linux/shmedia/syscallent.h: Moved to ...
	* linux/sh64/syscallent.h: ... here.
2003-06-26 22:40:42 +00:00
Roland McGrath
7c051d2e4c 2003-06-26 Roland McGrath <roland@redhat.com>
* syscall.c (force_result) [LINUX] [ARM]: Fix variable usage.
	From: Joshua Neal <tinara@netpipeline.net>.
2003-06-26 22:29:32 +00:00
Roland McGrath
2f924cafae 2003-06-26 Roland McGrath <roland@redhat.com>
* syscall.c (get_scno) [S390 || S390X]: Fix old vs new mode detection.
	From Michael Holzheu <HOLZHEU@de.ibm.com>.
2003-06-26 22:23:28 +00:00
Roland McGrath
0f87c4972f 2003-06-03 Roland McGrath <roland@redhat.com>
Linux/ARM improvements from Russell King <rmk@arm.linux.org.uk>:
	* defs.h [LINUX] (TCB_WAITEXECVE): Define for [ARM] too.
	* process.c (struct_user_offsets) [LINUX] [ARM]: Add ARM registers.
	* signal.c [LINUX] (sys_sigreturn) [ARM]: New case.
	* syscall.c (get_scno, syscall_fixup) [LINUX] [ARM]: Case rewritten.
	(get_error) [LINUX] [ARM]: Update.
	(syscall_enter) [LINUX] [ARM]: New case.
	* util.c (printcall) [LINUX] [ARM]: New case.
2003-06-03 23:29:04 +00:00
Roland McGrath
e1e584b8fa 2003-06-02 Roland McGrath <roland@redhat.com>
* configure.ac, defs.h, mem.c, process.c, sock.c, syscall.c, util.c:
	Merged in SHmedia port from Stephen Thomas <stephen.thomas@superh.com>.
2003-06-02 19:18:58 +00:00
Roland McGrath
2b61902ee9 2003-04-10 Roland McGrath <roland@redhat.com>
* syscall.c (qual_desc): Return zero after parsing number.
	From Rob Leslie <rob@mars.org>, fixes Debian bug #188379.
2003-04-10 18:58:20 +00:00
Roland McGrath
6b1d43ef29 2003-02-26 Stuart Menefy <stuart.menefy@st.com>
Various fixes for SuperH [SH]:
	* mem.c (sys_old_mmap): mmap() parameters passed in registers
	* net.c (sys_pipe), syscall.c (getrval2): pipe() results returned
	in registers
	* process.c (change_syscall): Fixed register which holds system
	call number
	* util.c (arg0_offset, arg1_offset): provide definition
	* Makefile.am: Added new files in linux/sh
	* linux/sh/syscallent.h: New file.
	* linux/sh/errnoent.h: New file.
	* linux/sh/ioctlent.h: New file.
	* linux/sh/signalent.h: New file.
2003-03-31 01:05:01 +00:00
Roland McGrath
ba95476dd4 2003-03-04 Roland McGrath <roland@redhat.com>
* syscall.c (get_scno) [IA64]: Do TCB_WAITEXECVE check only when
	TCB_INSYSCALL is clear, like other platforms do.
2003-03-05 06:29:06 +00:00
Roland McGrath
f3a0e1bb56 2003-02-19 Roland McGrath <roland@redhat.com>
FreeBSD rfork support changes from Russ Cox <rsc@plan9.bell-labs.com>:
	* syscall.c (internal_syscall): Handle SYS_rfork with internal_fork.
	* process.c (internal_fork) [SYS_rfork]: Bail if RFPROC flag not set.
2003-02-20 02:45:22 +00:00
Roland McGrath
96dc5148ff 2003-01-20 Roland McGrath <roland@redhat.com>
* defs.h [LINUX] [S390 || S390X] (TCB_WAITEXECVE): Define it.
	* syscall.c (get_scno, syscall_fixup) [LINUX] [S390 || S390X]: Handle
	TCB_WAITEXECVE state with special kludges.
2003-01-20 10:23:04 +00:00
Roland McGrath
eb28535990 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>.
2003-01-14 09:59:00 +00:00
Roland McGrath
d38809b8bd 2003-01-09 Roland McGrath <roland@redhat.com>
* syscall.c (force_result) [S390 || S390X]: Fix typo.
2003-01-10 07:50:21 +00:00
Roland McGrath
923f750119 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.
2003-01-09 06:53:27 +00:00
Roland McGrath
9797cebddb 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.
2002-12-30 10:23:00 +00:00
Roland McGrath
b69f81b8e5 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.
2002-12-21 23:25:18 +00:00
Roland McGrath
761b5d790f 2002-12-15 Roland McGrath <roland@redhat.com>
* syscall.c (syscall_enter) [LINUX && POWERPC]: Define PT_ORIG_R3 if
	not defined, since <asm/ptrace.h> defines it only #ifdef __KERNEL__.
	* process.c: Likewise.
	* syscall.c (trace_syscall): Use strerror, not sys_errlist/sys_nerr.
	* syscall.c (get_scno): Move static `currpers' inside #ifdef X86_64.
	(trace_syscall): Fix return without value.
2002-12-15 23:58:31 +00:00
Michal Ludvig
882eda809c 2002-11-09 Heiko Carstens <heiko.carstens@de.ibm.com>
Bugfix for s390/s390x:
        * syscall.c: Fixed scno derivation for s390/s390x.
2002-11-11 12:50:47 +00:00
Michal Ludvig
17f8fb3484 Added switch for printing only succeeding syscalls. 2002-11-06 13:17:21 +00:00
Michal Ludvig
10a88d09eb 2002-10-07 Michal Ludvig <mludvig@suse.cz>
Merged s390x port by Heiko Carstens <Heiko.Carstens@de.ibm.com>
        and bugfixes to s390 by D.J. Barrow.
2002-10-07 14:31:00 +00:00
Michal Ludvig
0e035502d2 2002-09-23 Michal Ludvig <mludvig@suse.cz>
Merged x86-64 port by Andi Kleen <ak@suse.de>
	and Michal Ludvig <mludvig@suse.cz>
	* Makefile.in: New target 'headers'. Failure ignored.
	* acconfig.h: New defines for x86-64.
	* configure.in: Ditto.
	* defs.h: Ditto.
	* file.c: Ditto.
	* signal.c: Ditto.
	* process.c: Added support for x86-64.
	* util.c: Ditto.
	* syscall.c: Ditto + added automatic personality switching.
	* linux/syscall.h: Ditto.
	* linux/x86_64: New directory.
	* linux/x86_64/Makefile.in: New file.
	* linux/x86_64/gentab.pl: Ditto.
	* linux/x86_64/i386-headers.diff: Ditto.
	* linux/x86_64/makeheaders.sh: Ditto.
	* linux/x86_64/syscallent.h: Ditto.
	* mem.c (print_mmap): Always print arg[4] as int.
2002-09-23 15:41:01 +00:00
Michal Ludvig
53b320f61f 2002-09-23 Michal Ludvig <mludvig@suse.cz>
* configure.in: Fix regular expressions.
	* linux/syscall.h: Added missing braces in prototype of
	sys_getdents64().
	* file.c: Use '#ifdef LINUX' instead of '#ifdef linux'.
	(struct fileflags): Made extern to inhibit compiation warnings.
	(sys_getdents64): Merged LINUX and SVR4 part.
	* syscall.c(get_scno): Split multiline string into two distinct
	strings.
2002-09-23 13:30:09 +00:00
Wichert Akkerman
ccef63782c Merge patch from Greg Banks for Linux/SuperH support 2002-05-01 16:39:22 +00:00
Wichert Akkerman
4527dae3b8 check for negative u_errors 2002-03-31 19:03:29 +00:00
Wichert Akkerman
7b3346be42 Import lots of ia64 related changes from David Mosberger 2001-10-09 23:47:38 +00:00
John Hughes
1d08dcf46d Merge iov fixes from Richard Kettlewell 2001-07-10 13:48:44 +00:00
John Hughes
4e36a8151b Handle fork1/forkall on uw, handle rfork1,rforkall,rexecve and ssisys on uw non-stop-clusters 2001-04-18 15:11:51 +00:00
Wichert Akkerman
00a82eed2b several Linux/sparc fixes 2001-03-28 20:29:17 +00:00
Wichert Akkerman
c1652e2095 Add Linux/hppa port, patch from Richard Hirst 2001-03-27 12:17:16 +00:00
John Hughes
61eeb55be4 Fix for freebsd 4.1 2001-03-06 15:51:53 +00:00
John Hughes
bdf48f55f2 Merge Harald Bhme's solaris patches 2001-03-06 15:08:09 +00:00
John Hughes
252997128d Use pr_syscall on UW 2001-03-06 10:10:06 +00:00
Wichert Akkerman
bf79f2e16b Add FreeBSD support 2000-09-01 21:03:06 +00:00
Wichert Akkerman
16a03d2e97 test/clone.c: minor fixup
Another bunch of patches from John Hughes merged:
signal.c:
+ SVR4 printcontext(): sigset_t != sigset_t*
+ getcontext returns a value, so print on exit of syscall
+ add UC_FP to ucontext_flags for OS writers that can't spell
+ sys_signal(): special case SIG_{ERR,DFL,IGN}
+ decode_subcall(): only do subcall range checking when needed
bunch of UnixWare updates
aclocal.m4, acconfig.h, configure.in: add test for long long type
2000-08-10 02:14:04 +00:00
Wichert Akkerman
5ae21ead9f The `too much stuff, just check the ChangeLog' update 2000-05-01 01:53:59 +00:00
Wichert Akkerman
c792698a99 README-linux: updated to note that strace might not compile
with development kernels
bjm.c: sys_query_module: check if malloc succeeds
system.c: sys_cap[gs]et(): check if malloc succeeds, only malloc once
linux/syscallent.h: updated for 2.3.99pre3
linux/alpha/syscallent.h: updated for 2.3.99pre3, add all osf syscalls
even though Linux doesn't implement them
syscall.c: add global variables for MIPS registers as well
syscall.c: move global variables to before get_scno since that uses them
util.c: oops, misspelled defined
process.c: fix ptrace calls in change_syscall
mem.c: decode sys_madvise
Merge patch from Topi Miettinen <Topi.Miettinen@nic.fi>
+ add support for quotactl, fdatasync, mlock, mlockall, munlockall & acct
+ small fix for RLIMIT_* and RUSAGE_BOTH
+ enhace support for capget and capset
2000-04-10 22:22:31 +00:00
Wichert Akkerman
faf722234d test/vfork.c: new file to test vfork traces
test/.cvsignore: new file
defs.h: Up maximum number of traced processed to 64
strace.c: Disable some debugging code from davidm
implement setarg for more architectures
implement change_syscall
2000-02-19 23:59:03 +00:00
Wichert Akkerman
2ee6e45f36 Fixup isdigit calls 2000-02-18 15:36:12 +00:00
Wichert Akkerman
12f75d1a38 S390 updates 2000-02-14 16:23:40 +00:00
Wichert Akkerman
8b1b40cd8b Merge Trillian patches (Linux ia64) 2000-02-03 21:58:30 +00:00
Pavel Machek
4dc3b141be Split trace_syscall into few functions to make code readable. 2000-02-01 17:58:41 +00:00
Pavel Machek
d8ae7e332a Cleaned up __NR_SYSCALL_BASE: less number of #ifdef's in main code is
always good.
2000-02-01 17:17:25 +00:00
Wichert Akkerman
7a0b649aea Begin work on supporting clone 1999-12-23 15:08:17 +00:00
Wichert Akkerman
4dc8a2aec6 Bunch of stuff 1999-12-23 14:20:14 +00:00
Wichert Akkerman
f90da01fd1 Add Linux MIPS support 1999-10-31 21:15:38 +00:00
Wichert Akkerman
15dea97f8a Compilation updates 1999-10-06 13:06:34 +00:00
Wichert Akkerman
9ce1a63eb2 Catching up on my mail-backlog, see ChangeLog for details 1999-08-29 23:15:07 +00:00
Wichert Akkerman
b046b38593 Update sys/reg.h usage in syscall.c as well 1999-07-13 22:20:16 +00:00
Wichert Akkerman
2b483ba988 Fix conditions for including sys/reg.h and linux/ptrace.h 1999-06-24 13:55:29 +00:00
Wichert Akkerman
e6f876c49d Linux/powerpc and SunOS fixes 1999-06-22 15:28:30 +00:00
Wichert Akkerman
8829a55dc2 Various fixes, see ChangeLog for details 1999-06-11 13:18:40 +00:00
Wichert Akkerman
dacfb6ebd6 Add sparc patches from Jakub Jelinek 1999-06-03 14:21:07 +00:00
Ulrich Drepper
8783c011ea Don't include linux/ptrace.h for glibc. 1999-05-29 04:13:58 +00:00
Wichert Akkerman
b859bea10a Change number of personalities for Linux sparc to 2
Minor other fixes
1999-04-18 22:50:50 +00:00
Nate Sammons
ce780fc9e6 Add new function `signame', which returns name (SIGXXX) of numeric
signal, and replace lookups in signalent[] with calls to it.
1999-03-29 23:23:13 +00:00
Wichert Akkerman
9047076564 sys/reg apparently only exists on i386 and m68k, so fix the test in
a couple of files
1999-03-17 00:42:25 +00:00
Wichert Akkerman
76baf7c9f6 Initial revision 1999-02-19 00:21:36 +00:00