]> granicus.if.org Git - strace/log
strace
9 years agotests/ppoll: replace SIGABRT with SIGHUP
Dmitry V. Levin [Sat, 1 Aug 2015 08:55:32 +0000 (08:55 +0000)]
tests/ppoll: replace SIGABRT with SIGHUP

Use SIGHUP instead of SIGABRT, the number of the former
is more portable across architectures.

* tests/ppoll.c (test2): Replace SIGABRT with SIGHUP.
* tests/ppoll.expected: Update regexp.
* tests/ppoll-v.expected: Likewise.

9 years agodecode_poll_exiting: reserve more space in output buffer
Dmitry V. Levin [Sat, 1 Aug 2015 08:34:57 +0000 (08:34 +0000)]
decode_poll_exiting: reserve more space in output buffer

* poll.c (decode_poll_exiting): Reserve more space in output buffer.

9 years agoCleanup poll/ppoll decoders
Dmitry V. Levin [Thu, 30 Jul 2015 19:46:11 +0000 (19:46 +0000)]
Cleanup poll/ppoll decoders

* poll.c (decode_poll): Split into print_pollfd, decode_poll_entering,
and decode_poll_exiting.
(sys_poll, sys_ppoll): Update callers.
* tests/ppoll.c: New file.
* tests/ppoll.expected: Likewise.
* tests/ppoll-v.expected: Likewise.
* tests/ppoll.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add ppoll.
(TESTS): Add ppoll.test.
(EXTRA_DIST): Add ppoll.expected and ppoll-v.expected.
* tests/.gitignore: Add ppoll.

9 years agopoll: print timeout argument as int
Dmitry V. Levin [Thu, 30 Jul 2015 16:54:31 +0000 (16:54 +0000)]
poll: print timeout argument as int

* poll.c (sys_poll): Explicitly cast timeout argument to int.

9 years agostream.c: move poll and ppoll parsers to a separate file
Dmitry V. Levin [Thu, 30 Jul 2015 16:49:42 +0000 (16:49 +0000)]
stream.c: move poll and ppoll parsers to a separate file

* poll.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* stream.c (decode_poll, sys_poll, sys_ppoll): Move to poll.c.

9 years agoAssume that <poll.h> is available
Dmitry V. Levin [Thu, 30 Jul 2015 16:23:58 +0000 (16:23 +0000)]
Assume that <poll.h> is available

* configure.ac (AC_CHECK_HEADERS): Remove poll.h and sys/poll.h.
* pathtrace.c: Include <poll.h> unconditionally.
* stream.c: Likewise.
[HAVE_SYS_POLL_H]: Compile unconditionally.
[!HAVE_SYS_POLL_H]: Remove.

9 years agotests: add oldselect.test
Dmitry V. Levin [Thu, 30 Jul 2015 08:24:32 +0000 (08:24 +0000)]
tests: add oldselect.test

* tests/oldselect.c: New file.
* tests/oldselect.expected: Likewise.
* tests/oldselect.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add oldselect.
(TESTS): Add oldselect.test.
(EXTRA_DIST): Add oldselect.expected.
* tests/.gitignore: Add oldselect.

9 years agoFix oldselect decoding on 64-bit architectures
Elvira Khabirova [Wed, 29 Jul 2015 18:38:54 +0000 (21:38 +0300)]
Fix oldselect decoding on 64-bit architectures

As struct sel_arg_struct is an array of 32-bit values,
fetch it using an intermediate array on 64-bit architectures.

* desc.c (sys_oldselect): Rename args to long_args.
[SIZEOF_LONG == 4] Alias oldselect_args to long_args.
[SIZEOF_LONG != 4] Introduce oldselect_args to fetch oldselect args.
* linux/sh64/syscallent.h (oldselect): Remove.

9 years agonet.c: use printaddr
Dmitry V. Levin [Thu, 30 Jul 2015 13:53:42 +0000 (13:53 +0000)]
net.c: use printaddr

* net.c (printsock, sys_recvfrom): Use printaddr.

9 years agonet.c: recvfrom fixes
Denys Vlasenko [Thu, 30 Jul 2015 11:29:20 +0000 (13:29 +0200)]
net.c: recvfrom fixes

This change fixes these three problems (before/after is shown):

On interrupted syscall, flags are not decoded:

    -recvfrom(3, 0x7fff0a41e306, 10, 2, 0, 0) = ? ERESTARTSYS
    +recvfrom(3, 0x7fff0a41e306, 10, MSG_PEEK, 0, 0) = ? ERESTARTSYS

If peer address is unavalable (example: anon sockets from socketpair()),
kernel returns socklen of 0, but we ignore that and show bogus sockaddr data:

    -recvfrom(3, "123456789\0", 10, MSG_PEEK, {sa_family=0x7777 /* AF_??? */, sa_data="wwwwwwwwwwwwww"}, [0]) = 10
    +recvfrom(3, "123456789\0", 10, MSG_PEEK, 0x7ffde6edf760, [0]) = 10

SYS_FUNC(recvfrom) passes address of fromlen, not fromlen, to printsock():

    -               printsock(tcp, tcp->u_arg[4], tcp->u_arg[5]);
    +               printsock(tcp, tcp->u_arg[4], fromlen);

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
9 years agoprctl: decode Android-specific PR_SET_VMA
Elliott Hughes [Wed, 29 Jul 2015 22:49:38 +0000 (22:49 +0000)]
prctl: decode Android-specific PR_SET_VMA

Android kernels have a prctl to name VMAs.

* prctl.c (sys_prctl) [__ANDROID__]: Decode PR_SET_VMA.

9 years agomips: fix stub files
Dmitry V. Levin [Wed, 29 Jul 2015 21:32:35 +0000 (21:32 +0000)]
mips: fix stub files

This complements commit 140ecf876686d49085c6eb3a2306e2ea6ea641bc.

* linux/mips/genstub.sh: Output SEN(printargs) instead of printargs.

Reported-by: Elliott Hughes <enh@google.com>
9 years agotests/bpf: fix build with incompatibly old linux/bpf.h and/or gcc
Dmitry V. Levin [Wed, 29 Jul 2015 16:27:16 +0000 (16:27 +0000)]
tests/bpf: fix build with incompatibly old linux/bpf.h and/or gcc

* configure.ac: Check how union bpf_attr.log_buf initialization works.
* tests/bpf.c: Check for HAVE_UNION_BPF_ATTR_LOG_BUF.

9 years agoImplement sched_getattr and sched_setattr syscalls decoding
Dmitry V. Levin [Wed, 29 Jul 2015 07:59:56 +0000 (07:59 +0000)]
Implement sched_getattr and sched_setattr syscalls decoding

* xlat/sched_flags.in: New file.
* sched.c: Include "xlat/sched_flags.h".
(print_sched_attr, sys_sched_setattr, sys_sched_getattr): New functions.
* linux/dummy.h (sys_sched_getattr, sys_sched_setattr): Remove.
* tests/sched_xetattr.c: New file.
* tests/sched_xetattr.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add sched_xetattr.
(TESTS): Add sched_xetattr.test.
* tests/.gitignore: Add sched_xetattr.

9 years agoImplement memfd_create syscall decoding
Dmitry V. Levin [Tue, 28 Jul 2015 23:03:41 +0000 (23:03 +0000)]
Implement memfd_create syscall decoding

* memfd_create.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* linux/dummy.h (sys_memfd_create): Remove.
* pathtrace.c (pathtrace_match): Add SEN_memfd_create.
* xlat/memfd_create_flags.in: New file.
* tests/memfd_create.c: New file.
* tests/memfd_create.expected: Likewise.
* tests/memfd_create.test: New test.
* tests/Makefile.am: (check_PROGRAMS): Add memfd_create.
(TESTS): Add memfd_create.test.
(EXTRA_DIST): Add memfd_create.expected.
* tests/.gitignore: Add memfd_create.

9 years agoFix builds where HAVE_MQUEUE_H isn't defined
Elliott Hughes [Tue, 28 Jul 2015 22:39:12 +0000 (22:39 +0000)]
Fix builds where HAVE_MQUEUE_H isn't defined

Android doesn't have <mqueue.h>.

* ipc.c (sys_mq_open) [!HAVE_MQUEUE_H]: Fix printaddr invocation.

9 years agotests/restart_syscall: skip if nanosleep looks uninterrupted
Dmitry V. Levin [Mon, 27 Jul 2015 12:34:58 +0000 (12:34 +0000)]
tests/restart_syscall: skip if nanosleep looks uninterrupted

* tests/restart_syscall.test: Skip if restart_syscall is not detected
and nanosleep syscall looks uninterrupted.

9 years agoImplement execveat syscall decoding
Dmitry V. Levin [Sun, 26 Jul 2015 11:06:53 +0000 (11:06 +0000)]
Implement execveat syscall decoding

* execve.c (decode_execve): New function.
(sys_execve): Use it.
(sys_execveat): New function.
* linux/dummy.h (sys_execveat): Remove.
* tests/execveat.c: New file.
* tests/execveat.expected: Likewise.
* tests/execveat-v.expected: Likewise.
* tests/execveat.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add execveat.
(TESTS): Add execveat.test.
(EXTRA_DIST): Add execveat.expected and execveat-v.expected.
* tests/.gitignore: Add execveat.

9 years agoexecve: fix support of personalities with different word size
Dmitry V. Levin [Mon, 27 Jul 2015 10:02:33 +0000 (10:02 +0000)]
execve: fix support of personalities with different word size

* execve.c (printargc): Do not assume that host and target pointers have
the same size.
* tests/execve.c: New file.
* tests/execve.expected: Likewise.
* tests/execve-v.expected: Likewise.
* tests/execve.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add execve.
(TESTS): Add execve.test.
(EXTRA_DIST): Add execve.expected and execve-v.expected.
* tests/.gitignore: Add execve.

9 years agoImplement bpf syscall decoding
Dmitry V. Levin [Sat, 25 Jul 2015 23:55:51 +0000 (23:55 +0000)]
Implement bpf syscall decoding

* bpf.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* configure.ac (AC_CHECK_HEADERS): Add linux/bpf.h.
* linux/dummy.h (sys_bpf): Remove.
* pathtrace.c (pathtrace_match): Add SEN_bpf.
* xlat/bpf_commands.in: New file.
* xlat/bpf_map_types.in: New file.
* xlat/bpf_map_update_elem_flags.in: New file.
* xlat/bpf_prog_types.in: New file.
* tests/bpf.c: New file.
* tests/bpf.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add bpf.
(TESTS): Add bpf.test.
* tests/.gitignore: Add bpf.

9 years agoprctl: fix decoding of unrecognized commands
Dmitry V. Levin [Sat, 25 Jul 2015 09:43:01 +0000 (09:43 +0000)]
prctl: fix decoding of unrecognized commands

The use of printargs introduced by commit v4.10-179-g210a6b6 is wrong:
when the first argument is already printed, printargs cannot be called.

* prctl.c (print_prctl_args): New function.
(sys_prctl): Use it.

9 years agoMacroize -m32/-mx32 configure checks
Dmitry V. Levin [Thu, 23 Jul 2015 11:19:47 +0000 (11:19 +0000)]
Macroize -m32/-mx32 configure checks

Prepare for additional configure checks that would be needed
for new multiple personalities support.

* m4/mpers.m4: New file.
* configure.ac: Use it.

9 years agotests/uid: import uid overflow check from tests/uid16
Dmitry V. Levin [Wed, 22 Jul 2015 19:31:54 +0000 (19:31 +0000)]
tests/uid: import uid overflow check from tests/uid16

* tests/uid.c (main): Skip if the uid returned by getuid matches
/proc/sys/kernel/overflowuid.

9 years agosh64: fix inotify_{add,rm}_watch syscall entries
Dmitry V. Levin [Tue, 21 Jul 2015 16:34:25 +0000 (16:34 +0000)]
sh64: fix inotify_{add,rm}_watch syscall entries

* linux/sh64/syscallent.h (inotify_add_watch, inotify_rm_watch):
Set sys_func.

9 years agomicroblaze: fix several syscall entries
Dmitry V. Levin [Tue, 21 Jul 2015 16:33:00 +0000 (16:33 +0000)]
microblaze: fix several syscall entries

* linux/microblaze/syscallent.h (signalfd4, eventfd2, epoll_create1,
dup3, pipe2, inotify_init1, recvmmsg): Set sys_func.

9 years agohppa: fix several syscall entries
Dmitry V. Levin [Tue, 21 Jul 2015 16:30:19 +0000 (16:30 +0000)]
hppa: fix several syscall entries

* linux/hppa/syscallent.h (remap_file_pages, mq_open, mq_unlink,
mq_timedsend, mq_timedreceive, mq_notify, mq_getsetattr,
clock_nanosleep, signalfd, timerfd): Set sys_func.

9 years agoia64: fix getpagesize syscall entry
Dmitry V. Levin [Tue, 21 Jul 2015 16:29:26 +0000 (16:29 +0000)]
ia64: fix getpagesize syscall entry

* linux/ia64/syscallent.h (getpagesize): Fux nargs.

9 years agoavr32: fix fstatat64 syscall entry
Dmitry V. Levin [Tue, 21 Jul 2015 16:28:48 +0000 (16:28 +0000)]
avr32: fix fstatat64 syscall entry

* linux/avr32/syscallent.h (fstatat64): Set sys_func.

9 years agoalpha: fix 2 dummy osf syscall entries
Dmitry V. Levin [Tue, 21 Jul 2015 16:26:51 +0000 (16:26 +0000)]
alpha: fix 2 dummy osf syscall entries

* linux/alpha/syscallent.h (osf_set_program_attributes): Fix nargs.
(osf_sigstack): Fix nargs and sys_name.

9 years agoalpha, arm, ia64, mips, sh64: fix semop syscall entries
Dmitry V. Levin [Tue, 21 Jul 2015 16:04:23 +0000 (16:04 +0000)]
alpha, arm, ia64, mips, sh64: fix semop syscall entries

* linux/alpha/syscallent.h (semop): Fix nargs, set sys_func.
* linux/ia64/syscallent.h (semop): Set sys_func.
* linux/mips/syscallent-n32.h (semop): Likewise.
* linux/mips/syscallent-n64.h (semop): Likewise.
* linux/arm/syscallent.h (semop): Fix nargs.
* linux/sh64/syscallent.h (semop): Likewise.

9 years agom68k: fix getpagesize decoding
Dmitry V. Levin [Tue, 21 Jul 2015 15:55:09 +0000 (15:55 +0000)]
m68k: fix getpagesize decoding

* linux/m68k/syscallent.h (getpagesize): Set sys_func.
* mem.c [M68K] (sys_getpagesize): Define.

9 years agotests/ip_mreq: skip if basic setsockopt operations fail
Dmitry V. Levin [Tue, 21 Jul 2015 10:36:03 +0000 (10:36 +0000)]
tests/ip_mreq: skip if basic setsockopt operations fail

* tests/ip_mreq.c (main): Return 77 if basic
IP_ADD_MEMBERSHIP/IP_DROP_MEMBERSHIP options cannot be set.

9 years agotests: use -lpthread instead of -pthread
Dmitry V. Levin [Tue, 21 Jul 2015 10:17:33 +0000 (10:17 +0000)]
tests: use -lpthread instead of -pthread

On some obscure systems, -lpthread is more likely to work than -pthread.

* tests/Makefile.am (filter_unavailable_LDFLAGS): Rename to
filter_unavailable_LDADD and change to -lpthread.

9 years agomips o32: fix utimensat syscall entry
Dmitry V. Levin [Tue, 21 Jul 2015 10:08:42 +0000 (10:08 +0000)]
mips o32: fix utimensat syscall entry

* linux/mips/syscallent-o32.h (utimensat): set sys_flags and sys_func.

9 years agolinux/mips/syscallent-compat.h: use designated initializers
Dmitry V. Levin [Tue, 21 Jul 2015 09:55:42 +0000 (09:55 +0000)]
linux/mips/syscallent-compat.h: use designated initializers

Change linux/mips/syscallent-compat.h to use designated initializers
like normal syscallent.h files.

* linux/mips/syscallent-compat.h: Use designated initializers.

9 years agolinux/mips/syscallent-compat.h: fix initalization of empty entries
Dmitry V. Levin [Tue, 21 Jul 2015 09:45:00 +0000 (09:45 +0000)]
linux/mips/syscallent-compat.h: fix initalization of empty entries

This complements commit 140ecf876686d49085c6eb3a2306e2ea6ea641bc.

* linux/mips/syscallent-compat.h: Fix initalization of empty entries.

9 years agoRemove unused parsers of getmsg and putmsg
Dmitry V. Levin [Mon, 20 Jul 2015 21:37:24 +0000 (21:37 +0000)]
Remove unused parsers of getmsg and putmsg

* stream.c [SPARC || SPARC64] (sys_putmsg, sys_getmsg): Remove.
Stop including "xlat/msgflags.h".
* xlat/msgflags.in: Remove.

9 years agosigreturn: make use of RVAL_DECODED
Dmitry V. Levin [Mon, 20 Jul 2015 21:33:09 +0000 (21:33 +0000)]
sigreturn: make use of RVAL_DECODED

* sigreturn.c (arch_sigreturn): New function.
(sys_sigreturn): Use it.  Return RVAL_DECODED.
* linux/alpha/arch_sigreturn.c: Update.
* linux/crisv10/arch_sigreturn.c: Likewise.
* linux/m68k/arch_sigreturn.c: Likewise.
* linux/microblaze/arch_sigreturn.c: Likewise.
* linux/x86_64/arch_sigreturn.c: Likewise.

9 years agoor1k_atomic.c: make use of RVAL_DECODED
Dmitry V. Levin [Mon, 20 Jul 2015 21:18:14 +0000 (21:18 +0000)]
or1k_atomic.c: make use of RVAL_DECODED

* or1k_atomic.c (sys_or1k_atomic): Update for RVAL_DECODED.

9 years agoUpdate openat parser for the RVAL_DECODED change
Dmitry V. Levin [Fri, 17 Jul 2015 22:03:29 +0000 (22:03 +0000)]
Update openat parser for the RVAL_DECODED change

* open.c (sys_openat): Update for RVAL_DECODED.

9 years agobjm.c: make use of RVAL_DECODED
Dmitry V. Levin [Mon, 20 Jul 2015 19:35:42 +0000 (19:35 +0000)]
bjm.c: make use of RVAL_DECODED

* bjm.c (sys_create_module, sys_delete_module, sys_init_module,
sys_finit_module): Update for RVAL_DECODED.

9 years agoaccess.c: make use of RVAL_DECODED
Dmitry V. Levin [Mon, 20 Jul 2015 19:27:51 +0000 (19:27 +0000)]
access.c: make use of RVAL_DECODED

* access.c (decode_access, sys_faccessat): Update for RVAL_DECODED.

9 years agoaffinity.c: make use of RVAL_DECODED
Dmitry V. Levin [Mon, 20 Jul 2015 19:24:43 +0000 (19:24 +0000)]
affinity.c: make use of RVAL_DECODED

* affinity.c (sys_sched_setaffinity): Update for RVAL_DECODED.

9 years agoaffinity.c: use printaddr and umove_or_printaddr
Dmitry V. Levin [Mon, 20 Jul 2015 19:22:10 +0000 (19:22 +0000)]
affinity.c: use printaddr and umove_or_printaddr

* affinity.c (print_affinitylist): Use printaddr and umove_or_printaddr.
(sys_sched_getaffinity): Remove redundant u_rval check.

9 years agoaio.c: enhance io_* syscalls decoding
Dmitry V. Levin [Mon, 20 Jul 2015 18:40:46 +0000 (18:40 +0000)]
aio.c: enhance io_* syscalls decoding

* aio.c (sys_io_setup): Use printnum_int64 and printnum_long.
(sys_io_destroy, sys_io_submit): Update for RVAL_DECODED.
(sys_io_submit): Use umove_or_printaddr and printaddr.
Enclose iocb array in square brackets.
Change to traditional structure output format.
(print_io_event): New function.
(sys_io_cancel, sys_io_getevents): Use it.
(sys_io_cancel): Use umove_or_printaddr and printaddr.
(sys_io_getevents): Use printaddr.

9 years agocacheflush.c: make use of RVAL_DECODED
Dmitry V. Levin [Mon, 20 Jul 2015 18:05:21 +0000 (18:05 +0000)]
cacheflush.c: make use of RVAL_DECODED

* cacheflush.c (sys_cacheflush): Update for RVAL_DECODED.

9 years agocacheflush.c: use printaddr
Dmitry V. Levin [Mon, 20 Jul 2015 17:57:37 +0000 (17:57 +0000)]
cacheflush.c: use printaddr

* cacheflush.c (sys_cacheflush): Use printaddr.

9 years agocapability.c: make use of RVAL_DECODED
Dmitry V. Levin [Mon, 20 Jul 2015 17:54:02 +0000 (17:54 +0000)]
capability.c: make use of RVAL_DECODED

* capability.c (sys_capset): Update for RVAL_DECODED.

9 years agocapability.c: use printaddr and umove_or_printaddr
Dmitry V. Levin [Mon, 20 Jul 2015 17:50:56 +0000 (17:50 +0000)]
capability.c: use printaddr and umove_or_printaddr

* capability.c (get_cap_header): Use printaddr.
(print_cap_data): Use printaddr and umove_or_printaddr.

9 years agochdir.c: make use of RVAL_DECODED
Dmitry V. Levin [Mon, 20 Jul 2015 17:46:03 +0000 (17:46 +0000)]
chdir.c: make use of RVAL_DECODED

* chdir.c (sys_chdir): Update for RVAL_DECODED.

9 years agochmod.c: make use of RVAL_DECODED
Dmitry V. Levin [Mon, 20 Jul 2015 17:30:38 +0000 (17:30 +0000)]
chmod.c: make use of RVAL_DECODED

* chmod.c (decode_chmod): Change to return void.
(sys_chmod, sys_fchmodat): Update callers.  Update for RVAL_DECODED.
(sys_fchmod): Update for RVAL_DECODED.

9 years agoclone.c: make use of RVAL_DECODED
Dmitry V. Levin [Mon, 20 Jul 2015 17:16:56 +0000 (17:16 +0000)]
clone.c: make use of RVAL_DECODED

* clone.c (sys_setns, sys_unshare, sys_fork): Update for RVAL_DECODED.

9 years agoAlias sys_epoll_create to printargs_ld
Dmitry V. Levin [Mon, 20 Jul 2015 17:03:42 +0000 (17:03 +0000)]
Alias sys_epoll_create to printargs_ld

* desc.c (sys_epoll_create): Remove.
* linux/dummy.h (sys_epoll_create): Alias to printargs_ld.

9 years agodesc.c: make use of RVAL_DECODED
Dmitry V. Levin [Mon, 20 Jul 2015 16:59:50 +0000 (16:59 +0000)]
desc.c: make use of RVAL_DECODED

* desc.c (sys_flock, sys_close, sys_dup, do_dup2, sys_epoll_create1,
sys_epoll_ctl, do_eventfd, sys_perf_event_open): Update
for RVAL_DECODED.

9 years agodesc.c: do not use xmalloc, use umove_or_printaddr and printaddr
Dmitry V. Levin [Mon, 20 Jul 2015 16:44:51 +0000 (16:44 +0000)]
desc.c: do not use xmalloc, use umove_or_printaddr and printaddr

* desc.c (printflock64, printflock): Use umove_or_printaddr.
(decode_select): Do not use xmalloc.  Use umoven_or_printaddr
and printaddr.
(sys_oldselect): Use printaddr.
(sys_epoll_ctl): Use umoven_or_printaddr and printaddr.
(print_epoll_event_array): New function.
(sys_epoll_wait_common): Use it.
(sys_pselect6): Use umove_or_printaddr.
(sys_eventfd2): Use printaddr.

9 years agoxlat/epollctls.in: add default values
Dmitry V. Levin [Mon, 20 Jul 2015 16:43:21 +0000 (16:43 +0000)]
xlat/epollctls.in: add default values

* xlat/epollctls.in (EPOLL_CTL_ADD, EPOLL_CTL_DEL, EPOLL_CTL_MOD): Add
default values.

9 years agodirent.c: do not use xmalloc
Dmitry V. Levin [Mon, 20 Jul 2015 15:42:22 +0000 (15:42 +0000)]
dirent.c: do not use xmalloc

* dirent.c (print_old_dirent): Use umove_or_printaddr.
(sys_readdir): Use printaddr.
(sys_getdents, sys_getdents64): Do not use xmalloc for dirents,
treat malloc failure the same way as umoven failure.  Use printaddr.

9 years agoexecve.c: make use of RVAL_DECODED
Dmitry V. Levin [Mon, 20 Jul 2015 15:20:46 +0000 (15:20 +0000)]
execve.c: make use of RVAL_DECODED

* execve.c (sys_execve, sys_execv): Update for RVAL_DECODED.

9 years agoexecve.c: use printaddr and umove_or_printaddr
Dmitry V. Levin [Mon, 20 Jul 2015 15:17:24 +0000 (15:17 +0000)]
execve.c: use printaddr and umove_or_printaddr

* execve.c (printargv): Use umoven_or_printaddr.
(sys_execve, sys_execv): Use printaddr.

9 years agofadvise.c: make use of RVAL_DECODED
Dmitry V. Levin [Mon, 20 Jul 2015 13:55:47 +0000 (13:55 +0000)]
fadvise.c: make use of RVAL_DECODED

* fadvise.c (sys_fadvise64, sys_fadvise64_64): Update for RVAL_DECODED.

9 years agofallocate.c: make use of RVAL_DECODED
Dmitry V. Levin [Mon, 20 Jul 2015 13:53:38 +0000 (13:53 +0000)]
fallocate.c: make use of RVAL_DECODED

* fallocate.c (sys_fallocate): Update for RVAL_DECODED.

9 years agofanotify.c: make use of RVAL_DECODED
Dmitry V. Levin [Mon, 20 Jul 2015 13:58:09 +0000 (13:58 +0000)]
fanotify.c: make use of RVAL_DECODED

* fanotify.c (sys_fanotify_init, sys_fanotify_mark): Update
for RVAL_DECODED.

9 years agofchownat.c: make use of RVAL_DECODED
Dmitry V. Levin [Mon, 20 Jul 2015 13:50:55 +0000 (13:50 +0000)]
fchownat.c: make use of RVAL_DECODED

* fchownat.c (sys_fchownat): Update for RVAL_DECODED.

9 years agofile.c: use umove_or_printaddr
Dmitry V. Levin [Mon, 20 Jul 2015 12:09:44 +0000 (12:09 +0000)]
file.c: use umove_or_printaddr

* file.c (printstat32, printstatsol): Remove.
(printstat, printstat64, printoldstat): Use umove_or_printaddr.

9 years agofutex.c: enhance futex syscall decoding
Dmitry V. Levin [Mon, 20 Jul 2015 13:15:51 +0000 (13:15 +0000)]
futex.c: enhance futex syscall decoding

* futex.c (sys_futex): Use switch statement.  Use printaddr.
Print uint32_t syscall arguments using %u format.
Update for RVAL_DECODED.

9 years agoget_robust_list.c: use printnum_long
Dmitry V. Levin [Mon, 20 Jul 2015 11:40:43 +0000 (11:40 +0000)]
get_robust_list.c: use printnum_long

* get_robust_list.c (sys_get_robust_list): Use printnum_long.

9 years agogetcpu.c: use printnum_int and printaddr
Dmitry V. Levin [Mon, 20 Jul 2015 11:36:46 +0000 (11:36 +0000)]
getcpu.c: use printnum_int and printaddr

* getcpu.c (sys_getcpu): Use printnum_int and printaddr.

9 years agogetcwd.c: use printaddr
Dmitry V. Levin [Mon, 20 Jul 2015 11:35:03 +0000 (11:35 +0000)]
getcwd.c: use printaddr

* getcwd.c (sys_getcwd): Use printaddr.

9 years agogetrandom.c: use printaddr
Dmitry V. Levin [Mon, 20 Jul 2015 11:33:06 +0000 (11:33 +0000)]
getrandom.c: use printaddr

* getrandom.c (sys_getrandom): Use printaddr.

9 years agohostname.c: make use of RVAL_DECODED
Dmitry V. Levin [Mon, 20 Jul 2015 11:30:38 +0000 (11:30 +0000)]
hostname.c: make use of RVAL_DECODED

* hostname.c (sys_sethostname): Update for RVAL_DECODED.

9 years agohostname.c: use printaddr
Dmitry V. Levin [Mon, 20 Jul 2015 11:29:20 +0000 (11:29 +0000)]
hostname.c: use printaddr

* hostname.c (sys_gethostname): Use printaddr.

9 years agoinotify.c: make use of RVAL_DECODED
Dmitry V. Levin [Mon, 20 Jul 2015 11:25:52 +0000 (11:25 +0000)]
inotify.c: make use of RVAL_DECODED

* inotify.c (sys_inotify_add_watch, sys_inotify_rm_watch,
sys_inotify_init1): Update for RVAL_DECODED.

9 years agoio.c: make use of RVAL_DECODED
Dmitry V. Levin [Mon, 20 Jul 2015 11:19:30 +0000 (11:19 +0000)]
io.c: make use of RVAL_DECODED

* io.c (sys_write, sys_writev, sys_pwrite, sys_pwritev, sys_sendfile,
sys_sendfile64, sys_tee, sys_splice, sys_vmsplice): Update
for RVAL_DECODED.

9 years agoUse printnum_int64 instead of print_loff_t
Dmitry V. Levin [Mon, 20 Jul 2015 11:14:12 +0000 (11:14 +0000)]
Use printnum_int64 instead of print_loff_t

* defs.h (print_loff_t): Remove.
* io.c (print_loff_t): Remove.
(sys_sendfile64, sys_splice): Use printnum_int64 instead of print_loff_t.
* mtd.c (mtd_ioctl): Likewise.

9 years agoio.c: use printaddr and umove_or_printaddr
Dmitry V. Levin [Mon, 20 Jul 2015 11:06:54 +0000 (11:06 +0000)]
io.c: use printaddr and umove_or_printaddr

* io.c (sys_read, sys_pread): Use printaddr.
(tprint_iov_upto): Do not fetch data in case of syserror.
Use printaddr.
(sys_readv, sys_preadv): Remove redundant check for syserror.
(print_off_t): Use printnum_int and printnum_long.
(print_loff_t): Use umove_or_printaddr.

9 years agoioprio.c: make use of RVAL_DECODED
Dmitry V. Levin [Mon, 20 Jul 2015 10:42:49 +0000 (10:42 +0000)]
ioprio.c: make use of RVAL_DECODED

* ioprio.c (sys_ioprio_set): Update for RVAL_DECODED.

9 years agoipc.c: use printaddr and umove_or_printaddr
Dmitry V. Levin [Mon, 20 Jul 2015 10:11:33 +0000 (10:11 +0000)]
ipc.c: use printaddr and umove_or_printaddr

* ipc.c (sys_msgctl): Use printaddr.
(tprint_msgbuf): New function.
(tprint_msgsnd, tprint_msgrcv): Use it.
(sys_msgrcv): Use umove_or_printaddr.
(tprint_sembuf): Rename to tprint_sembuf_array.
(tprint_sembuf): New function.
(tprint_sembuf_array): Use it.
(sys_semop, sys_semtimedop): Update callers.
(sys_shmctl, sys_shmat, sys_shmdt): Use printaddr.
(sys_mq_open, printmqattr): Use printaddr and umove_or_printaddr.
* tests/ipc_msg.c (main): Update msgctl IPC_RMID regexp.
* tests/ipc_shm.c (main): Update shmctl IPC_RMID regexp.

9 years agokexec.c: use printaddr and umove_or_printaddr
Dmitry V. Levin [Mon, 20 Jul 2015 01:20:44 +0000 (01:20 +0000)]
kexec.c: use printaddr and umove_or_printaddr

* kexec.c (print_seg): New function.
(print_kexec_segments): Use it.  Use printaddr and umove_or_printaddr.
(kexec_load): Use printaddr.  Update for RVAL_DECODED.

9 years agokeyctl.c: make use of RVAL_DECODED
Dmitry V. Levin [Mon, 20 Jul 2015 00:48:49 +0000 (00:48 +0000)]
keyctl.c: make use of RVAL_DECODED

* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers.  Update for RVAL_DECODED.

9 years agokeyctl.c: use printaddr
Dmitry V. Levin [Mon, 20 Jul 2015 00:26:23 +0000 (00:26 +0000)]
keyctl.c: use printaddr

* keyctl.c (keyctl_read_key): Use printaddr.

9 years agoldt.c: make use of RVAL_DECODED
Dmitry V. Levin [Mon, 20 Jul 2015 00:19:09 +0000 (00:19 +0000)]
ldt.c: make use of RVAL_DECODED

* ldt.c (sys_modify_ldt, sys_set_thread_area, sys_get_thread_area):
Update for RVAL_DECODED.

9 years agoldt.c: use printaddr and umove_or_printaddr
Dmitry V. Levin [Mon, 20 Jul 2015 00:10:35 +0000 (00:10 +0000)]
ldt.c: use printaddr and umove_or_printaddr

* ldt.c [I386 || X86_64 || X32] (print_user_desc):
Use umove_or_printaddr.
[I386 || X86_64 || X32] (sys_modify_ldt): Use printaddr.
[(M68K || MIPS] (set_thread_area): Likewise.
[I386 || X86_64 || X32] (set_thread_area): Do not fetch data
if !verbose.
[I386 || X86_64 || X32] (get_thread_area): Remove redundant check
for syserror.

9 years agolink.c: make use of RVAL_DECODED
Dmitry V. Levin [Mon, 20 Jul 2015 00:01:55 +0000 (00:01 +0000)]
link.c: make use of RVAL_DECODED

* link.c (sys_link, sys_linkat, sys_unlinkat, sys_symlinkat): Update
for RVAL_DECODED.

9 years agolseek.c: make use of RVAL_DECODED
Dmitry V. Levin [Sun, 19 Jul 2015 23:58:13 +0000 (23:58 +0000)]
lseek.c: make use of RVAL_DECODED

* lseek.c (sys_lseek): Update for RVAL_DECODED.

9 years agolseek.c: use printnum_int64
Dmitry V. Levin [Sun, 19 Jul 2015 23:55:25 +0000 (23:55 +0000)]
lseek.c: use printnum_int64

* lseek.c (sys_llseek): Use printnum_int64.

9 years agomem.c: make use of RVAL_DECODED
Dmitry V. Levin [Sun, 19 Jul 2015 23:37:40 +0000 (23:37 +0000)]
mem.c: make use of RVAL_DECODED

* mem.c (print_mmap): Change to return void.
Update for RVAL_DECODED.
(sys_old_mmap, sys_old_mmap_pgoff, sys_mmap, sys_mmap_pgoff,
sys_mmap_4koff): Update callers.  Update for RVAL_DECODED.
(sys_brk, sys_munmap, sys_mprotect, sys_mremap, sys_madvise,
sys_mlockall, sys_msync, sys_remap_file_pages, sys_mbind,
sys_set_mempolicy, sys_migrate_pages, [POWERPC] subpage_prot):
Update for RVAL_DECODED.

9 years agomem.c: use printaddr and umove_or_printaddr
Dmitry V. Levin [Sun, 19 Jul 2015 23:25:56 +0000 (23:25 +0000)]
mem.c: use printaddr and umove_or_printaddr

* mem.c (sys_brk, print_mmap, sys_munmap, sys_mprotect, sys_mremap,
sys_madvise, sys_msync, sys_mincore, sys_remap_file_pages, get_nodes,
sys_mbind, [POWERPC] sys_subpage_prot): Use printaddr.
(sys_get_mempolicy): Use printaddr and umove_or_printaddr.

9 years agomknod.c: make use of RVAL_DECODED
Dmitry V. Levin [Sun, 19 Jul 2015 23:07:17 +0000 (23:07 +0000)]
mknod.c: make use of RVAL_DECODED

* mknod.c (decode_mknod): Change to return void.
Update for RVAL_DECODED.
(sys_mknod, sys_mknodat): Update callers.  Update for RVAL_DECODED.
[SPARC || SPARC64] (xmknod): Update for RVAL_DECODED.

9 years agomount.c: make use of RVAL_DECODED
Dmitry V. Levin [Sun, 19 Jul 2015 23:00:35 +0000 (23:00 +0000)]
mount.c: make use of RVAL_DECODED

* mount.c (sys_mount): Update for RVAL_DECODED.

9 years agomount.c: use printaddr
Dmitry V. Levin [Sun, 19 Jul 2015 22:58:19 +0000 (22:58 +0000)]
mount.c: use printaddr

* mount.c (sys_mount): Use printaddr.

9 years agoAlias sys_connect to sys_bind
Dmitry V. Levin [Sun, 19 Jul 2015 22:55:56 +0000 (22:55 +0000)]
Alias sys_connect to sys_bind

* linux/dummy.h (sys_connect): Alias to sys_bind.
* net.c (sys_connect): Remove.

9 years agonet.c: make use of RVAL_DECODED
Dmitry V. Levin [Sun, 19 Jul 2015 22:52:47 +0000 (22:52 +0000)]
net.c: make use of RVAL_DECODED

* net.c (sys_socket, sys_bind, sys_listen, sys_send, sys_sendto,
sys_sendmsg, sys_shutdown, sys_setsockopt): Update for RVAL_DECODED.

9 years agonet.c: use printaddr and umove_or_printaddr
Dmitry V. Levin [Sun, 19 Jul 2015 22:36:46 +0000 (22:36 +0000)]
net.c: use printaddr and umove_or_printaddr

* net.c (printsock): Use printaddr and umove_or_printaddr.
(printcmsghdr, printmsghdr, printmmsghdr, decode_mmsg, do_sockname,
sys_recv, sys_recvfrom, sys_recvmsg, do_pipe, print_linger, print_ucred,
print_tpacket_stats, print_icmp_filter, print_getsockopt,
print_group_req, print_tpacket_req, print_packet_mreq,
print_setsockopt): Use printaddr.
(print_mreq, print_mreq6): Use umove_or_printaddr.

9 years agotests: add sigaltstack.test
Elvira Khabirova [Fri, 17 Jul 2015 01:45:25 +0000 (04:45 +0300)]
tests: add sigaltstack.test

* tests/sigaltstack.c: New file.
* tests/sigaltstack.expected: Likewise.
* tests/sigaltstack.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add sigaltstack.
(TESTS): Add sigaltstack.test.
(EXTRA_DIST): sigaltstack.expected.
* tests/.gitignore: Add sigaltstack.

9 years agobootstrap: delete personality test directories beforehand
Elvira Khabirova [Thu, 16 Jul 2015 13:34:49 +0000 (16:34 +0300)]
bootstrap: delete personality test directories beforehand

* bootstrap: Delete tests-m32 and tests-mx32 directories
before creating them.

9 years agodefs.h: do not include <signal.h>
Dmitry V. Levin [Fri, 17 Jul 2015 23:56:54 +0000 (23:56 +0000)]
defs.h: do not include <signal.h>

* printsiginfo.h: New file.
* Makefile.am (strace_SOURCES): Add it.
* defs.h: Do not include <signal.h>.
(printsiginfo): Remove.
* printsiginfo.c: Include <signal.h> and "printsiginfo.h".
* strace.c: Likewise.
* sigaltstack.c: Include <signal.h>.
* signal.c: Likewise.
* sigreturn.c: Likewise.
* time.c: Likewise.

9 years agoresource.c: move printrusage and printrusage32 to a separate file
Dmitry V. Levin [Fri, 17 Jul 2015 23:50:02 +0000 (23:50 +0000)]
resource.c: move printrusage and printrusage32 to a separate file

* printrusage.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* resource.c (printrusage, [ALPHA] printrusage32): Move
to printrusage.c.

9 years agoopen.c: make use of RVAL_DECODED
Dmitry V. Levin [Fri, 17 Jul 2015 22:03:29 +0000 (22:03 +0000)]
open.c: make use of RVAL_DECODED

* open.c (decode_open, sys_creat): Update for RVAL_DECODED.

9 years agopersonality.c: make use of RVAL_DECODED
Dmitry V. Levin [Fri, 17 Jul 2015 21:53:45 +0000 (21:53 +0000)]
personality.c: make use of RVAL_DECODED

* personality.c (sys_personality): Update for RVAL_DECODED.

9 years agoprintsiginfo.c: use umove_or_printaddr
Dmitry V. Levin [Fri, 17 Jul 2015 21:58:18 +0000 (21:58 +0000)]
printsiginfo.c: use umove_or_printaddr

* printsiginfo.c (printsiginfo_at): Use umove_or_printaddr.