1268 Commits

Author SHA1 Message Date
Denys Vlasenko
b1efe53531 Fix build breakage from my previous commit.
Now I test for PT_SETOPTIONS being #defined.
Remove trailing whitespace.
No actual code changes.
2008-12-23 16:14:42 +00:00
Denys Vlasenko
1e3ce32a4f Make strace correctly handle SIGTRAP produced by e.g.
kill(2) and by trapping instruction.
* defs.h: Add sigtrap80 field to struct tcb.
* strace.c (alloc_tcb): Initialize it to SIGTRAP.
(detach): Use tcp->sigtrap80 instead of SIGTRAP constant.
(trace): Attempt to set PTRACE_O_TRACESYSGOOD and
PTRACE_O_TRACEEXEC options on each newly attached process,
distinquish between SIGTRAP and (SIGTRAP | 0x80) stops.
Fixes RH#162774 "strace ignores int3 SIGTRAP".
2008-12-22 19:14:47 +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
73ce40e9c7 two instances of s/sa_handler == SIG_DFL/sa_handler == SIG_IGN/ 2008-12-17 17:22:03 +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
5414bf7ad0 2008-11-11 Dmitry V. Levin <ldv@altlinux.org>
* sock.c [LINUX] (sock_ioctl): Parse more SIOCS* ioctls.
2008-12-10 13:51:40 +00:00
93969ec043 Add RH# bugzilla tags 2008-12-10 13:47:22 +00:00
Roland McGrath
f01b09e4b4 . 2008-12-10 06:09:34 +00:00
Roland McGrath
a09353acc6 2008-12-09 Roland McGrath <roland@redhat.com>
* strace.1 (DIAGNOSTICS): New section, describe exit behavior.
2008-12-10 06:09:29 +00:00
Denys Vlasenko
28e81da91c manpage: document new feature of propagating exit code/signal death status. 2008-12-09 14:15:56 +00:00
Denys Vlasenko
62958b2fd9 vda tests his commit powers by removing trailing whitespace from a test 2008-12-09 14:02:59 +00:00
8dd31ddfcc 2008-11-09 Dmitry V. Levin <ldv@altlinux.org>
* process.c (prctl_options): Update constants from linux 2.6.27.
2008-11-11 00:25:22 +00:00
949f451bfa 2008-11-09 Dmitry V. Levin <ldv@altlinux.org>
* system.c (capabilities): Add more capability values.
2008-11-11 00:21:09 +00:00
a501f1426e 2008-11-09 Dmitry V. Levin <ldv@altlinux.org>
* util.c (string_quote): Fix support for NUL-terminated string.
	Add comments.
	(printpathn): Fix the case when "..." was appended to the output
	but no truncation was actually made.  Add comments.
	(printstr): Fix memory allocation.  Fix two cases when "..." was
	appended to the output but no truncation was actually made.
	Add comments.
2008-11-10 23:19:13 +00:00
4371b10b30 2008-10-23 Dmitry V. Levin <ldv@altlinux.org>
Implement parsers for new linux syscalls.
	* desc.c (do_dup2, [LINUX] sys_dup3): New functions.
	(sys_dup2): Use do_dup2.
	[LINUX] (sys_epoll_create1): New function.
	[LINUX] (do_eventfd, sys_eventfd2): New functions.
	[LINUX] (sys_eventfd): Use do_eventfd.
	* net.c (do_pipe, [LINUX] sys_pipe2): New functions.
	(sys_pipe): Use do_pipe.
	* signal.c [LINUX] (do_signalfd, sys_signalfd4): New functions.
	[LINUX] (sys_signalfd): Use do_signalfd.
	* linux/syscall.h: Declare new sys_* functions.
	* linux/syscallent.h: Hook up signalfd4, eventfd2, epoll_create1,
	dup3, pipe2, inotify_init1.
	* linux/x86_64/syscallent.h: Hook up paccept, signalfd4, eventfd2,
	epoll_create1, dup3, pipe2, inotify_init1.
2008-11-10 22:53:02 +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
d915c802ef 2008-09-18 Mike Frysinger <vapier@gentoo.org>
* configure.ac: Accept uclinux hosts as linux.
2008-11-10 17:34:26 +00:00
8a550d729d 2008-10-22 Dmitry V. Levin <ldv@altlinux.org>
Handle socket type flags introduced in linux 2.6.27.
	* net.c (socktypes): Add SOCK_DCCP.
	(sock_type_flags): New xlat structure.
	(tprint_sock_type): New function.
	(sys_socket, sys_socketpair): Use it to parse socket type and
	socket type flags.
2008-11-10 17:21:23 +00:00
a68096576a 2008-09-29 Dmitry V. Levin <ldv@altlinux.org>
* strace.c (startup_child): Save child pid for future use.
	(main): Exit/kill ourself with straced child's exitcode/signal.
	(trace): If signalled process pid matches the saved child pid,
	save the signal number.  If terminated process pid matches the
	saved child pid, save its exit status.
	Patch from Denys Vlasenko <dvlasenk@redhat.com>
2008-11-10 17:14:58 +00:00
Jan Kratochvil
14256a7d26 2008-09-12 Tomas Pospisek <tpo@sourcepole.ch>
Jan Kratochvil  <jan.kratochvil@redhat.com>

	* strace.1 (DESCRIPTION): New description of unfinished system calls
	and system calls restarting.
2008-09-12 08:44:30 +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
50f6013c15 2008-04-19 Dmitry V. Levin <ldv@altlinux.org>
* process.c (sys_prctl): Decode PR_SET_PDEATHSIG, PR_GET_PDEATHSIG,
	PR_SET_DUMPABLE, PR_GET_DUMPABLE, PR_SET_KEEPCAPS, PR_GET_KEEPCAPS.
	Fix PR_GET_UNALIGN decoder.
2008-09-03 00:56:52 +00:00
f02cf214d9 2008-04-19 Dmitry V. Levin <ldv@altlinux.org>
* process.c (prctl_options): Add more constants.
2008-09-03 00:54:40 +00:00
86c26be3c8 2008-04-19 Dmitry V. Levin <ldv@altlinux.org>
* linux/syscallent.h: Use sys_prctl() decoder for "prctl" syscall.
	* linux/alpha/syscallent.h: Likewise.
	* linux/arm/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
2008-09-03 00:52:47 +00:00
93deafe50b 2008-09-02 Dmitry V. Levin <ldv@altlinux.org>
* linux/x86_64/syscallent.h: Fix syscall numbers for "tee" and
	"sync_file_range".
	From Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
2008-09-03 00:45:10 +00:00
Roland McGrath
39fcbbf19a . 2008-08-28 23:42:06 +00:00
Roland McGrath
98a3ecfa99 2008-08-28 Roland McGrath <roland@redhat.com>
* strace.1 (BUGS): New section, mention SIGTRAP interference.
2008-08-28 23:41:57 +00:00
Roland McGrath
76016daf53 . 2008-08-28 23:26:29 +00:00
Roland McGrath
3f0dbe2d47 2008-08-28 Roland McGrath <roland@redhat.com>
* strace.spec (%ifarch %{strace64_arches}): Use cp -p instead of ln
	for %{rhel} < 6.
2008-08-28 23:26:21 +00:00
Roland McGrath
09db705c51 Prepare for 4.5.18 release v4.5.18 2008-08-28 22:00:46 +00:00
Roland McGrath
a2266f7c38 . 2008-08-25 03:16:27 +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
Roland McGrath
d94020ffc1 2008-08-24 Roland McGrath <roland@redhat.com>
* linux/syscall.h (SYS_socket_subcall et al, SYS_ipc_subcall et al):
	Don't define these if [__ARM_EABI__].
	Reported by Johannes Stezenbach <js@sig21.net>.
2008-08-25 03:15:43 +00:00
Roland McGrath
85c4274934 . 2008-08-25 03:09:18 +00:00
Roland McGrath
4a6f652cb7 2008-08-24 Roland McGrath <roland@redhat.com>
* linux/powerpc/syscallent.h: Handle subpage_prot.
	* mem.c [LINUX && POWERPC] (sys_subpage_prot): New function.
	* linux/syscall.h [POWERPC]: Declare it.
	From Simon Murray <simon@transitive.com>.
2008-08-25 03:09:16 +00:00
Roland McGrath
6f677cff39 . 2008-08-25 03:00:49 +00:00
Roland McGrath
586d6ab9f2 2008-08-24 Roland McGrath <roland@redhat.com>
* mem.c (mmap_prot): Handle PROT_SAO.
	From Simon Murray <simon@transitive.com>.
2008-08-25 03:00:47 +00:00
Roland McGrath
d88e7b3b4b . 2008-08-25 02:59:39 +00:00
Roland McGrath
f4021b1466 2008-08-24 Roland McGrath <roland@redhat.com>
* mem.c (madvise_flags): Typo fixes.  Rename to madvise_cmds.
	(sys_madvise): Use printxval, not printflags.
	Reported by Rajeev V. Pillai <rajeevvp@gmail.com>.
2008-08-25 02:59:36 +00:00
Roland McGrath
459ea0b053 . 2008-08-20 01:59:42 +00:00
Roland McGrath
5f20681a25 2008-08-19 Roland McGrath <roland@redhat.com>
* signal.c (sys_sigaction, sys_rt_sigaction): Don't omit the rest of
	the struct after sa_handler is a known constant.  Some sa_flags bits
	have meaning even for SIG_IGN/SIG_DFL.
2008-08-20 01:59:40 +00:00
Jan Kratochvil
ab971652ac . 2008-08-06 21:43:53 +00:00
Jan Kratochvil
8fc9575e0b 2008-08-06 Jan Kratochvil <jan.kratochvil@redhat.com>
* util.c (CLONE_VM): Define if not defined already.
	(setbpt): Clear CLONE_VM in the case we already clear CLONE_VFORK for
	SYS_clone and SYS_clone2.
	Reported by Michal Nowak.
	Fixes RH#455078.
2008-08-06 21:43:35 +00:00
Jan Kratochvil
3aba527d45 . 2008-08-06 21:39:51 +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
21aa995745 . 2008-08-01 01:15:27 +00:00
Roland McGrath
1cdfb8f96b 2008-07-31 Roland McGrath <roland@redhat.com>
* Makefile.am (EXTRA_DIST): Add new linux/arm/ files.
2008-08-01 01:15:24 +00:00
Roland McGrath
649afd0b69 . 2008-08-01 01:13:30 +00:00
Roland McGrath
c531e571fe 2008-07-31 Roland McGrath <roland@redhat.com>
* file.c [LINUX] (struct kernel_dirent): Define it locally,
	do not use <linux/dirent.h>.
	Fixes RH#457291.
2008-08-01 01:13:10 +00:00