Forum OpenACS Q&A: ptrace-like utility for Mac OS X?

Collapse
Posted by Bruno Mattarollo on
Does anyone know a "ptrace" like utility for Mac OS X? Something that would allow me to attach to a process and see the function calls and what's happening? I have that utility in Linux but the only reference that I found in Mac OS X is a ptrace function in C ...
Collapse
Posted by mark dalrymple on
Does anyone know a "ptrace" like utility for Mac OS X? "ptrace()" is the process tracing stuff that debuggers can use. Other platforms have "truss" (Solaris) and "strace" (Linux) to show system calls. Mac OS X has "ktrace". It's a two-stage deal: ktrace your program and you'll get a ktrace.out file. Then run kdump to see the results. You can see stuff in real-time by doing a "kdump -l". The ktrace and kdump man pages have details.