Debugging Utilities

strace - trace system calls and signals
strace -f -T 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
#!/usr/sbin/dtrace -s syscall::open*:entry /execname == "command"/ {     printf("%s %s", execname, copyinstr(arg0)); }

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