Commit Graph

56 Commits

Author SHA1 Message Date
Roland McGrath
70b08530b8 2004-04-08 Roland McGrath <roland@redhat.com>
* strace.c (main) [LINUX]: When attaching for -p, look in
	/proc/PID/task for all threads and attach them as presumed
	CLONE_THREAD children.
2004-04-09 00:25:21 +00:00
Roland McGrath
bdb09df186 2004-03-01 Roland McGrath <roland@redhat.com>
* strace.c (main): Avoid potential buffer overruns from ludicrous
	arguments or PATH values.
2004-03-02 06:50:04 +00:00
Roland McGrath
c3266d51f0 2004-02-19 Roland McGrath <roland@redhat.com>
* strace.c (main): Use TCP->pid, not PID, in -p message.
	Fixes Debian bug #229802.
2004-02-20 02:23:52 +00:00
Roland McGrath
2efe879fa8 2003-12-15 Dmitry V. Levin <ldv@altlinux.org>
* strace.c (trace) [WCOREDUMP]: Show coredump status of the
	killed process if available.
2004-01-13 09:59:45 +00:00
Roland McGrath
ce0d15442e 2003-11-11 Roland McGrath <roland@redhat.com>
* strace.c (main): Bail with usage error for missing command before we
	open the -o file or fiddle uids.
2003-11-11 21:24:23 +00:00
Roland McGrath
37b9a66dd4 2003-11-06 Roland McGrath <roland@redhat.com>
* strace.c (main): Treat piped output more like file output.
	Disallow -ff with piped output.  Fixes RH#105366.
	Reported by Dmitry V. Levin <ldv@altlinux.org>
2003-11-07 02:26:54 +00:00
Roland McGrath
b310a0c26b 2003-11-06 Roland McGrath <roland@redhat.com>
* strace.c (tprintf): Check result of vfprintf and use perror when it
	fails while not writing to stderr itself.  Fixes Debian bug #218762.
2003-11-06 23:41:22 +00:00
Roland McGrath
0a39690698 2003-06-09 Roland McGrath <roland@redhat.com>
* strace.c (trace): Print a message and newline for a WIFEXITED report
	from the process we just printed an unterminated syscall line for.
2003-06-10 03:05:53 +00:00
Roland McGrath
ed64516fa4 2003-06-03 Roland McGrath <roland@redhat.com>
* strace.c (main): In PATH search, accept only a regular file with
	execute bits set.  Fixes Debian bug #137103.
2003-06-03 07:18:19 +00:00
Roland McGrath
369310502b 2003-06-02 Roland McGrath <roland@redhat.com>
* strace.c (main): Set -q when given -o and not -p, and not when not
	given -o, to match what the man page always said.
	Fixes Debian bug #47113, #153678.
2003-06-03 01:35:20 +00:00
Roland McGrath
0962345a57 2003-05-22 Roland McGrath <roland@redhat.com>
* defs.h (struct tcb): New member `nzombies'.
	* strace.c (alloctcb): Initialize it.
	(droptcb): Increment our parent's zombie count.
	* process.c (internal_wait): Don't go into TCB_SUSPENDED if the
	process has zombies it can reap.  On the way out, if we reaped
	an untraced process, decrement the zombie count.
2003-05-23 02:27:13 +00:00
Roland McGrath
9c9a2534e3 2003-02-19 Roland McGrath <roland@redhat.com>
* version.c: Removed.
	* Makefile.am (strace_SOURCES): Remove it.
	* strace.c: Use PACKAGE_NAME and VERSION macros instead of version var.
2003-02-20 02:56:29 +00:00
Roland McGrath
de6e53308c 2003-01-21 Roland McGrath <roland@redhat.com>
* strace.c (usage): Omit -z, since it has never worked properly.
	* NEWS: Likewise.
	* strace.c (main): Grok new option `-E var=val' or `-E var' to put
	var=val in environ or to remove var, respectively.
	(usage): Mention it.
	* strace.1, NEWS: Document it.
2003-01-24 04:31:23 +00:00
Roland McGrath
8f474e087e 2003-01-13 Roland McGrath <roland@redhat.com>
* strace.c [! HAVE_STRSIGNAL]: Clean up #ifdefs on decls for
	sys_siglist and _sys_siglist.
	Reported by John Hughes <john@Calva.COM>.
2003-01-14 07:53:33 +00:00
Roland McGrath
e29341c02f 2003-01-10 Roland McGrath <roland@redhat.com>
* strace.c (droptcb): Clear flags word before calling rebuild_pollv.
2003-01-10 20:14:20 +00:00
Roland McGrath
c012d223a6 2003-01-10 Roland McGrath <roland@redhat.com>
* strace.c (rebuild_pollv): Fix typo: struct poll -> struct pollfd.
2003-01-10 20:05:56 +00:00
Roland McGrath
ca16be8be9 2003-01-10 Roland McGrath <roland@redhat.com>
* strace.c (pfd2tcb): Fix for new tcbtab type.
	(rebuild_pollv): Likewise.
	(detach): Put variables used under [LINUX] inside #ifdef.
2003-01-10 19:55:28 +00:00
Roland McGrath
e85bbfe9ab 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.
	Revamp -f support for Linux.
	* util.c [LINUX] (setbpt, clearbpt): New implementations that tweak
	the system call to be clone with CLONE_PTRACE set.  Various new static
	helper functions.
	* process.c (internal_clone): Define also #ifdef SYS_clone2.
	Initialize TCPCHILD->parent field.
	[CLONE_PTRACE]: Don't do PTRACE_ATTACH here, because it's preattached.
	Check in case the new child is in the tcb already.
	(internal_fork) [LINUX]: Just call internal_clone.
	* strace.c (trace) [LINUX]: Under -f/-F, grok an unknown pid
	reporting to wait, put it in the TCB with TCB_ATTACHED|TCB_SUSPENDED.
2003-01-09 06:53:31 +00:00
Roland McGrath
fd3e042300 2002-12-30 Roland McGrath <roland@redhat.com>
* version.c (version): Make const, bump to 4.4.90.
	* strace.c: Update decl.
2002-12-30 09:33:22 +00:00
Roland McGrath
6d2b34971b 2002-12-22 Roland McGrath <roland@redhat.com>
Update to Autoconf 2.57, and Automakify with version 1.7.
	* Makefile.am: New file.
	* Makefile.in: File removed.
	* configure.in: Moved to ...
	* configure.ac: ... here.  Update for Autoconf 2.5x and Automake.
	* aclocal.m4: Moved to ...
	* acinclude.m4: ... here.  Update for Autoconf 2.5x.
	* AUTHORS: New file, makes automake happy.
	* autogen.sh: File removed.
	* README-CVS: Update to recommend autoreconf instead.
	* file.c: HAVE_ST_* -> HAVE_STRUCT_STAT_ST_*.
	* net.c: HAVE_SIN6_SCOPE_ID -> HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID,
	HAVE_MSG_CONTROL -> HAVE_STRUCT_MSGHDR_MSG_CONTROL.
	* strace.c: *_DECLARED -> HAVE_DECL_*
	* stream.c: HAVE_* -> HAVE_STRUCT_*
2002-12-30 00:51:30 +00:00
Roland McGrath
ee9d435275 2002-12-17 Roland McGrath <roland@redhat.com>
* strace.c (tcbtab): Make this a pointer to pointers, not an array.
	(tcbtabsize): New variable.
	(main): Initialize them using dynamic allocation.
	(alloctcb, main): Use tcbtabsize in place of MAX_PROCS; indirect.
	(pid2tcb, cleanup): Likewise.
	[USE_PROCFS] (pollv): Make this a pointer, not an array; make static.
	(rebuild_pollv): Dynamically allocate the vector.
	* defs.h (tcbtab): Update decls.
	(MAX_PROCS): Macro removed, no more static limit on this.
	* process.c (fork_tcb): New function.
	(internal_clone, internal_fork): Use it instead of checking nprocs.
2002-12-18 04:16:10 +00:00
Roland McGrath
7508cb4678 2002-12-17 Roland McGrath <roland@redhat.com>
* strace.c (detach) [LINUX]: Use __WALL (or a second try with __WCLONE)
	in wait after sending SIGSTOP.
2002-12-17 10:48:05 +00:00
Roland McGrath
5bc05558bb 2002-12-16 Roland McGrath <roland@redhat.com>
* strace.c (trace) [LINUX]: Only check errno if wait4 actually fails,
	so we don't repeat a wait and thus drop a status.  Fixes RH#62591.
2002-12-17 04:50:47 +00:00
Roland McGrath
7bf10474b9 Fix botched commit. 2002-12-16 20:42:50 +00:00
Roland McGrath
553a609807 2002-12-15 Roland McGrath <roland@redhat.com>
* strace.c (main) [! USE_PROCFS]: Always reset SIGCHLD to SIG_DFL.
2002-12-16 20:40:39 +00:00
Michal Ludvig
17f8fb3484 Added switch for printing only succeeding syscalls. 2002-11-06 13:17:21 +00:00
John Hughes
b664308560 Fix warning if not using POLL_HACK 2002-05-23 11:02:22 +00:00
John Hughes
d870b3c31a fix warning will POLL_HACK 2002-05-21 11:24:18 +00:00
Wichert Akkerman
822f0c9a84 Fix closing of outputfiles in droptcb() 2002-04-03 10:55:14 +00:00
Wichert Akkerman
eb8ebdad12 close tcp->outf in droptcb() 2002-04-01 17:48:02 +00:00
John Hughes
19e49984ac only trace syscalls/signals/faults of interest 2001-10-19 08:59:12 +00:00
John Hughes
5826589d8e Merge SVR4/Linux printsiginfo 2001-10-18 15:13:53 +00:00
Wichert Akkerman
7b3346be42 Import lots of ia64 related changes from David Mosberger 2001-10-09 23:47:38 +00:00
Wichert Akkerman
54b4f79216 set CLOEXEC flag for outputfile 2001-08-03 11:43:35 +00:00
John Hughes
1d08dcf46d Merge iov fixes from Richard Kettlewell 2001-07-10 13:48:44 +00:00
Wichert Akkerman
2f1d87e74f use __WALL for wait4 if we can 2001-03-28 14:40:14 +00:00
Wichert Akkerman
2e4ffe59b5 more FreeBSD updates 2000-09-03 23:57:48 +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
7987cdf192 net.c: add SOL_PACKET and SOL_RAW socket options, update SOL_IP and SOL_TCP 2000-07-05 16:05:39 +00:00
Wichert Akkerman
bd4125c6bc Close outf fd when forking 2000-06-27 17:28:06 +00:00
Wichert Akkerman
5ae21ead9f The `too much stuff, just check the ChangeLog' update 2000-05-01 01:53:59 +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
8b1b40cd8b Merge Trillian patches (Linux ia64) 2000-02-03 21:58:30 +00:00
Wichert Akkerman
4dc8a2aec6 Bunch of stuff 1999-12-23 14:20:14 +00:00
Wichert Akkerman
ea78f0f771 Add UnixWare support to configure 1999-11-29 15:34:02 +00:00
Wichert Akkerman
9dbf15466e Add pollhack 1999-11-26 13:11:29 +00:00
Wichert Akkerman
54a4767f86 Add missing newline in error 1999-10-17 00:57:34 +00:00
Wichert Akkerman
9ce1a63eb2 Catching up on my mail-backlog, see ChangeLog for details 1999-08-29 23:15:07 +00:00