A program to trace execution of another program

Hi,

I wanted to know if i can write a program using switches and signals, etc to trace execution of other unix program which calls c program internally.

If yes how? If not with signals and switches then are there any other methods apart from debugging with gdb/dbx.

Perhaps you might read the source code of strace command. I think it is what you want.

Hope it helps!

This functionality uis usually predicated on the ptrace (man ptrace) function under unixes. The userspace toolset depends. *BSD has ktrace, linux has strace, and solaris10 has a different method based on dtrace. Older solaris and aix has truss, HP-UX 11+ uses tusc.

hey thanks tusc seems good.