Debugging Utilities

strace - trace system calls and signals
strace -f -T command strace -f -T -o /tmp/strace.out -e open,stat,access command strace -f -c -w command

ltrace - trace library calls
ltrace -f -T command

lsof - print open file informations
lsof -p pid

ldd - print shared library dependencies
ldd command

errno.h - macro definition of error codes
cat /usr/include/[al]*/errno.h

truss - trace system calls and signals
truss -f -E command

dtrace - a dynamic tracing framework
syscall::open*:entry /execname == "command"/ {    printf("%s %s", execname, copyinstr(arg0)); }
 * 1) !/usr/sbin/dtrace -s

pfiles - print open file informations
pfiles pid

ldd - print shared library dependencies
ldd command

errno.h - macro definition of error codes
cat /usr/include/sys/errno.h