]> granicus.if.org Git - strace/log
strace
14 years agoUpdate linux/hppa/syscallent.h to match Linux kernel v2.6.35
Dmitry V. Levin [Thu, 16 Sep 2010 16:48:45 +0000 (16:48 +0000)]
Update linux/hppa/syscallent.h to match Linux kernel v2.6.35

* linux/hppa/syscallent.h: Add hooks for recvmmsg and accept4.

14 years agoPass less information to qualify_one and qual_*
Dmitry V. Levin [Wed, 15 Sep 2010 16:18:20 +0000 (16:18 +0000)]
Pass less information to qualify_one and qual_*

* syscall.c (qualify_one, qual_syscall, qual_signal, qual_fault,
qual_desc): Take just a bitflag argument instead of pointer to the whole
qual_options structure.
(struct qual_options): Update prototype of "qualify" field.
(qualify): Update use of qualify_one and qual_options->qualify.

14 years agoFix -e option with only one value in qualifier statement
Wang Chao [Wed, 15 Sep 2010 03:37:38 +0000 (11:37 +0800)]
Fix -e option with only one value in qualifier statement

Fix regression introduced by commit v4.5.20-19-g30145dd:
if -e option is used with only one value in qualifier statement,
e.g. 'strace -e trace=open ls', syscall information would not be
printed properly.

* syscall.c (qualify): Remove faulty optimization.

Signed-off-by: Wang Chao <wang.chao@cn.fujitsu.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
14 years agoFix off_t/rlim_t size checks when cross-compiling
Mike Frysinger [Sun, 12 Sep 2010 08:01:47 +0000 (04:01 -0400)]
Fix off_t/rlim_t size checks when cross-compiling

The current off_t/rlim_t size checks (wrt size of long long) use AC_RUN
which obviously doesn't work when cross-compiling.  While we don't hit
any configure errors, the fall back code is pretty dumb (which is to say
there isn't any).  Considering the code in question though, we can use
some fun compiler tricks with sizeof and array lengths to turn it into
a pure build test and avoid the RUN issue completely.

* m4/long_long.m4 (AC_OFF_T_IS_LONG_LONG, AC_RLIM_T_IS_LONG_LONG):
Convert from AC_RUN_IFELSE to AC_COMPILE_IFELSE.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoFix long long little endian detection when cross-compiling
Mike Frysinger [Sun, 12 Sep 2010 07:39:55 +0000 (03:39 -0400)]
Fix long long little endian detection when cross-compiling

The long long endian detection code does an AC_TRY_RUN() and since that
doesn't work when cross-compiling, it sets a fallback value.  However,
rather than do any sort of default endian detection, the code simply
sets it to "no".  This probably breaks most little endian systems out
there when cross-compiling for them.  It certainly breaks Blackfin
systems.  So use the common endian detection code provided by autoconf
and key off of that when cross-compiling.

* configure.ac: Call AC_C_BIGENDIAN.
* m4/long_long.m4 (AC_LITTLE_ENDIAN_LONG_LONG): Set cross-compiling
logic based on ac_cv_c_bigendian.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoBlackfin: decode new syscalls
Mike Frysinger [Sat, 11 Sep 2010 19:04:18 +0000 (15:04 -0400)]
Blackfin: decode new syscalls

* linux/bfin/syscallent.h: Add fanotify/prlimit/cacheflush syscalls.
* linux/syscall.h: Add sys_cacheflush() decl.
* system.c: Decode Blackfin's cacheflush syscall.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years ago* linux/ioctlent.sh: Search a few non-exported paths.
Mike Frysinger [Sat, 11 Sep 2010 19:04:12 +0000 (15:04 -0400)]
* linux/ioctlent.sh: Search a few non-exported paths.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoClean up pid2tcb usage
Roland McGrath [Wed, 15 Sep 2010 01:59:20 +0000 (18:59 -0700)]
Clean up pid2tcb usage

* strace.c (pid2tcb): Always match pid.  Fail for argument <= 0.
[USE_PROCFS] (first_used_tcb): New function.
[USE_PROCFS] (trace): Use that instead of pid2tcb(0).

14 years agoTurn on more compiler warnings
Dmitry V. Levin [Thu, 9 Sep 2010 17:42:28 +0000 (17:42 +0000)]
Turn on more compiler warnings

* configure.ac: Enable gcc -Wwrite-strings.

14 years agoImport warnings.m4 from gnulib
Dmitry V. Levin [Thu, 9 Sep 2010 17:41:15 +0000 (17:41 +0000)]
Import warnings.m4 from gnulib

* m4/warnings.m4: Replace with warnings.m4 from gnulib.
* configure.ac: Use gl_WARN_ADD from new warnings.m4.
* Makefile.am (AM_CFLAGS): Update for new warnings.m4.

14 years agoSplit acinclude.m4
Dmitry V. Levin [Thu, 9 Sep 2010 17:36:36 +0000 (17:36 +0000)]
Split acinclude.m4

* Makefile.am (ACLOCAL_AMFLAGS): Add "-I m4".
* acinclude.m4: Remove.
* m4/includedir.m4: New file, with definition of AC_INCLUDEDIR from
acinclude.m4.
* m4/long_long.m4: New file, with definitions of AC_OFF_T_IS_LONG_LONG,
AC_RLIM_T_IS_LONG_LONG and AC_LITTLE_ENDIAN_LONG_LONG from acinclude.m4.
* m4/procfs.m4: New file, with definitions of AC_MP_PROCFS,
AC_POLLABLE_PROCFS and AC_STRUCT_PR_SYSCALL from acinclude.m4.
* m4/stat.m4: New file, with definition of AC_STAT64 from acinclude.m4.
* m4/statfs.m4: New file, with definition of AC_STATFS64 from
acinclude.m4.
* m4/warnings.m4: New file, with definition of AC_WARNFLAGS from
acinclude.m4.

14 years ago* process.c (sys_waitid): Remove unused variable.
Dmitry V. Levin [Thu, 9 Sep 2010 23:08:59 +0000 (23:08 +0000)]
* process.c (sys_waitid): Remove unused variable.

14 years agoFix const-correctness issues uncovered by gcc -Wwrite-strings
Dmitry V. Levin [Mon, 6 Sep 2010 22:08:24 +0000 (22:08 +0000)]
Fix const-correctness issues uncovered by gcc -Wwrite-strings

* defs.h (struct xlat): Add const qualifier to the field of
type "char *".
(set_sortby, qualify, printnum, printnum_int): Add const qualifier to
arguments of type "char *".
* count.c (set_sortby): Add const qualifier to the argument and
automatic variable of type "char *".
* desc.c (decode_select): Add const qualifier to automatic variables of
type "char *".
* ioctlsort.c (struct ioctlent): Add const qualifier to fields of
type "char *".
(main):  Add const qualifier to argv.
* process.c (printargv): Add const qualifier to the argument and
automatic variable of type "char *".
(printargc) Add const qualifier to argument of type "char *".
* signal.c (sprintsigmask, parse_sigset_t): Add const qualifier to
arguments of type "char *".
* strace.c (progname): Add const qualifier.
(detach): Add const qualifier to automatic variable of type "char *".
* stream.c (struct strbuf): Add const qualifier to the field of
type "char *".
* syscall.c (struct qual_options): Add const qualifier to fields of
type "char *".
(qual_syscall, qual_fault, qual_desc, lookup_class): Add const qualifier
to arguments of type "char *".
(qual_signal): Add const qualifier to the argument of type "char *",
avoid modification of constant argument.
(qualify): Likewise.
* util.c (printflags): Add const qualifier to automatic variable of
type "char *".
(printnum, printnum_int): Add const qualifier to arguments of
type "char *".

14 years agoFix printing clone flags
Wang Chao [Thu, 2 Sep 2010 07:08:59 +0000 (15:08 +0800)]
Fix printing clone flags

When we trace clone() syscall with only exit signal as clone
flags, strace would print an unnecessary OR operator.

* process.c (sys_clone): Fix this.

Signed-off-by: Wang Chao <wang.chao@cn.fujitsu.com>
14 years agoDrop nclone_detached and related flags
Wang Chao [Fri, 27 Aug 2010 09:43:16 +0000 (17:43 +0800)]
Drop nclone_detached and related flags

Remove nclone_detached since CLONE_DETACHED flag was no-op for a very
long time in kernel.

* defs.h (struct tcb): Remove nclone_detached field.
Remove TCB_CLONE_DETACHED flag.
* process.c: Remove CLONE_DETACHED flag.
(clone_flags): Remove CLONE_DETACHED entry.
(internal_fork, internal_wait): Remove code dealing with CLONE_DETACHED
flag and nclone_detached.
* strace.c (startup_attach, alloc_tcb, droptcb, handle_group_exit):
Likewise.

Signed-off-by: Wang Chao <wang.chao@cn.fujitsu.com>
14 years agoCorrect get/set_robust_list syscall numbers for powerpc
Neil Campbell [Thu, 5 Aug 2010 22:53:29 +0000 (23:53 +0100)]
Correct get/set_robust_list syscall numbers for powerpc

* linux/powerpc/syscallent.h: Swap positions of get_ and set_robust_list.

14 years agoHandle CLONE_PARENT flag
Wang Chao [Thu, 5 Aug 2010 06:58:37 +0000 (14:58 +0800)]
Handle CLONE_PARENT flag

* process.c (internal_fork): The parent of new cloned process is the
same of the calling process when CLONE_PARENT is set.

14 years agoFix error when judging if process has children
Wang Chao [Thu, 5 Aug 2010 06:40:45 +0000 (14:40 +0800)]
Fix error when judging if process has children

* process.c (internal_wait): Processes counted in tcp->nclone_threads
are tcp's threads, rather than tcp's children.

Signed-off-by: Wang Chao <wang.chao@cn.fujitsu.com>
14 years agoForbid using mutually exclusive options -D and -p together
Wang Chao [Thu, 5 Aug 2010 06:30:11 +0000 (14:30 +0800)]
Forbid using mutually exclusive options -D and -p together

If we use -D and -p option together to trace a multi-thread program, in
addition to the main thread, other threads could not be traced even if we
present -f option. Moreover, when executing 'strace -D -p <non-exist pid>',
strace could not terminate normally.

* strace.c (main): Check it.

Signed-off-by: Wang Chao <wang.chao@cn.fujitsu.com>
14 years agoUpdate Linux MIPS syscalls to match 2.6.35-rc6+
David Daney [Thu, 29 Jul 2010 22:51:14 +0000 (15:51 -0700)]
Update Linux MIPS syscalls to match 2.6.35-rc6+

* linux/mips/syscallent.h: Add and update 405 hooks.

14 years agoAdd support for the MicroBlaze architecture
Edgar E. Iglesias [Tue, 6 Jul 2010 12:21:07 +0000 (14:21 +0200)]
Add support for the MicroBlaze architecture

* configure.ac: Recognize MicroBlaze.
* linux/microblaze/syscallent.h: New file.
* Makefile.am (EXTRA_DIST): Add linux/microblaze/syscallent.h
* process.c (change_syscall, struct_user_offsets): Add MicroBlaze
support.
* signal.c (sys_sigreturn): Likewise.
* syscall.c (internal_syscall, get_scno, syscall_fixup, get_error,
syscall_enter): Likewise.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agolinux/sparc: add missing syscall declarations
Frederik Schüler [Wed, 28 Apr 2010 22:48:45 +0000 (00:48 +0200)]
linux/sparc: add missing syscall declarations

* linux/sparc/syscall.h: Sync with linux/syscall.h

Signed-off-by: Frederik Schüler <fs@debian.org>
14 years agoHandle biarch get/setrlimit
Andreas Schwab [Sat, 3 Jul 2010 21:17:28 +0000 (23:17 +0200)]
Handle biarch get/setrlimit

* resource.c (print_rlimit32) [POWERPC64 || X86_64]: Define.
(sys_getrlimit, sys_setrlimit) [POWERPC64 || X86_64]: Use it.

14 years agoAdd biarch support for powerpc64
Andreas Schwab [Mon, 12 Jul 2010 19:39:57 +0000 (21:39 +0200)]
Add biarch support for powerpc64

* acinclude.m4 (AC_LITTLE_ENDIAN_LONG_LONG): Use int instead of
long.
* configure.ac [$host_cpu = powerpc*]: Also define POWERPC64 if
$host_cpu = powerpc64.
* defs.h (SUPPORTED_PERSONALITIES, PERSONALITY0_WORDSIZE)
(PERSONALITY1_WORDSIZE) [POWERPC64]: Define.
* file.c: (struct stat_powerpc32, printstat_powerpc32) [POWERPC64]:
Define.
(printstat) [LINUX && POWERPC64]: Use printstat_powerpc32 in
32-bit personality.
(sys_newfstatat) [POWERPC64]: Handle personalities.
* signal.c (sys_sigreturn) [POWERPC64]: Likewise.
* util.c (printllval) [POWERPC64]: Likewise.
(printcall) [POWERPC64]: Use wider format for IP prefix.
* syscall.c (get_scno) [POWERPC64]: Check for 64/32 bit mode.
* linux/powerpc/errnoent1.h: New file.
* linux/powerpc/ioctlent1.h: New file.
* linux/powerpc/signalent1.h: New file.
* linux/powerpc/syscallent1.h: New file.

14 years agoBalance braces
Andreas Schwab [Fri, 9 Jul 2010 09:49:27 +0000 (11:49 +0200)]
Balance braces

* strace.c (proc_open): Avoid unbalanced braces.
(trace): Likewise.

14 years agoRemove extern declaration at file scope
Andreas Schwab [Sat, 3 Jul 2010 19:40:09 +0000 (21:40 +0200)]
Remove extern declaration at file scope

* defs.h (force_result): Declare.
* process.c (internal_wait): Don't declare force_result.

14 years agoDocument -C/-D
Andreas Schwab [Fri, 11 Jun 2010 13:49:36 +0000 (15:49 +0200)]
Document -C/-D

* strace.c (usage): Document -C.
* strace.1: Document -D.

14 years agoFix sourceforge download URL.
Roland McGrath [Wed, 14 Apr 2010 21:05:35 +0000 (14:05 -0700)]
Fix sourceforge download URL.

14 years agoM68K: Fix fetching syscall arguments
Andreas Schwab [Sat, 5 Jun 2010 19:50:30 +0000 (21:50 +0200)]
M68K: Fix fetching syscall arguments

* syscall.c (syscall_enter) [M68K]: Properly handle more than five
syscall arguments.

14 years agoDecode TLS syscalls on m68k
Andreas Schwab [Fri, 28 May 2010 20:28:51 +0000 (22:28 +0200)]
Decode TLS syscalls on m68k

* linux/m68k/syscallent.h: Add entries for get_thread_area,
set_thread_area, atomic_comxchg_32, atomic_barrier.
* linux/dummy.h (sys_get_thread_area, sys_set_thread_area) [M68K]:
Don't redefine.
* mem.c (sys_get_thread_area, sys_set_thread_area) [LINUX && M68K]: New.

14 years agoFix warning when compiling for m68k
Andreas Schwab [Fri, 28 May 2010 18:53:14 +0000 (20:53 +0200)]
Fix warning when compiling for m68k

* syscall.c (d0): Define as long.

14 years agoPrepare for 4.5.20 release v4.5.20
Dmitry V. Levin [Tue, 6 Apr 2010 23:46:43 +0000 (23:46 +0000)]
Prepare for 4.5.20 release

* NEWS: Update for 4.5.20 release.
* configure.ac: Version 4.5.20.
* debian/changelog: 4.5.20-1.
* strace.spec: 4.5.20-1.

14 years agoUpdate debian/* files for the upcoming release
Frederik Schüler [Tue, 13 Apr 2010 11:04:00 +0000 (13:04 +0200)]
Update debian/* files for the upcoming release

* debian/control: update standards-version to 3.8.4.
* debian/rules: allow parallel building.
* debian/rules: comment out verbose build, only needed for debugging.
* debian/rules: clean up clean: target, dh_clean does most of the work
  already.
* debian/rules: use *-stamp instead of stamp-*, so dh_clean can tidy
  up for us.

Signed-off-by: Frederik Schüler <fs@debian.org>
14 years agoFix s390 system call table list
Heiko Carstens [Tue, 13 Apr 2010 10:49:54 +0000 (12:49 +0200)]
Fix s390 system call table list

* linux/s390/syscallent.h: Add the missing entries for preadv and
pwritev to the system call table list.
* linux/s390x/syscallent.h: Likewise.

14 years agoUpdate linux/ioctlent.h
Dmitry V. Levin [Wed, 7 Apr 2010 11:22:28 +0000 (11:22 +0000)]
Update linux/ioctlent.h

* linux/ioctlent.sh: Search in asm-generic directory as well.
* linux/ioctlent.h: Regenerated.

14 years agoUpdate linux/*/syscallent.h files to match Linux kernel v2.6.33
Dmitry V. Levin [Mon, 5 Apr 2010 23:44:48 +0000 (23:44 +0000)]
Update linux/*/syscallent.h files to match Linux kernel v2.6.33

* linux/alpha/syscallent.h: Add 47 hooks.
* linux/arm/syscallent.h: Update hooks for pselect6, ppoll,
epoll_pwait.  Add 11 hooks.
* linux/bfin/syscallent.h: Update hooks for prctl, fallocate,
signalfd4, eventfd2, epoll_create1, dup3, pipe2, perf_event_open.
Hook up recvmmsg.
* linux/hppa/syscallent.h: Update hooks for signalfd4, eventfd2,
epoll_create1, dup3, pipe2, perf_event_open.
* linux/i386/syscallent.h: Fix syscall name for the kexec_load hook.
Add 5 hooks.
* linux/ia64/syscallent.h: Fix syscall name for the kexec_load hook.
Add 4 hooks.
* linux/m68k/syscallent.h: Add 50 hooks.
* linux/powerpc/syscallent.h: Fix hook for timerfd_create.  Fix
6 syscall names to match the kernel.  Use sys_semop to parse semop.
Add 14 hooks.
* linux/s390/syscallent.h: Fix syscall name for the kexec_load hook.
Add 14 hooks.
* linux/s390x/syscallent.h: Likewise.
* linux/sh/syscallent.h: Add 13 hooks.
* linux/sh64/syscallent.h: Add 15 hooks.
* linux/sparc/syscallent.h: Add 22 hooks.
* linux/x86_64/syscallent.h: Add 5 hooks.

14 years agoEnhance recvmmsg parser
Dmitry V. Levin [Mon, 29 Mar 2010 16:45:48 +0000 (20:45 +0400)]
Enhance recvmmsg parser

* net.c (sys_recvmmsg): Decode mmsghdr structure on exit from the
syscall.  Decode timespec structure both on entrance and on exit.

14 years agoDecode recvmmsg syscall
Andreas Schwab [Fri, 12 Feb 2010 20:39:12 +0000 (21:39 +0100)]
Decode recvmmsg syscall

* net.c (do_msghr): New function to print struct msghdr.
(printmsghdr): Use it.
(printmmsghdr, sys_recvmmsg): New.
* linux/syscall.h: Declare sys_recvmmsg.
(SYS_sub_recvmmsg): Define.
(SYS_socket_nsubcalls): Bump.
* linux/sparc/syscall.h: Likewise.
* linux/arm/syscallent.h: Add sys_recvmmsg.
* linux/bfin/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/m68k/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/ia64/syscallent.h: Adjust.

14 years ago* strace.1: Fix quoting of hyphens and formatting of strace options.
Dmitry V. Levin [Wed, 31 Mar 2010 17:26:49 +0000 (17:26 +0000)]
* strace.1: Fix quoting of hyphens and formatting of strace options.

14 years agoSplit trace_syscall() for better readability
Dmitry V. Levin [Mon, 29 Mar 2010 17:51:02 +0000 (17:51 +0000)]
Split trace_syscall() for better readability

* syscall.c (trace_syscall): Split into trace_syscall_exiting() and
trace_syscall_entering().

14 years agoImplement -C option to combine regular and -c output
Dmitry V. Levin [Sun, 28 Mar 2010 19:24:54 +0000 (19:24 +0000)]
Implement -C option to combine regular and -c output

* defs.h (cflag_t): New enum.
* strace.1: Document -C option.
* strace.c (cflag): Update type.
(main): Handle -C option.
(trace): Update use of cflag.
* count.c (count_syscall): Move clearing of TCB_INSYSCALL to ...
* syscall.c (trace_syscall): ... here.  Update use of cflag.
Based on patch by Adrien Kunysz.

14 years agoFix "make dist" regression introduced by commit v4.5.19-12-g5078770
Dmitry V. Levin [Wed, 7 Apr 2010 10:17:24 +0000 (10:17 +0000)]
Fix "make dist" regression introduced by commit v4.5.19-12-g5078770

* Makefile.am (EXTRA_DIST): Rename linux/syscallent.h to linux/i386/syscallent.h

14 years ago* desc.c (sys_epoll_pwait): Fix output formatting bug.
Dmitry V. Levin [Tue, 6 Apr 2010 23:54:18 +0000 (23:54 +0000)]
* desc.c (sys_epoll_pwait): Fix output formatting bug.

14 years ago* desc.c (decode_select): Fix potential stack buffer overflow.
Dmitry V. Levin [Tue, 6 Apr 2010 23:50:49 +0000 (23:50 +0000)]
* desc.c (decode_select): Fix potential stack buffer overflow.

14 years agoFix msgsnd indirect ipccall decoding
Dmitry V. Levin [Wed, 31 Mar 2010 22:22:01 +0000 (22:22 +0000)]
Fix msgsnd indirect ipccall decoding

This regression was introduced by commit v4.5.18-136-g783f5bc.
* ipc.c (tprint_msgsnd): Add and use "flags" argument.
(sys_msgsnd): Pass "flags" argument to tprint_msgsnd().
Patch by Anton Blanchard.

14 years agoHook up inotify_init1 open mode flags printer
Mark Wielaard [Sun, 21 Mar 2010 13:41:26 +0000 (14:41 +0100)]
Hook up inotify_init1 open mode flags printer

* file.c [LINUX] (sys_inotify_init1): New function.
* linux/syscall.h: Declare new sys_inotify_init1 handler.
* linux/bfin/syscallent.h: Hook up new handler.
* linux/hppa/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.

14 years agoAvoid spurious error when checking for linux/netlink.h
Andreas Schwab [Mon, 8 Mar 2010 15:07:52 +0000 (16:07 +0100)]
Avoid spurious error when checking for linux/netlink.h

* configure.ac: Include <asm/types.h> when checking for
linux/netlink.h.

14 years agoFix reporting signal mask by sigreturn on powerpc
Andreas Schwab [Mon, 22 Feb 2010 23:18:51 +0000 (00:18 +0100)]
Fix reporting signal mask by sigreturn on powerpc

* signal.c (sys_sigreturn) [POWERPC]: Skip dummy stack frame when
locating signal context.

14 years agoFix MIPS N32/N64 compile error
David Daney [Tue, 9 Feb 2010 21:22:30 +0000 (21:22 +0000)]
Fix MIPS N32/N64 compile error

* syscall.c [LINUX_MIPSN32 || LINUX_MIPSN64] (syscall_enter): Pass
tcp->pid to ptrace().

14 years agoAdd support for the TILE architecture
Chris Metcalf [Mon, 28 Dec 2009 15:00:15 +0000 (10:00 -0500)]
Add support for the TILE architecture

* configure.ac: Add TILE to the list of supported architectures.
* defs.h: Define TCB_WAITEXECVE for TILE.
* linux/tile/syscallent.h: New file.
* Makefile.am (EXTRA_DIST): Add linux/tile/syscallent.h
* process.c (change_syscall, struct_user_offsets): Add TILE support.
* syscall.c (get_scno, get_error, syscall_enter): Likewise.
* mem.c (mmap_flags, print_mmap): Add MAP_CACHE_xxx TILE extensions
support.
* signal.c (sigact_flags): Add SA_NOPTRACE.
(sys_sigreturn): Add TILE support.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
14 years agoRemove dead code
Dmitry V. Levin [Thu, 31 Dec 2009 22:50:49 +0000 (22:50 +0000)]
Remove dead code

* defs.h (tv_tv): Remove.
* net.c (sys_xsetsockaddr): Remove commented out dead code.
* process.c (setarg, sys_execv, sys_execve, struct_user_offsets):
Likewise.
* signal.c (sys_sigsuspend): Likewise.
* strace.c (reaper, trace): Likewise.
* stream.c (internal_stream_ioctl): Likewise.
* syscall.c (trace_syscall): Likewise.
* term.c (term_ioctl): Likewise.
* util.c (tv_tv, umoven, uload, getpc, fixvfork, setbpt, clearbpt):
Likewise.

14 years agoMerge Linux internal_clone() into internal_fork()
Dmitry V. Levin [Sat, 26 Dec 2009 17:55:24 +0000 (17:55 +0000)]
Merge Linux internal_clone() into internal_fork()

* defs.h (internal_clone): Remove.
* process.c (internal_clone): Merge into internal_fork().
(internal_fork) [!LINUX]: Remove dead code.
* syscall.c (internal_syscall): Replace internal_clone() with
internal_fork().

14 years ago* Makefile.am (INCLUDES): Remove redundant search directories.
Dmitry V. Levin [Mon, 25 Jan 2010 12:21:07 +0000 (12:21 +0000)]
* Makefile.am (INCLUDES): Remove redundant search directories.

14 years agoUpdate debian/* files
Frederik Schüler [Thu, 4 Feb 2010 20:14:56 +0000 (12:14 -0800)]
Update debian/* files

* debian/control: add sparc64 to the architectures list.
This closes Debian bug #560062
* Backport commit f0df31e71a58c6e79ba77c1a9d84b2f38d44bec7 to fix FTBFS.
This closes Debian bug #560516
* debian/control: Update standards-version to 3.8.3.
* debian/control: Lower package priority to optional, matching
the archive override.
* debian/control: add ${misc:Depends} to Depends: lines where
appropriate.
* debian/watch: new file, allows automatic tracking of new
upstream versions.
* debian/source/format: new file, adapt to debian source format "quilt"
* debian/rules: indentation cleanups; use dh_testroot and dh_prep
in clean target.

14 years agoFix spurious failure of AC_STAT64 test
Andreas Schwab [Mon, 25 Jan 2010 10:32:48 +0000 (11:32 +0100)]
Fix spurious failure of AC_STAT64 test

* acinclude.m4 (AC_STAT64): Include <sys/types.h> first.

14 years agoDon't kill the process when detaching
Andreas Schwab [Tue, 12 Jan 2010 10:16:32 +0000 (11:16 +0100)]
Don't kill the process when detaching

* strace.c (detach): Call clearbpt when TCB_BPTSET is set.

14 years agoDecode fifth argument of mremap syscall
Dmitry V. Levin [Thu, 24 Dec 2009 23:34:58 +0000 (23:34 +0000)]
Decode fifth argument of mremap syscall

* mem.c (sys_mremap): Decode fifth argument.
* linux/*/syscallent.h: Update the number of mremap syscall arguments.

14 years ago* mem.c (sys_mbind): Display first argument in hex
Chris Metcalf [Thu, 24 Dec 2009 23:19:35 +0000 (23:19 +0000)]
* mem.c (sys_mbind): Display first argument in hex

14 years ago* mem.c (mremap_flags): Add MREMAP_FIXED
Chris Metcalf [Thu, 24 Dec 2009 23:19:19 +0000 (23:19 +0000)]
* mem.c (mremap_flags): Add MREMAP_FIXED

14 years agoMove i386-specific files out of common linux dir
Mike Frysinger [Fri, 13 Nov 2009 16:46:34 +0000 (11:46 -0500)]
Move i386-specific files out of common linux dir

* linux/syscallent.h: Moved to ...
* linux/i386/syscallent.h: ... here.
* linux/ia64/syscallent.h: Update i386 syscallent.h include.
* linux/sparc/gen.pl: Likewise.
* linux/x86_64/syscallent1.h: Likewise.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoRemove support for pre-C89
Andreas Schwab [Tue, 27 Oct 2009 15:56:43 +0000 (16:56 +0100)]
Remove support for pre-C89

* defs.h: Remove references to __STDC__ and P macros.
* strace.c: Likewise.

14 years agoDecode more SOL_PACKET socket options
Dmitry V. Levin [Fri, 13 Nov 2009 12:51:04 +0000 (12:51 +0000)]
Decode more SOL_PACKET socket options

* net.c (sockpacketoptions): Add more PACKET_* entries.
(sys_getsockopt): Decode PACKET_STATISTICS.
(printsockopt): Decode PACKET_RX_RING and PACKET_TX_RING.
Patch by Gabor Gombas.

15 years agoIgnore errors if a thread is killed
Andreas Schwab [Wed, 11 Nov 2009 12:54:04 +0000 (13:54 +0100)]
Ignore errors if a thread is killed

* util.c (clearbpt): Ignore ESRCH error.

15 years agoFix handling of Linux systems without struct statfs64
Bernhard Reutner-Fischer [Wed, 14 Oct 2009 14:33:58 +0000 (16:33 +0200)]
Fix handling of Linux systems without struct statfs64

* acinclude.m4 (AC_STATFS64): New macro to check for struct statfs64.
* configure.ac: Call AC_STATFS64.
* file.c (printstatfs64, sys_statfs64, sys_fstatfs64): Compile only
  if struct statfs64 is available.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
15 years agoFix getsockopt decoding on architectures where sizeof(long) > sizeof(int)
Dmitry V. Levin [Fri, 6 Nov 2009 18:05:40 +0000 (18:05 +0000)]
Fix getsockopt decoding on architectures where sizeof(long) > sizeof(int)

* net.c (sys_getsockopt): Optimize output a bit.
Decode integer argument using printnum_int(), patch by Gabor Gombas.

15 years agoCheck umove() return code
Dmitry V. Levin [Tue, 3 Nov 2009 14:38:44 +0000 (14:38 +0000)]
Check umove() return code

* bjm.c (sys_query_module): Print input parameters when entering
syscall.  Fix handling of syscall error.  Handle unlikely umove()
failures.
* ipc.c (tprint_msgrcv): New function.  Move part of msgrcv parser code
here, add check umove() return code.
(sys_msgsnd): Print msqid parameter as int instead of long.
(sys_msgrcv): Likewise.  Use tprint_msgrcv().
* process.c (print_affinitylist): Check umove() return code.
* sock.c (sock_ioctl): Handle unlikely umove() failure in the
SIOCGIFCONF parser.

15 years agoFix check for linux/netlink.h on Linux 2.6.32-rc5+
Dmitry V. Levin [Tue, 3 Nov 2009 16:49:49 +0000 (16:49 +0000)]
Fix check for linux/netlink.h on Linux 2.6.32-rc5+

* configure.ac (AC_CHECK_HEADERS): In check for linux/netlink.h, include
sys/socket.h instead of linux/socket.h beforehand.

15 years agoDecode fallocate on PowerPC
Andreas Schwab [Wed, 4 Nov 2009 11:43:20 +0000 (12:43 +0100)]
Decode fallocate on PowerPC

* linux/powerpc/syscallent.h: Decode fallocate.

15 years agoFactor out printing of 64bit syscall argument
Andreas Schwab [Wed, 4 Nov 2009 16:08:34 +0000 (17:08 +0100)]
Factor out printing of 64bit syscall argument

* defs.h (ALIGN64): Remove.
(printllval): Declare.
* util.c (printllval): Define.
* file.c (sys_readahead): Use printllval.
(sys_lseek64): Likewise.
(sys_truncate64): Likewise.
(sys_ftruncate64): Likewise.
(sys_fadvise64): Likewise.
(sys_fadvise64_64): Likewise.
(sys_fallocate): Likewise.
* io.c (sys_pread): Likewise.
(sys_pwrite): Likewise.
(sys_pread64): Likewise.
(sys_pwrite64): Likewise.
* mem.c (sys_mmap64): Likewise.

15 years agoCorrect decoding of readahead and fadvice64(_64) on PowerPC
Andreas Schwab [Tue, 3 Nov 2009 14:21:14 +0000 (15:21 +0100)]
Correct decoding of readahead and fadvice64(_64) on PowerPC

* file.c (sys_readahead): Align 64bit argument.  Handle PowerPC64
like other 64bit architectures.
(sys_fadvise64): Likewise.
(sys_fadvise64_64): Handle PowerPC like ARM.
* linux/powerpc/syscallent.h (sys_readahead): Account for 64bit
argument alignment on PowerPC32.

15 years agoMaintain separate print column for each process
Andreas Schwab [Tue, 27 Oct 2009 15:27:13 +0000 (16:27 +0100)]
Maintain separate print column for each process

* defs.h (struct tcp): Add curcol.
* strace.c: (alloc_tcb): Initialize it.
(trace): Use curcol from current process and save it before
continuing.
(tprintf): Don't modify curcol on output error.

15 years ago* strace.spec: 4.5.19-1 release. v4.5.19
Roland McGrath [Wed, 21 Oct 2009 17:36:13 +0000 (10:36 -0700)]
* strace.spec: 4.5.19-1 release.

15 years ago* file.c (printstat64): Cleanup trailing whitespace.
Dmitry V. Levin [Wed, 21 Oct 2009 13:43:57 +0000 (13:43 +0000)]
* file.c (printstat64): Cleanup trailing whitespace.

15 years agoFix decoding of newfstatat syscall on x86-64
Andreas Schwab [Fri, 16 Oct 2009 09:37:13 +0000 (11:37 +0200)]
Fix decoding of newfstatat syscall on x86-64

* file.c (printstat64) [LINUX && X68_64]: If tracing a 64-bit
process redirect to printstat.
Fixes RH#529316 "Field values shown for "newfstatat" system
call are incorrect"

15 years ago* configure.ac (AC_CHECK_HEADERS): Remove asm/reg.h.
Dmitry V. Levin [Mon, 12 Oct 2009 15:48:29 +0000 (15:48 +0000)]
* configure.ac (AC_CHECK_HEADERS): Remove asm/reg.h.

15 years agosparc/linux: Rewrite to use asm/ptrace.h
Mike Frysinger [Mon, 12 Oct 2009 15:05:14 +0000 (11:05 -0400)]
sparc/linux: Rewrite to use asm/ptrace.h

The current sparc/linux code uses asm/reg.h, but recent Linux kernels
dropped that header completely.  So switch over to the ptrace headers
as those should stick around indefinitely as part of the ABI.

* defs.h [LINUXSPARC] (U_REG_G1, U_REG_O0, U_REG_O1): Define.
* process.c: Drop asm/regs.h include.
[SPARC || SPARC64] (change_syscall): Change struct regs to struct pt_regs.
* signal.c: Drop asm/regs.h include.
(m_siginfo_t): Unify [SPARC || SPARC64] and [MIPS].
[SPARC || SPARC64] (sys_sigreturn): Change struct regs to struct pt_regs.
* syscall.c: Drop asm/regs.h include.
[SPARC || SPARC64] (internal_syscall, get_scno, get_error, force_result,
syscall_enter): Change struct regs to struct pt_regs.
* util.c: Drop asm/regs.h include.
(_hack_syscall5, _ptrace): Delete.
[SPARC || SPARC64] (getpc, printcall, arg_setup_state): Change
struct regs to struct pt_regs.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
15 years ago* make-dist: Clean up.
Roland McGrath [Sun, 11 Oct 2009 23:30:57 +0000 (16:30 -0700)]
* make-dist: Clean up.

15 years ago* configure.ac: Use AC_CONFIG_AUX_DIR([.]).
Roland McGrath [Sun, 11 Oct 2009 23:25:29 +0000 (16:25 -0700)]
* configure.ac: Use AC_CONFIG_AUX_DIR([.]).

15 years ago* make-dist: New script for preparing release tarballs.
Dmitry V. Levin [Fri, 9 Oct 2009 23:15:16 +0000 (23:15 +0000)]
* make-dist: New script for preparing release tarballs.

15 years ago* git-set-file-times: Import from rsync.
Dmitry V. Levin [Fri, 9 Oct 2009 23:07:12 +0000 (23:07 +0000)]
* git-set-file-times: Import from rsync.

15 years ago* Makefile.am [MAINTAINER_MODE]: Define and export TAR_OPTIONS.
Dmitry V. Levin [Fri, 9 Oct 2009 22:10:09 +0000 (22:10 +0000)]
* Makefile.am [MAINTAINER_MODE]: Define and export TAR_OPTIONS.

15 years agoEnhance msgsnd() parser
Dmitry V. Levin [Thu, 8 Oct 2009 23:33:15 +0000 (23:33 +0000)]
Enhance msgsnd() parser

* ipc.c (tprint_msgsnd): New function.  Move msgsnd parser code here,
add check for umove() return code.
(sys_msgsnd): Use tprint_msgsnd().

15 years ago* NEWS: Update for 4.5.19 release.
Dmitry V. Levin [Thu, 8 Oct 2009 22:28:57 +0000 (22:28 +0000)]
* NEWS: Update for 4.5.19 release.

15 years agoEnhance semop()/semtimedop() sembuf parser
Dmitry V. Levin [Wed, 7 Oct 2009 22:14:00 +0000 (22:14 +0000)]
Enhance semop()/semtimedop() sembuf parser

* ipc.c (tprint_sembuf): New function. Move sembuf parser code here,
add abbrev() support.
(sys_semop, sys_semtimedop): Use tprint_sembuf().

15 years agoAdd pretty printing of sembuf argument to semop() and semtimedop()
Jakub Bogusz [Wed, 7 Oct 2009 20:25:10 +0000 (22:25 +0200)]
Add pretty printing of sembuf argument to semop() and semtimedop()

* ipc.c (semop_flags): New xlat structure.
(sys_semop, sys_semtimedop): Add pretty printing of sembuf argument.

15 years agoAdd support for Linux/no-mmu with vfork
Mike Frysinger [Thu, 8 Oct 2009 00:41:29 +0000 (20:41 -0400)]
Add support for Linux/no-mmu with vfork

* configure.ac (AC_CHECK_FUNCS): Add fork.
* strace.c (strace_vforked): Define.
(startup_child): Do not raise SIGSTOP if vforked.
(trace): Skip first exec when starting up after vforked.
* syscall.c [BFIN] (get_scno): Drop waitexec checks.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
15 years agoAvoid malloc(0) in getdents parsers
Mike Frysinger [Thu, 8 Oct 2009 00:41:56 +0000 (20:41 -0400)]
Avoid malloc(0) in getdents parsers

On end of directory, getdents returns 0.  This return value is used to
then try and do malloc(0), but on some systems this will always return
NULL.  Since the code won't read the pointer in question if len is 0,
then don't bother calling malloc(0) and set the pointer to NULL ourself.
* file.c (sys_getdents, sys_getdents64): Avoid malloc(0) call.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
15 years agoAdd sys_nanosleep() prototype for sparc
Mike Frysinger [Wed, 7 Oct 2009 19:52:20 +0000 (15:52 -0400)]
Add sys_nanosleep() prototype for sparc

* linux/sparc/syscall.h (sys_nanosleep): New prototype.
Reported by Frederik Schüler.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
15 years agoSilence compiler warnings about implicit cast from pointer to integer
Mike Frysinger [Wed, 7 Oct 2009 05:13:39 +0000 (01:13 -0400)]
Silence compiler warnings about implicit cast from pointer to integer

* util.c (do_ptrace): Cast ptrace() 4th arg to long.
(ptrace_restart): Drop void* cast on ptrace() 4th arg.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
15 years agoIgnore .gdb files from FLAT toolchains
Mike Frysinger [Wed, 7 Oct 2009 05:08:46 +0000 (01:08 -0400)]
Ignore .gdb files from FLAT toolchains

* .gitignore: Add /*.gdb.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
15 years ago* configure.ac (AC_CHECK_FUNCS): Sort and expand.
Mike Frysinger [Wed, 7 Oct 2009 05:05:12 +0000 (01:05 -0400)]
* configure.ac (AC_CHECK_FUNCS): Sort and expand.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
15 years agoBlackfin: Update ioctl/syscall lists
Mike Frysinger [Wed, 7 Oct 2009 05:05:11 +0000 (01:05 -0400)]
Blackfin: Update ioctl/syscall lists

* linux/bfin/ioctlent.h: Sync list with latest kernel sources.
* linux/bfin/syscallent.h: Likewise.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
15 years agoioctlsort: Check ppc hosts too
Mike Frysinger [Wed, 7 Oct 2009 05:05:10 +0000 (01:05 -0400)]
ioctlsort: Check ppc hosts too

* linux/ioctlsort.c: Check for __powerpc__.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
15 years agoFix build on ia64
Andreas Schwab [Wed, 7 Oct 2009 14:00:31 +0000 (16:00 +0200)]
Fix build on ia64

* linux/ia64/syscallent.h: Update for addition of accept4 syscall
in ../syscallent.h.

15 years ago* strace.spec (%doc): Add ChangeLog-CVS.
Roland McGrath [Wed, 7 Oct 2009 01:03:25 +0000 (18:03 -0700)]
* strace.spec (%doc): Add ChangeLog-CVS.

15 years ago* Makefile.am (srpm): New phony target.
Roland McGrath [Wed, 7 Oct 2009 00:46:56 +0000 (17:46 -0700)]
* Makefile.am (srpm): New phony target.

15 years ago* Makefile.am (EXTRA_DIST): Add ChangeLog.
Roland McGrath [Wed, 7 Oct 2009 00:41:02 +0000 (17:41 -0700)]
* Makefile.am (EXTRA_DIST): Add ChangeLog.

($(srcdir)/ChangeLog): New target, replaces gen-changelog phony target.
Put it inside [MAINTAINER_MODE].

15 years ago* NEWS: Update for 4.5.19 release.
Dmitry V. Levin [Tue, 6 Oct 2009 10:40:17 +0000 (10:40 +0000)]
* NEWS: Update for 4.5.19 release.

15 years agoPrepare debian/* files for release
Frederik Schüler [Mon, 5 Oct 2009 20:50:07 +0000 (20:50 +0000)]
Prepare debian/* files for release

* debian/rules: Do not ship ChangeLog anymore.
* debian/control: Update to Debian standards version 3.8.1, and remove
Roland from the Maintainers list.  This closes Debian bug #521458.
* debian/changelog: Document changes and prepare for release.

15 years ago* defs.h [HPPA]: Lower MAX_ARGS from 32 to 6.
Dmitry V. Levin [Mon, 5 Oct 2009 23:32:39 +0000 (23:32 +0000)]
* defs.h [HPPA]: Lower MAX_ARGS from 32 to 6.