Commit Graph

1346 Commits

Author SHA1 Message Date
7674006eed Fix follow fork/vfork on Linux ARM OABI
__NR_SYSCALL_BASE eis 0 for EABI and is 0x900000 for OABI.
* process (change_syscall) [LINUX && ARM]: Mask off the high order bits
when changing syscall.

Signed-off-by: Steve Bennett <steveb@workware.net.au>
Reviewed-by: Kirill A. Shutemov <kirill@shutemov.name>
2009-09-18 12:18:03 +00:00
Mike Frysinger
86b23b73b8 Mark shell scripts as executable
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-18 12:07:03 +00:00
Mike Frysinger
8b1218e5ff Ignore ioctlsort helper program
* .gitignore: Add ioctlsort.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-18 12:07:02 +00:00
Mike Frysinger
4651222197 linux/errno: Add ERFKILL
* linux/errnoent.h: Change ERRNO_132 to ERFKILL according to errno 132
definition introduced in Linux 2.6.31.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-18 12:05:49 +00:00
Paolo Bonzini
8a56b8a8e7 Add accept4 socketcall
This second patch in the series adds support for accept4 as a socketcall
sub-call.  Besides the need to renumber all system calls, this poses
no problem.
Tested on i686.

* linux/arm/syscallent.h: Add accept4 socketcall.
* 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/syscallent.h: Likewise.

* linux/sparc/syscall.h (SYS_sub_accept4): Declare.
(SYS_socket_nsubcalls): Update.
* linux/syscall.h: Likewise.
2009-09-01 19:53:29 +00:00
Paolo Bonzini
705ff10c0b Replace x86-64 paccept with accept4
This patch changes the paccept syscall to accept4 for x86-64, since
the former was dropped in Linux kernel commit v2.6.27-rc7-14-g2d4c826.
At the same time, it adds support for pretty printing its arguments.

* linux/x86_64/syscallent.h: Replace paccept with accept4,
hook in sys_accept4.
* net.c (sys_accept): Leave a small stub calling the new...
(do_accept): ... function, which also adds a flags_arg argument.
(sys_accept4): New.
2009-09-01 19:53:29 +00:00
Andreas Schwab
99c85693a5 Zero-extend 32-bit addresses when printing argv array.
(printargv): Zero-extend 32-bit addresses.
Fixes RH#519480 "64-bit strace is lazy on execve of 32-bit
process".
2009-08-28 19:36:20 +02:00
Andreas Schwab
85f583229f Add more futex decoding.
* process.c (FUTEX_WAIT_REQUEUE_PI, FUTEX_CMP_REQUEUE_PI)
(FUTEX_PRIVATE_FLAG, FUTEX_CLOCK_REALTIME): Define.
(futexops): Add entries for them.
(sys_futex): Decode FUTEX_CMP_REQUEUE_PI and
FUTEX_WAIT_REQUEUE_PI.
2009-08-12 09:56:16 +02:00
08f922a574 Generate ChangeLog from git log
* .gitignore: Add ChangeLog
* ChangeLog: Rename to ChangeLog-CVS.
* Makefile.am (gen-changelog): New rule.
(dist-hook): Depend on it.
(EXTRA_DIST): Add ChangeLog-CVS.
* README-hacking: Describe changes.
* gitlog-to-changelog: Import from gnulib.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2009-07-08 21:01:21 +00:00
414fe7d4d2 Cleanup trailing whitespaces and indentation that uses spaces before tabs
Correct spacing to fix warnings reported by
git diff --check 4b825dc642 HEAD

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2009-07-08 14:57:27 +00:00
82f4cc6eee README-CVS: Rename to README-hacking
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2009-07-07 22:33:46 +00:00
5f87a09c6c .cvsignore: Remove obsolete file
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2009-07-07 22:10:47 +00:00
Roland McGrath
eb9e2e8904 Revert unapproved commits. 2009-06-02 16:49:22 -07:00
4ac9d627f4 * strace.c (handle_stopped_tcbs): Fix cast for 4th argument passed to ptrace(). 2009-06-01 18:45:41 +00:00
4bcd5ef922 * bjm.c (sys_query_module): Fix format warning reported by
gcc -Wformat-security.
* file.c (tprint_open_modes): Likewise.
* process.c (printargv): Likewise.
* signal.c (printsignal): Likewise.
2009-06-01 10:32:27 +00:00
f48df6ce29 Clean up header checks
* configure.ac: Reformat AC_CHECK_HEADERS to keep it sorted and
easily updated, and reduce merging errors in the future.
* system.c: Convert all non-standard #ifdef checks for specific
headers to regular #ifdef HAVE_*_H checks.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2009-06-01 09:59:11 +00:00
Denys Vlasenko
d80ed6c5c6 fix thinko in ChangeLog 2009-04-20 18:43:24 +00:00
Denys Vlasenko
4e718b5ea2 * strace.c (printstatsol, printstat_sparc64):
Remove NULL and error check for addr parameter.
(printoldstat, printstat, printoldstat64):
Move NULL and error check for addr parameter
so that it happens before printstatsol/printstat_sparc64 calls.
2009-04-20 18:30:13 +00:00
Denys Vlasenko
246f42ff5a * strace.c (collect_stopped_tcbs): Do not enable/disable signals
multiple times, do it just once per collecting pass.
2009-04-20 18:20:18 +00:00
Denys Vlasenko
e740fd31d2 * file.c (print_dirfd): Use int for file descriptor, not a long.
* process.c (printwaitn): Use int for PID, not a long.
2009-04-16 12:06:16 +00:00
Denys Vlasenko
b1a78cf3ee * signal (sys_rt_sigtimedwait): Fix sigtimedwait syscall decoding. 2009-04-15 13:31:59 +00:00
Denys Vlasenko
7a862d7620 * signal (sys_rt_sigaction): Print struct sigaction correctly
in 32/64 environment.
* desc.c (printflock): Add #ifdefs around earlier flock 32/64 fix
so that we don't waste time on arches with one personality.
2009-04-15 13:22:59 +00:00
Denys Vlasenko
1d632468c0 * signal.c: Whitespace, comment, and style fixes, no code changes.
* file.c: Ditto.
* time.c: Ditto.
* process.c: Ditto.
* resource.c: Ditto.
2009-04-14 12:51:00 +00:00
Denys Vlasenko
132c52a5cc * system.c (sram_alloc_flag): Add L2_SRAM constant.
by Mike Frysinger (vapier AT gentoo.org).
(sys_sram_alloc): Fix improperly used %zu:
tcp->u_arg is not a size_t, it is a long.
* net.c (printcmsghdr): Fix improperly used %zu:
struct cmsghdr::cmsg_len is not a size_t.
2009-03-23 13:12:46 +00:00
Denys Vlasenko
39fa628020 Update Changelog to more accurately describe the changes. 2009-03-20 13:30:12 +00:00
Denys Vlasenko
1e20921216 As it turned out, "if (interrupted) break;" is needed in both loops,
in "collect tasks" loop and in enclosing "collect/process" loop.
Before this patch, "strace cat" + "killall -INT strace" wasn't
making strace stop and exit. This patch restores 4.5.18 behavior
in this regard.
2009-03-20 13:28:00 +00:00
Denys Vlasenko
aab52cae4c Remove "better attach to SIGSTOP", it is not correct...
(^C fix remains).
2009-03-17 14:46:54 +00:00
Denys Vlasenko
222713aa40 * strace.c (startup_attach): Take care to correctly attach
to stopped processes by resending SIGSTOP.
(collect_stopped_tcbs): Check for ^C here, not in trace().
(trace): Remove check for ^C.
2009-03-17 14:29:59 +00:00
Denys Vlasenko
eedaac768d Decode fcntl's F_{GET,SET}LEASE, F_NOTIFY, and F_DUPFD_CLOEXEC.
By Mike Frysinger (vapier AT gentoo.org)
* desc.c: Add F_SETLEASE, F_GETLEASE, F_NOTIFY,
F_DUPFD_CLOEXEC to fcntlcmds[]. Create notifyflags[] array.
(sys_fcntl): Handle new flags.

Optimize printing of open modes.
* defs.h: Declare sprint_open_modes(),
remove unused parameter in tprint_open_modes().
* desc.c (sprint_open_modes): Move fuction definition from here...
* file.c (sprint_open_modes): To here.
(tprint_open_modes): Use sprint_open_modes(), it already
generates needed string.
* ipc.c: Remove unused parameter from calls
to tprint_open_modes().
2009-03-10 20:41:58 +00:00
Denys Vlasenko
c71016ea79 defs.h: cosmetics (wrap overlong line) 2009-03-06 00:33:24 +00:00
Denys Vlasenko
5ae2b7c601 AVR32 support by Hans-Christian Egtvedt
(hans-christian.egtvedt AT atmel.com).
* configure.ac: Make it recognize avr32.
* defs.h: Define LINUX_AVR32.
* linux/avr32/syscallent.h: New file.
* Makefile.am: Reference linux/avr32/syscallent.h.
* proc.c (change_syscall, setarg): Add support for avr32.
(struct xlat struct_user_offsets[]): Ditto.
* syscall.c (get_scno): Ditto.
(get_error, force_result, syscall_enter): Ditto.
* util.c (getpc, printcall): Ditto.
2009-02-27 20:32:52 +00:00
Denys Vlasenko
ea0e6e8026 CRIS support by Hinko Kocevar (hinko.kocevar AT cetrtapot.si)
* configure.ac: Make it recognize cris.
* process.c: Define ARG_xxx constants for cris.
(change_syscall): Add support for cris.
(struct_user_offsets): Add cris-specific data.
* signal.c (sys_sigreturn): Add support for cris.
* syscall.c (get_scno): Add support for cris.
(syscall_fixup): Add support for cris.
(get_error): Add support for cris.
(syscall_enter): Add support for cris.
(force_result): While at it, fix cpp directives indentation.
* util.c (printcall): Add support for cris.
2009-02-25 17:08:40 +00:00
Denys Vlasenko
8ed5727642 By Hans-Christian Egtvedt (hans-christian.egtvedt AT atmel.com):
strace.c: suppress "warning: unused static" message by adding #ifdef's around
 a variable
.gitignore: trivial
test/*.c: cleanup (suppress warnings, much better style).
2009-02-25 14:24:02 +00:00
Denys Vlasenko
4dedd561d6 Replace many more bare ptrace calls with calls to wrappers
which do proper error-checking and set tcp->ptrace_errno.
In some cases, missing error checking is added.
Error handling for trace_syscall() failures and other cases
where tcp->ptrace_errno is nonzero is cleaned up a bit
and made more verbose if we see error other than ESRC.
Some comments are added or expanded.
* defs.h: Declare ptrace_cmds[]. Modify do_ptrace
declaration (last parameter is long, not void *).
* process.c: Make ptrace_cmds[] non-static.
(change_syscall): Use do_ptrace() instead of bare ptrace().
* signal.c: Use do_ptrace() instead of bare ptrace().
* strace.c: Update trace_syscall() failure handling.
* syscall.c: Use do_ptrace() instead of bare ptrace().
* util.c: Use do_ptrace() instead of bare ptrace().
Update do_ptrace() wrapper.
(str_PTRACE_xxx): New function - helper returning "PTRACE_xxx".
(do_ptrace_peekdata): New function - wrapper for PTRACE_PEEKDATA
(do_ptrace5): New function - wrapper for 5-argument ptrace calls.
2009-02-24 15:17:53 +00:00
Denys Vlasenko
c7e837154d * process.c: Indent preprocessor directives so that nesting
can be figured out. Add PTRACE_SET_SYSCALL to ptrace_cmds[].
2009-02-24 12:59:47 +00:00
Denys Vlasenko
e6d113ff3e linux/ioctlent.sh: update by Mike Frysinger (now collects enums too) 2009-02-23 13:22:06 +00:00
Denys Vlasenko
c43a515f3b More cleanups from Mike Frysingler:
README: update an URL
.gitignore: added
config.guess config.sub install-sh: removed, they are revenerated
 by autoconf anyway
2009-02-23 08:07:45 +00:00
Denys Vlasenko
5e97754cfe HACKING-scripts: new doc file by Mike Frysinger 2009-02-23 07:56:01 +00:00
Denys Vlasenko
8a4bdf842e s/sort | uniq/sort -u/ 2009-02-22 03:01:20 +00:00
Denys Vlasenko
f3c9ed48bc Further signalent.h cleanup.
* linux/ia64/signalent.h: Remove, it is identical to common signalent.h
sans "SIGRTnn" definitions which are redundant.
* linux/powerpc/signalent.h: Remove, it is identical to common signalent.h
sans outdated "SIGUNUSED" which should be "SIGSYS".
* linux/s390/signalent.h: Ditto.
* linux/s390x/signalent.h: Ditto.
* Makefile.am: Remove references to the above files.
2009-02-20 17:38:47 +00:00
Denys Vlasenko
3566e3d5f2 Patch by Mike Frysinger (vapier AT gentoo.org).
* linux/ioctlent.sh: Update sed machinery to parse _IOC() macros
with two constants.
2009-02-20 17:32:34 +00:00
Denys Vlasenko
53560265c6 Patch by Mike Frysinger (vapier AT gentoo.org).
* Makefile.am: Remove reference to linux/sh/signalent.h.
* linux/sh/signalent.h: Remove, it is identical to common signalent.h.
2009-02-20 16:24:39 +00:00
Denys Vlasenko
361f82b853 fix accidental damage to ChangeLog 2009-02-20 16:03:42 +00:00
Denys Vlasenko
185cce1373 Patch by Mike Frysinger (vapier AT gentoo.org).
* linux/errnoent.h: Make ERRNO_58 show EDEADLOCK for POWERPC.
* Makefile.am: Remove reference to linux/powerpc/errnoent.h.
* linux/powerpc/errnoent.h: Remove, we can use common errnoent.h now.
2009-02-20 16:00:41 +00:00
Denys Vlasenko
d8df3718ca Patch by Mike Frysinger (vapier AT gentoo.org).
Removing redundant errnoent.h files.
* Makefile.am: Remove references to linux/ia64/errnoent.h,
linux/s390/errnoent.h, linux/s390x/errnoent.h and linux/sh/errnoent.h.
* linux/ia64/errnoent.h: Remove, this arch uses common errnoent.h.
* linux/s390/errnoent.h: Ditto.
* linux/s390x/errnoent.h: Ditto.
* linux/sh/errnoent.h: Ditto.
2009-02-20 15:51:51 +00:00
Denys Vlasenko
26de70e92e test/sigkill_rain.c: a testcase with lots of async deaths 2009-02-13 10:26:31 +00:00
Roland McGrath
b2c048b394 . 2009-02-11 03:03:29 +00:00
Roland McGrath
587c7b50ad 2009-02-10 Roland McGrath <roland@redhat.com>
* configure.ac: Check for struct sigcontext.
	* signal.c [LINUX] [M68K] (struct sigcontext): Don't define it if
	[HAVE_STRUCT_SIGCONTEXT].
	From Muttley Meen <muttley.meen@gmail.com>.
2009-02-11 03:03:28 +00:00
Denys Vlasenko
84e20af5a6 Cleanup after tcb table expansion simplification.
There was code which was trying to continue tracing
even if table expansion fails. Now we treat it as fatal
failure, so this code is removed by this change.
* defs.h: Delete TCB_FOLLOWFORK constant.
* process.c: Delete fork_tcb() and all calls of it.
* strace.c (startup_attach): Remove usage of TCB_FOLLOWFORK.
* syscall.c: Indent preprocessor directives.
2009-02-10 16:03:20 +00:00
Denys Vlasenko
3bb7cd6660 * defs.h: Correct the comment about TCB_SUSPENDED.
* strace.c: Fix misplaced #endif.
* util.c: Indent preprocessor directives, mark code parts
which can never be reached by compilation because of
the combination of #if directives. These are likely dead code,
I want to remove them later.
2009-02-09 18:55:59 +00:00