Commit Graph

255 Commits

Author SHA1 Message Date
Denys Vlasenko
3b73881a0d Fix -z display.
Before this patch, the following:
    open("qwerty", O_RDONLY)    = -1 ENOENT
    write(2, "wc: qwerty: No such file or dire"..., 38) = 38
was shown totally wrongly with -z:
    open("qwerty", O_RDONLY)    = 38
(yes, that's right, write syscall is lost!)
Now it is shown "less wrongly" as:
    open("qwerty", O_RDONLY <unfinished ...>
    write(2, "wc: qwerty: No such file or dire"..., 38) = 38

* syscall.c (trace_syscall_exiting): Use common TCB_INSYSCALL clearing
via "goto ret". This fixes totally broken display of -z, but even now
it is not working as intended. Add a comment about that.
(trace_syscall_entering): Use common TCB_INSYSCALL setting
via "goto ret".

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2011-08-23 12:53:02 +02:00
Denys Vlasenko
b88f96129f Straighten up confused comments/messages about post-execve SIGTRAP handling
* defs.h: Explain TCB_INSYSCALL and TCB_WAITEXECVE bits in detail.
* strace.c (choose_pfd): Use entering/exiting macros instead of direct check
for TCB_INSYSCALL.
* syscall.c (get_scno): Use entering/exiting macros instead of direct check
for TCB_INSYSCALL. Fix comments about post-execve SIGTRAP.
(syscall_fixup): Use entering/exiting instead of direct check
for TCB_INSYSCALL. Add a comment what "not a syscall entry" message
usually means. Change wrong "stray syscall exit" messages into
"not a syscall entry" ones.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2011-08-23 12:53:02 +02:00
Denys Vlasenko
c95a88f124 count_syscall() always returns 0, optimize it
* defs.h (count_syscall): Change return type from int to void.
* count.c (count_syscall): Change return type from int to void.
* syscall.c (trace_syscall_exiting): Change code around call
to count_syscall accordingly.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2011-08-23 12:53:02 +02:00
Denys Vlasenko
a7949748d1 Conditionally optimize out unused code
* syscall.c (internal_syscall): Call internal_exec only if
SUNOS4 || (LINUX && TCB_WAITEXECVE).
* process.c (internal_exec): Define this function only if
SUNOS4 || (LINUX && TCB_WAITEXECVE).
(printwaitn): Don't check wordsize if SUPPORTED_PERSONALITIES == 1.
* signal.c (sys_kill): Likewise.
* syscall.c (is_negated_errno): Likewise.
(trace_syscall_exiting): Fold a tprintf into tprintfs which follow it.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2011-08-23 12:53:02 +02:00
Denys Vlasenko
5d64581e10 Improve code readability by avoiding assignments inside if()
* desc.c (decode_select): Move assignment out of if() condition.
* file.c (sprinttime): Likewise.
(sys_getdirentries): Likewise.
* io.c (sys_ioctl): Likewise.
* strace.c (test_ptrace_setoptions_followfork): Likewise.
(main): Likewise.
(proc_open): Likewise.
(detach): Likewise.
(proc_poll): Likewise.
(trace): Likewise.
* syscall.c (qualify): Likewise.
(sys_indir): Likewise.
* test/procpollable.c (main): Likewise.
* test/sfd.c (main): Likewise.
* time.c (printtv_bitness): Likewise.
(sprinttv): Likewise.
(print_timespec): Likewise.
(void sprint_timespec): Likewise.
(printitv_bitness): Likewise.
* util.c (dumpstr): Likewise.
(umovestr): Likewise.
(fixvfork): Likewise.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2011-08-23 12:53:01 +02:00
Denys Vlasenko
39fca62801 Small optimization in signal and ioctl tables
Trivial shuffling of data tables puts them all in one file,
allowing gcc to see their sizes and eliminate variables
which store these sizes.

Surprisingly, in C mode gcc does not optimize out static const int
variables. Help it by using enums instead.

* defs.h: Stop exporting ioctlent{0,1,2}, nioctlents{0,1,2},
signalent{0,1,2}, nsignals{0,1,2}.
* ioctl.c: Remove definitions of ioctlent{,0,1,2} and nioctlents{,0,1,2}.
* signal.c: Remove definitions of signalent{,0,1,2} and nsignals{,0,1,2}.
* syscall.c: Move above definitions to this file. Make them static const
or enums if suitable.
2011-08-23 12:53:01 +02:00
Denys Vlasenko
5c774b2be4 Don't return int from set_personality(), no one checks it.
* defs.h (set_personality): Change return type to void.
* syscall.c (set_personality): Change return type to void.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2011-08-23 12:53:01 +02:00
Denys Vlasenko
deec74eb52 Make needlessly static data local
* syscall.c (get_scno): For POWERPC64 and X86-64, variable currpers
is declared static. But its old data is never used. Convert it
to ordinary local variable.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2011-08-23 12:53:01 +02:00
Denys Vlasenko
7c9ba8b55e Optimize get_scno function
* syscall.c (get_scno): Make gpr_offset[] array static const.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2011-08-23 12:53:01 +02:00
Denys Vlasenko
041b3ee42e Cosmetic fixes, no code changes
* defs.h: Add/reformat comments.
* signal.c: Remove wrong comment. Add warning directive
when we detect that NSIG is undefined. Add comment about
NSIG on ARM. Fix typo in comment.
(signame): Reformat code a bit without changes to logic.
Shorten static buffer.
(sys_rt_sigprocmask): Remove stray empty line.
* syscall.c: Add warning directive when we detect that
NSIG is undefined. Add comment about NSIG on ARM.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2011-08-23 12:53:01 +02:00
Denys Vlasenko
19cdada5b4 Do not detach when we think tracee is going to die.
Current code plays some ungodly tricks, trying to not detach
thread group leader until all threads exit.

Also, it detaches from a tracee when signal delivery is detected
which will cause tracee to exit.
This operation is racy (not to mention the determination
whether signal is set to SIG_DFL is a horrible hack):
after we determined that this signal is indeed fatal
but before we detach and let process die,
*other thread* may set a handler to this signal, and
we will leak the process, falsely displaying it as killed!

I need to look in the past to figure out why we even do it.
First guess is that it's a workaround for old kernel bugs:
kernel used to deliver exit notifications to the tracer,
not to real parent. These workarounds are ancient
(internal_exit is from 1995).

The patch deletes the hacks. We no longer need tcp->nclone_threads,
TCB_EXITING and TCB_GROUP_EXITING. We also lose a few rather
ugly functions.

I also added a new message: "+++ exited with EXITCODE +++"
which shows exact moment strace got exit notification.
It is analogous to existing "+++ killed by SIG +++" message.

* defs.h: Delete struct tcb::nclone_threads field,
  TCB_EXITING and TCB_GROUP_EXITING constants,
  declarations of sigishandled() and internal_exit().
* process.c (internal_exit): Delete this function.
  (handle_new_child): Don't ++tcp->nclone_threads.
* signal.c (parse_sigset_t): Delete this function.
  (sigishandled): Delete this function.
* strace.c (startup_attach): Don't tcbtab[tcbi]->nclone_threads++.
  (droptcb): Don't delay dropping if tcp->nclone_threads > 0,
  don't drop parent if its nclone_threads reached 0:
  just drop (only) this tcb unconditionally.
  (detach): don't drop parent.
  (handle_group_exit): Delete this function.
  (handle_ptrace_event): Instead of handle_group_exit, just drop tcb;
  do not panic if we see WIFEXITED from an attached pid;
  print "+++ exited with EXITCODE +++" for every WIFEXITED pid.
* syscall.c (internal_syscall):	Do not treat sys_exit specially -
  don't call internal_exit on it.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2011-08-17 10:45:32 +02:00
Denys Vlasenko
0b6c73c880 Optimize arrays of register indexes in syscall_enter
* syscall.c (syscall_enter) [BFIN]: Make register no array "static const".
  [SH]: Make register no array "const", pre-multiply it by 4.
  [SH64]: Make register no array "const".
  [X86_64]: Make register no array "const", pre-multiply it by 8.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2011-06-23 22:22:34 +02:00
Denys Vlasenko
f5d099c270 Deindent syscall_enter by removing unnecessary braces. No code changes.
syscall_enter has many long (>80 columns) lines.
It is aggravated by the fact that it has a lot of {} blocks
which are not necessary (the code is the same without them).
This patch removes {}s and deindents affected lines.
While at it, it indents ifdefs so that nesting is easier to track,
and adds a few spaces in the expressions, such as
"tcp->u_nargs*sizeof..." -> "tcp->u_nargs * sizeof...".
There is no actual changes to the code here.

* syscall.c (syscall_enter): Remove unnecessary {} blocks.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2011-06-23 22:10:54 +02:00
Denys Vlasenko
7b609d5ba0 Whitespace cleanups. No code changes.
* count.c: Place opening curly brace after if (),
  not on the next line. Almost all strace code alredy
  uses this style.
* desc.c: Likewise.
* file.c: Likewise.
* net.c: Likewise.
* pathtrace.c: Likewise.
* process.c: Likewise.
* quota.c: Likewise.
* signal.c: Likewise.
* strace.c: Likewise.
* syscall.c: Likewise.
* time.c: Likewise.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2011-06-22 14:32:43 +02:00
Denys Vlasenko
0df9ed47af Do not suspend waitpid.
strace used to suspend waitpid until there is a child
for waitpid'ing process to collect status from.
Apparently, it was done because in some very old kernels
(circa 2002 or even earlier) there were ptrace bugs which
were making waitpid in real parent to not see children.
This kernel bug is fixed long ago. This change removes the workaround.
test/wait_must_be_interruptible.c is a test program which
illustrates why without this change strace changes
programs's behavior.

* defs.h: Delete waitpid and nclone_waiting members from from struct tcb.
  Remove declaration of internal_wait().
* process.c (internal_wait): Remove this function.
* strace.c (alloc_tcb): Do not set tcp->nclone_waiting.
  (resume): Remove this function.
  (resume_from_tcp): Remove this function.
  (detach): Do not call resume_from_tcp().
  (handle_group_exit): Do not call resume_from_tcp().
* syscall.c (internal_syscall): Do not call internal_wait().

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2011-06-18 11:38:51 +02:00
fcda7a5f4f Introduce ARRAY_SIZE() macro
* defs.h (ARRAY_SIZE): New macro.
* ioctl.c: Use it.
* pathtrace.c (pathmatch, storepath): Likewise.
* process.c (printpriv): Likewise.
* signal.c: Likewise.
* syscall.c: Likewise.
2011-06-13 21:58:43 +00:00
Denys Vlasenko
4660fe610c Do not call umoven to fetch parameters if we have zero params
* syscall.c [I386] (syscall_enter): Do not call umoven
to fetch zero bytes. This is just an optimization.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2011-06-09 01:32:23 +02:00
Denys Vlasenko
b63256e69b Whitespace cleanups. no code changes.
* bjm.c: Fix tabulation (such as extra spaces before tabs),
convert punctuation where it deviates from prevalent form
elsewhere in strace code, convert sizeof and offsetof where
it deviates from from prevalent form, remove space between
function/macro/array names and (parameters) or [index],
add space between "if" and (condition), correct non-standard
or wrong indentaion.
* defs.h: Likewise
* desc.c: Likewise
* file.c: Likewise
* ipc.c: Likewise
* linux/arm/syscallent.h: Likewise
* linux/avr32/syscallent.h: Likewise
* linux/hppa/syscallent.h: Likewise
* linux/i386/syscallent.h: Likewise
* linux/ioctlsort.c: Likewise
* linux/m68k/syscallent.h: Likewise
* linux/microblaze/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/tile/syscallent.h: Likewise
* linux/x86_64/syscallent.h: Likewise
* mem.c: Likewise
* net.c: Likewise
* pathtrace.c: Likewise
* process.c: Likewise
* signal.c: Likewise
* sock.c: Likewise
* strace.c: Likewise
* stream.c: Likewise
* sunos4/syscall.h: Likewise
* sunos4/syscallent.h: Likewise
* svr4/syscall.h: Likewise
* svr4/syscallent.h: Likewise
* syscall.c: Likewise
* system.c: Likewise
* test/childthread.c: Likewise
* test/leaderkill.c: Likewise
* test/skodic.c: Likewise
* time.c: Likewise
* util.c: Likewise

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2011-06-07 12:13:24 +02:00
Denys Vlasenko
1201426dd4 "Modernize" all old-style function parameter declarations
* bjm.c: Convert all remaining old-style C function definitions
to a "modern" form. This does not change any actual code.
* io.c: Likewise
* ioctl.c: Likewise
* net.c: Likewise
* proc.c: Likewise
* process.c: Likewise
* signal.c: Likewise
* sock.c: Likewise
* strace.c: Likewise
* stream.c: Likewise
* syscall.c: Likewise
* system.c: Likewise
* time.c: Likewise
* util.c: Likewise

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2011-05-30 14:00:14 +02:00
Grant Edwards
8a08277d13 Add ability to print file descriptor paths and filter by those paths
* pathtrace.c: New file, implements matching syscall arguments to
user-specified file paths.
* Makefile.am (strace_SOURCES): Add pathtrace.c.
* defs.h (TCB_FILTERED, filtered): New defines.
(getfdpath, pathtrace_select, pathtrace_match, show_fd_path,
tracing_paths): New declarations.
* strace.c (show_fd_path, tracing_paths): New global variables.
(usage, main): Implement handling of -y and -P options.
* strace.1: Add descriptions of -y and -P options.
* syscall.c (trace_syscall_entering): Add path matching logic to the
print/noprint decision and set the TCB_FILTERED bit appropriately.
(trace_syscall_exiting): Use filtered() macro that checks the
TCB_FILTERED bit to determine print/noprint status.
* util.c (printfd): Use getfdpath().
2011-04-08 20:47:56 +00:00
9fdbee6dea Fix raw exit_group(2) decoding
* syscall.c (trace_syscall_entering): Check for sys_exit instead of
SYS_exit to handle exit_group(2) as well as _exit(2).
2011-02-19 00:02:27 +00:00
bd13645efb Optimize known_scno()
* syscall.c (known_scno): Do not check for native_scno field on
platforms that support only one personality.
2011-02-18 23:19:47 +00:00
65c1a81f6a Fix biarch support in IO dumping
* syscall.c (dumpio): Switch on tcp->sys_func instead of tcp->scno
for more reliable results.
2011-02-09 00:39:47 +00:00
50a218d4ac Fix decoding of get[ug]id, gete[ug]id and setfs[ug]id return values
* defs.h (SYSCALL_NEVER_FAILS): New syscall flag.
* linux/dummy.h: Change redirection for sys_get[ug]id, sys_gete[ug]id
and setfs[ug]id.
* linux/*/syscallent.h: Set SYSCALL_NEVER_FAILS flag for get[ug]id,
gete[ug]id and setfs[ug]id syscalls.
* process.c [LINUX] (sys_getuid, sys_setfsuid): New functions.
* syscall.c (NF): New shorthand macro for use in syscallent.h files.
(get_error): Check SYSCALL_NEVER_FAILS flag.
Reported by Марк Коренберг <socketpair@gmail.com>.
2011-01-19 00:52:15 +00:00
bdafa1a905 Output diagnostics to stderr
* syscall.c (get_scno): Output information about changes in
personality mode to stderr.  Reported by Pádraig Brady.
2010-12-03 17:28:11 +00:00
35d0572a12 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.
2010-09-15 16:34:53 +00:00
Wang Chao
0ef43b8189 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>
2010-09-15 16:32:02 +00:00
30145dda9d 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 *".
2010-09-07 00:59:18 +00:00
Edgar E. Iglesias
939caba68e 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>
2010-08-05 20:04:50 +00:00
Andreas Schwab
d69fa497f4 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.
2010-07-13 19:13:03 +02:00
Andreas Schwab
246888d239 M68K: Fix fetching syscall arguments
* syscall.c (syscall_enter) [M68K]: Properly handle more than five
syscall arguments.
2010-06-05 21:50:30 +02:00
Andreas Schwab
ffca9e30d6 Fix warning when compiling for m68k
* syscall.c (d0): Define as long.
2010-05-28 20:53:14 +02:00
7d7c963d79 Split trace_syscall() for better readability
* syscall.c (trace_syscall): Split into trace_syscall_exiting() and
trace_syscall_entering().
2010-04-07 10:19:26 +00:00
e3a7ef5a2a 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.
2010-04-07 10:19:26 +00:00
David Daney
200370419b Fix MIPS N32/N64 compile error
* syscall.c [LINUX_MIPSN32 || LINUX_MIPSN64] (syscall_enter): Pass
tcp->pid to ptrace().
2010-02-09 21:37:50 +00:00
Chris Metcalf
c8c6698ef7 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>
2010-02-05 22:09:30 +00:00
e5e6085806 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.
2010-02-04 22:40:57 +00:00
257e15737d 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().
2010-02-04 22:40:57 +00:00
Mike Frysinger
8566c50025 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>
2009-10-12 19:54:21 +00:00
Mike Frysinger
c1a5b7e8c4 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>
2009-10-08 14:25:01 +00:00
Edgar E. Iglesias
eeb9ce3895 CRIS: Correct first argument to upeek()
This complements commit ea0e6e8026.
* syscall.c [CRISV10 || CRISV32] (syscall_fixup, syscall_enter): Pass
tcp pointer instead of pid to upeek().
* util.c [CRISV10 || CRISV32] (printcall): Likewise.

Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2009-10-05 14:57:06 +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
Roland McGrath
eb9e2e8904 Revert unapproved commits. 2009-06-02 16:49:22 -07: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
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
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
fb03667fad syscall.c (get_scno): Fix warnings about unused 'pid' variable 2009-01-23 16:30:26 +00:00
Denys Vlasenko
1d5b113f8c * defs.h: Update a comment. No code changes.
* strace.c (handle_stopped_tcbs): Discard all execve stops
and clear TCB_WAITEXECVE bit.
* syscall.c (get_scno): Add the code to not mistakenly
treat ptrace stop as execve stop (execve stops can be blocked
by traced program).
Fixes RH#477775 "strace hangs if the target process blocks SIGTRAP".
2009-01-17 01:06:18 +00:00
Denys Vlasenko
ef2fbf856c Output format fixes, improving the situation after recent
change which added better handling of processes suddenly
disappearing. Now we often do not finish last line
before exiting in those cases.
The only change affecting something other than output
is change in umovestr where we were calling
abort() on ptrace error.

* strace.c (trace): If trace_syscall() failed with ESRCH,
finish current output line with " <unfinished ...>".
(mp_ioctl): While we are at it, fix gross style mismatch
in this function definition. No code chages.
* syscall.c (trace_syscall): If decode fails on syscall exit,
finish current output line with "= ? <unavailable>".
* util.c (umoven): Do not complain if error is ESRCH.
(umovestr): Do not complain and do not abort() if error is ESRCH.
* defs.h: Remove unused tcp parameter from printtrailer().
* process.c: Adjust printtrailer() calls accordingly.
* strace.c: Adjust printtrailer() calls accordingly.
* syscall.c: Adjust printtrailer() calls accordingly.
2009-01-06 21:45:06 +00:00
Denys Vlasenko
8236f254b7 * syscall.c: more cosmetics. fixed a few localized style discrepancies.
The only actual code change is a trivial one where
a char *array[] made const and static.
2009-01-02 18:10:08 +00:00
Denys Vlasenko
bc161ecae6 * defs.h, syscall.c: explain why x86 does not need TCB_WAITEXECVE trick,
and what syscall_fixup() is expected to do. Comments only, no code changes.
2009-01-02 18:02:45 +00:00
Denys Vlasenko
adedb51019 Fixing many instances of broken indentation with spaces instead of tabs.
No code changes.
2008-12-30 18:47:55 +00:00
Denys Vlasenko
8ba1cd7d12 Patch by Kirill A. Shutemov:
Fix some warnings on ARM build.
* defs.h: include <sys/ptrace.h> on arm too.
* syscall.c: EABI arm does not need decode_subcall(), ifdef it out.
2008-12-30 17:50:46 +00:00
Denys Vlasenko
732d1bf4d4 Make strace somewhat resilient against process disappearing
under its claws. Prime example is sudden SIGKILL.
Fixes RH#472053
2008-12-17 19:21:59 +00:00
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
Roland McGrath
6b1d43ef29 2003-02-26 Stuart Menefy <stuart.menefy@st.com>
Various fixes for SuperH [SH]:
	* mem.c (sys_old_mmap): mmap() parameters passed in registers
	* net.c (sys_pipe), syscall.c (getrval2): pipe() results returned
	in registers
	* process.c (change_syscall): Fixed register which holds system
	call number
	* util.c (arg0_offset, arg1_offset): provide definition
	* Makefile.am: Added new files in linux/sh
	* linux/sh/syscallent.h: New file.
	* linux/sh/errnoent.h: New file.
	* linux/sh/ioctlent.h: New file.
	* linux/sh/signalent.h: New file.
2003-03-31 01:05:01 +00:00
Roland McGrath
ba95476dd4 2003-03-04 Roland McGrath <roland@redhat.com>
* syscall.c (get_scno) [IA64]: Do TCB_WAITEXECVE check only when
	TCB_INSYSCALL is clear, like other platforms do.
2003-03-05 06:29:06 +00:00
Roland McGrath
f3a0e1bb56 2003-02-19 Roland McGrath <roland@redhat.com>
FreeBSD rfork support changes from Russ Cox <rsc@plan9.bell-labs.com>:
	* syscall.c (internal_syscall): Handle SYS_rfork with internal_fork.
	* process.c (internal_fork) [SYS_rfork]: Bail if RFPROC flag not set.
2003-02-20 02:45:22 +00:00
Roland McGrath
96dc5148ff 2003-01-20 Roland McGrath <roland@redhat.com>
* defs.h [LINUX] [S390 || S390X] (TCB_WAITEXECVE): Define it.
	* syscall.c (get_scno, syscall_fixup) [LINUX] [S390 || S390X]: Handle
	TCB_WAITEXECVE state with special kludges.
2003-01-20 10:23:04 +00:00
Roland McGrath
eb28535990 2003-01-14 Roland McGrath <roland@redhat.com>
* configure.ac: Match powerpc* (includes powerpc64), and don't match
	ppc (never comes out of config.sub).
	* process.c (sys_ptrace): Use #lx format for address argument.
	[POWERPC]: Use sizeof(unsigned long) in place of 4 for multipliers.
	* process.c [POWERPC]: Likewise.
	* signal.c (sys_sigreturn) [POWERPC]: Likewise.
	* syscall.c (get_scno) [POWERPC]: Likewise.
	* util.c [POWERPC]: Likewise.
	(printnum): Use long for NUM.
	From Anton Blanchard <anton@samba.org>.
2003-01-14 09:59:00 +00:00
Roland McGrath
d38809b8bd 2003-01-09 Roland McGrath <roland@redhat.com>
* syscall.c (force_result) [S390 || S390X]: Fix typo.
2003-01-10 07:50:21 +00:00
Roland McGrath
923f750119 2003-01-08 Roland McGrath <roland@redhat.com>
Support for new Linux 2.5 thread features.
	* defs.h [LINUX]: Define __NR_exit_group if not defined.
	(struct tcb): New members nclone_threads, nclone_detached,
	and nclone_waiting.
	(TCB_CLONE_DETACHED, TCB_CLONE_THREAD, TCB_GROUP_EXITING): New macros.
	(waiting_parent): Macro removed.
	(pid2tcb): Declare it.
	* process.c (internal_clone) [TCB_CLONE_THREAD]: Reparent the new
	child to our parent if we are a CLONE_THREAD child ourselves.
	Maintain TCB_CLONE_THREAD and TCB_CLONE_DETACHED flags and counts.
	(internal_wait) [TCB_CLONE_THREAD]: Factor out detached children when
	determining if we have any.  If TCB_CLONE_THREAD is set, check
	parent's children instead of our own, and bump nclone_waiting count.
	(internal_exit) [__NR_exit_group]: Set the TCB_GROUP_EXITING flag if
	the syscall was exit_group.
	* syscall.c (internal_syscall): Use internal_exit for exit_group.
	* strace.c (pid2tcb): No longer static.
	(alloctcb) [TCB_CLONE_THREAD]: Initialize new fields.
	(droptcb) [TCB_CLONE_THREAD]: Maintain new fields.
	If we have thread children, set TCB_EXITING and don't clear the TCB.
	(resume) [TCB_CLONE_THREAD]: Decrement parent's nclone_waiting.
	(detach) [TCB_CLONE_THREAD]: When calling resume, check all thread
	children of our parent that might be waiting for us too.
	[TCB_GROUP_EXITING] (handle_group_exit): New function.
	(trace) [TCB_GROUP_EXITING]: Use that in place of detach or droptcb.
2003-01-09 06:53:27 +00:00
Roland McGrath
9797cebddb 2002-12-30 Roland McGrath <roland@redhat.com>
* syscall.c (qualify_one): New function.
	(qual_options): Replace lookup field with qualify, update initializer.
	(qualify): Update caller.
	(qual_signal, qual_fault, qual_desc): Rewritten from lookup_*.
	(qual_syscall): Rewritten lookup_syscall, match name more than once.
	Fixes RH#70579, bites IA64 -efoo when foo exists on IA32.
2002-12-30 10:23:00 +00:00
Roland McGrath
b69f81b8e5 2002-12-21 Roland McGrath <roland@redhat.com>
* syscall.c (force_result): New function.
	* process.c (internal_wait): Handle ECHILD exit from wait call with
	WNOHANG flag set; force the return value to 0 in the inferior when it
	has live children we are tracing.
2002-12-21 23:25:18 +00:00
Roland McGrath
761b5d790f 2002-12-15 Roland McGrath <roland@redhat.com>
* syscall.c (syscall_enter) [LINUX && POWERPC]: Define PT_ORIG_R3 if
	not defined, since <asm/ptrace.h> defines it only #ifdef __KERNEL__.
	* process.c: Likewise.
	* syscall.c (trace_syscall): Use strerror, not sys_errlist/sys_nerr.
	* syscall.c (get_scno): Move static `currpers' inside #ifdef X86_64.
	(trace_syscall): Fix return without value.
2002-12-15 23:58:31 +00:00
Michal Ludvig
882eda809c 2002-11-09 Heiko Carstens <heiko.carstens@de.ibm.com>
Bugfix for s390/s390x:
        * syscall.c: Fixed scno derivation for s390/s390x.
2002-11-11 12:50:47 +00:00
Michal Ludvig
17f8fb3484 Added switch for printing only succeeding syscalls. 2002-11-06 13:17:21 +00:00
Michal Ludvig
10a88d09eb 2002-10-07 Michal Ludvig <mludvig@suse.cz>
Merged s390x port by Heiko Carstens <Heiko.Carstens@de.ibm.com>
        and bugfixes to s390 by D.J. Barrow.
2002-10-07 14:31:00 +00:00
Michal Ludvig
0e035502d2 2002-09-23 Michal Ludvig <mludvig@suse.cz>
Merged x86-64 port by Andi Kleen <ak@suse.de>
	and Michal Ludvig <mludvig@suse.cz>
	* Makefile.in: New target 'headers'. Failure ignored.
	* acconfig.h: New defines for x86-64.
	* configure.in: Ditto.
	* defs.h: Ditto.
	* file.c: Ditto.
	* signal.c: Ditto.
	* process.c: Added support for x86-64.
	* util.c: Ditto.
	* syscall.c: Ditto + added automatic personality switching.
	* linux/syscall.h: Ditto.
	* linux/x86_64: New directory.
	* linux/x86_64/Makefile.in: New file.
	* linux/x86_64/gentab.pl: Ditto.
	* linux/x86_64/i386-headers.diff: Ditto.
	* linux/x86_64/makeheaders.sh: Ditto.
	* linux/x86_64/syscallent.h: Ditto.
	* mem.c (print_mmap): Always print arg[4] as int.
2002-09-23 15:41:01 +00:00
Michal Ludvig
53b320f61f 2002-09-23 Michal Ludvig <mludvig@suse.cz>
* configure.in: Fix regular expressions.
	* linux/syscall.h: Added missing braces in prototype of
	sys_getdents64().
	* file.c: Use '#ifdef LINUX' instead of '#ifdef linux'.
	(struct fileflags): Made extern to inhibit compiation warnings.
	(sys_getdents64): Merged LINUX and SVR4 part.
	* syscall.c(get_scno): Split multiline string into two distinct
	strings.
2002-09-23 13:30:09 +00:00
Wichert Akkerman
ccef63782c Merge patch from Greg Banks for Linux/SuperH support 2002-05-01 16:39:22 +00:00
Wichert Akkerman
4527dae3b8 check for negative u_errors 2002-03-31 19:03:29 +00:00
Wichert Akkerman
7b3346be42 Import lots of ia64 related changes from David Mosberger 2001-10-09 23:47:38 +00:00
John Hughes
1d08dcf46d Merge iov fixes from Richard Kettlewell 2001-07-10 13:48:44 +00:00
John Hughes
4e36a8151b Handle fork1/forkall on uw, handle rfork1,rforkall,rexecve and ssisys on uw non-stop-clusters 2001-04-18 15:11:51 +00:00
Wichert Akkerman
00a82eed2b several Linux/sparc fixes 2001-03-28 20:29:17 +00:00
Wichert Akkerman
c1652e2095 Add Linux/hppa port, patch from Richard Hirst 2001-03-27 12:17:16 +00:00
John Hughes
61eeb55be4 Fix for freebsd 4.1 2001-03-06 15:51:53 +00:00
John Hughes
bdf48f55f2 Merge Harald Bhme's solaris patches 2001-03-06 15:08:09 +00:00
John Hughes
252997128d Use pr_syscall on UW 2001-03-06 10:10:06 +00:00
Wichert Akkerman
bf79f2e16b Add FreeBSD support 2000-09-01 21:03:06 +00:00
Wichert Akkerman
16a03d2e97 test/clone.c: minor fixup
Another bunch of patches from John Hughes merged:
signal.c:
+ SVR4 printcontext(): sigset_t != sigset_t*
+ getcontext returns a value, so print on exit of syscall
+ add UC_FP to ucontext_flags for OS writers that can't spell
+ sys_signal(): special case SIG_{ERR,DFL,IGN}
+ decode_subcall(): only do subcall range checking when needed
bunch of UnixWare updates
aclocal.m4, acconfig.h, configure.in: add test for long long type
2000-08-10 02:14:04 +00:00
Wichert Akkerman
5ae21ead9f The `too much stuff, just check the ChangeLog' update 2000-05-01 01:53:59 +00:00
Wichert Akkerman
c792698a99 README-linux: updated to note that strace might not compile
with development kernels
bjm.c: sys_query_module: check if malloc succeeds
system.c: sys_cap[gs]et(): check if malloc succeeds, only malloc once
linux/syscallent.h: updated for 2.3.99pre3
linux/alpha/syscallent.h: updated for 2.3.99pre3, add all osf syscalls
even though Linux doesn't implement them
syscall.c: add global variables for MIPS registers as well
syscall.c: move global variables to before get_scno since that uses them
util.c: oops, misspelled defined
process.c: fix ptrace calls in change_syscall
mem.c: decode sys_madvise
Merge patch from Topi Miettinen <Topi.Miettinen@nic.fi>
+ add support for quotactl, fdatasync, mlock, mlockall, munlockall & acct
+ small fix for RLIMIT_* and RUSAGE_BOTH
+ enhace support for capget and capset
2000-04-10 22:22:31 +00:00
Wichert Akkerman
faf722234d test/vfork.c: new file to test vfork traces
test/.cvsignore: new file
defs.h: Up maximum number of traced processed to 64
strace.c: Disable some debugging code from davidm
implement setarg for more architectures
implement change_syscall
2000-02-19 23:59:03 +00:00
Wichert Akkerman
2ee6e45f36 Fixup isdigit calls 2000-02-18 15:36:12 +00:00
Wichert Akkerman
12f75d1a38 S390 updates 2000-02-14 16:23:40 +00:00
Wichert Akkerman
8b1b40cd8b Merge Trillian patches (Linux ia64) 2000-02-03 21:58:30 +00:00
Pavel Machek
4dc3b141be Split trace_syscall into few functions to make code readable. 2000-02-01 17:58:41 +00:00
Pavel Machek
d8ae7e332a Cleaned up __NR_SYSCALL_BASE: less number of #ifdef's in main code is
always good.
2000-02-01 17:17:25 +00:00
Wichert Akkerman
7a0b649aea Begin work on supporting clone 1999-12-23 15:08:17 +00:00
Wichert Akkerman
4dc8a2aec6 Bunch of stuff 1999-12-23 14:20:14 +00:00
Wichert Akkerman
f90da01fd1 Add Linux MIPS support 1999-10-31 21:15:38 +00:00
Wichert Akkerman
15dea97f8a Compilation updates 1999-10-06 13:06:34 +00:00
Wichert Akkerman
9ce1a63eb2 Catching up on my mail-backlog, see ChangeLog for details 1999-08-29 23:15:07 +00:00
Wichert Akkerman
b046b38593 Update sys/reg.h usage in syscall.c as well 1999-07-13 22:20:16 +00:00
Wichert Akkerman
2b483ba988 Fix conditions for including sys/reg.h and linux/ptrace.h 1999-06-24 13:55:29 +00:00
Wichert Akkerman
e6f876c49d Linux/powerpc and SunOS fixes 1999-06-22 15:28:30 +00:00
Wichert Akkerman
8829a55dc2 Various fixes, see ChangeLog for details 1999-06-11 13:18:40 +00:00
Wichert Akkerman
dacfb6ebd6 Add sparc patches from Jakub Jelinek 1999-06-03 14:21:07 +00:00