Commit Graph

100 Commits

Author SHA1 Message Date
Denys Vlasenko
932fc7d4fc This patch does not change any logic.
It merely passes tcp pointer to upeek instead of pid.
This is needed if one wants to check or change
some tcp fields.

I have patches which require this. I can imagine someone else
eventually needing to look at tcp for completely orthogonal reasons.
2008-12-16 18:18:40 +00:00
87ea1f4fe6 2008-10-23 Mike Frysinger <vapier@gentoo.org>
Port strace to the Blackfin architecture.
	* configure.ac: Add bfin to supported architectures.
	* process.c: Skip u_fpvalid/u_fpstate for Blackfin architecture.
	(change_syscall): Support Blackfin architecture.
	* syscall.c: Declare r0 for Blackfin architecture.
	(get_scno): Decode Blackfin syscall number.
	(syscall_fixup): Extract Blackfin return value.
	(get_error): Decode Blackfin return value.
	(force_result): Poke Blackfin return value.
	(syscall_enter): Extract Blackfin syscall arguments.
	* defs.h: Define TCB_WAITEXECVE for Blackfin architecture.
	* linux/syscall.h (sys_sram_alloc): Declare for Blackfin
	architecture.
	* system.c (sys_sram_alloc): Decode Blackfin sram_alloc() syscall.
	* util.c (getpc): Handle PC on Blackfin architecture.
	(printcall): Likewise.
	* linux/bfin/ioctlent.h, linux/bfin/syscallent.h: New Blackfin
	headers.
	* Makefile.am (EXTRA_DIST): Add linux/bfin/ioctlent.h and
	linux/bfin/syscallent.h.
2008-11-10 22:21:41 +00:00
21a7534745 2008-04-19 Dmitry V. Levin <ldv@altlinux.org>
* desc.c (sys_fcntl): Do not initialize auxstr for failed syscall.
	* process.c (sys_fork, sys_rfork) [USE_PROCFS]: Likewise.
	* signal.c (sys_signal): Likewise.
	* stream.c (internal_stream_ioctl): Likewise.
	* time.c (sys_adjtimex): Likewise.
	* syscall.c (trace_syscall): If RVAL_STR is set, then
	print auxstr for failed syscall as well.
2008-09-03 01:22:18 +00:00
2e55ff4562 2008-04-19 Dmitry V. Levin <ldv@altlinux.org>
* syscall.c (is_restart_error): New function.
	* defs.h (is_restart_error): Declare it.

	* linux/dummy.h (sys_nanosleep): Uncouple from sys_adjtime().
	* time.c (sys_nanosleep): New function, based on is_restart_error().
2008-09-03 01:02:46 +00:00
Roland McGrath
d5bd7e681b 2008-08-24 Roland McGrath <roland@redhat.com>
* syscall.c (trace_syscall): Conditionalize on [SYS_socket_subcall]
	and [SYS_ipc_subcall] individually.
2008-08-25 03:16:26 +00:00
Jan Kratochvil
1f942710a5 2008-08-06 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix compiler warnings.
	* signal.c (sys_signal): Cast to SIG_* to the matching type LONG.
	* strace.c (trace): Variables PSR and PC are now signed.
	* syscall.c (syscall_enter): Variable RBS_END is now signed long.
	Remove/add the RBS_END casts appropriately.
	* util.c [IA64] (arg_setup): Variable BSP is now signed long.
	Remove/add the BSP casts appropriately.
	<ia32>: Initialize *STATE.
2008-08-06 21:38:52 +00:00
Roland McGrath
c1e4592381 2008-05-27 Roland McGrath <roland@redhat.com>
* syscall.c [LINUX] (is_negated_errno): New function.
	(get_error) [LINUX]: Use it for all such cases.
	Fixes RH#447587.
2008-05-27 23:18:29 +00:00
Roland McGrath
5670331bf1 2008-01-25 Bruna Moreira <bruna.moreira@indt.org>
* defs.h [ARM]: Define SUPPORTED_PERSONALITIES to 2.
	* syscall.c (get_scno) [ARM]: Add support for architecture specific
	syscalls.
	* linux/arm/syscallent.h: Update network syscalls list.
	* linux/arm/syscallent1.h: New file. Add new architecture specific
	syscalls.
	* linux/arm/errnoent1.h: New file.
	* linux/arm/ioctlent1.h: New file.
	* linux/arm/signalent1.h: New file.
	Fixes Debian#441000.
2008-05-20 01:35:55 +00:00
Roland McGrath
542c2c6fe2 2007-08-26 Daniel Jacobowitz <dan@codesourcery.com>
* defs.h [MIPS]: Include <sgidefs.h>.
	(MAX_QUALS): Update for MIPS.
	(LINUX_MIPSO32, LINUX_MIPSN32, LINUX_MIPSN64, LINUX_MIPS64): Define.
	(struct tcb): Add ext_arg for MIPS N32.
	(TCB_WAITEXECVE): Define for MIPS.
	(ALIGN64): Use LINUX_MIPSO32.
	* file.c (sys_lseek): Use ext_arg for MIPS N32.
	(sys_readahead, sys_fadvise64_64): Likewise.
	* io.c (sys_pread64, sys_pwrite64): Likewise.
	* mem.c (print_mmap): Take OFFSET argument.
	(sys_old_mmap): Update call to print_mmap.
	(sys_mmap): Use ext_arg for MIPS N32.
	* process.c (struct_user_offsets): Add MIPS registers.
	* signal.c (sys_sigreturn): Handle MIPS N32 and MIPS N64.  Correct
	MIPS O32 call to sprintsigmask.
	* syscall.c (internal_syscall): Handle MIPS N32.  Check for
	TCB_WAITEXECVE on MIPS.
	(force_result): Add a comment about MIPS N32.
	(syscall_enter): Handle MIPS N32 and MIPS N64.
	* linux/syscall.h (sys_pread64, sys_pwrite64): Declare.
	* linux/mips/syscallent.h: Include "dummy.h".  Handle alternate
	MIPS ABIs.
2008-05-20 01:11:56 +00:00
Roland McGrath
5e48c54ddf 2008-05-08 David S. Miller <davem@davemloft.net>
* syscall.c (socket_map, sparc_socket_decode): Delete.
	(trace_syscall): Use common socketcall and ipc subcall
	support on sparc.
	* linux/sparc/syscall.h (sys_semtimedop): Declare.
	(SYS_socket_subcall, SYS_sub_socket, SYS_sub_bind,
	SYS_sub_connect, SYS_sub_listen, SYS_sub_accept,
	SYS_sub_getsockname, SYS_sub_getpeername,
	SYS_sub_socketpair, SYS_sub_send, SYS_sub_recv,
	SYS_sub_sendto, SYS_sub_recvfrom, SYS_sub_shutdown,
	SYS_sub_setsockopt, SYS_sub_getsockopt, SYS_sub_sendmsg,
	SYS_sub_recvmsg, SYS_socket_nsubcalls, SYS_ipc_subcall,
	SYS_sub_semop, SYS_sub_semget, SYS_sub_semctl,
	SYS_sub_semtimedop, SYS_sub_msgsnd, SYS_sub_msgrcv,
	SYS_sub_msgget, SYS_sub_msgctl, SYS_sub_shmat,
	SYS_sub_shmdt, SYS_sub_shmget, SYS_sub_shmctl,
	SYS_ipc_nsubcalls): Define
	* linux/sparc/syscallent.h: Add socketcall and ipc entries.
2008-05-19 23:50:24 +00:00
Roland McGrath
9bc6340d21 2007-11-01 Roland McGrath <roland@redhat.com>
* syscall.c (get_scno) [ARM]: Check TCB_WAITEXECVE.
	Reported by Bernhard Fischer <rep.dot.nop@gmail.com>.
2007-11-01 21:42:18 +00:00
c18c703b48 2007-08-20 Dmitry V. Levin <ldv@altlinux.org>
* syscall.c (qual_syscall, qualify): Fix nsyscalls and MAX_QUALS misuse.
	Reported by Xiaoning Ding.
2007-08-22 21:43:30 +00:00
7d61ff1dbf 2006-12-21 Dmitry V. Levin <ldv@altlinux.org>
Move counts code to separate file.
	* count.c: New file.
	* Makefile.am (strace_SOURCES): Add count.c.
	* syscall.c (call_counts, countv, counts, shortest, time_cmp,
	syscall_cmp, count_cmp, sortfun, overhead, set_sortby,
	set_overhead, call_summary_pers, call_summary): Move to count.c
	* count.c (count_syscall): New function.
	* defs.h (count_syscall): Declare it.
	* syscall.c (trace_syscall): Use it.
2006-12-21 21:15:04 +00:00
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