Home | 简体中文 | 繁体中文 | 杂文 | 打赏(Donations) | ITEYE 博客 | OSChina 博客 | Facebook | Linkedin | 知乎专栏 | Search | Email

第 25 章 调试工具

目录

25.1. lsof - list open files
25.2. ftop - Tool to show progress of open files and file systems
25.3. strace - trace system calls and signals
25.3.1. -o file -- send trace output to FILE instead of stderr
25.4. ltrace - A library call tracer
25.5. ldd - print shared library dependencies
25.6. Valgrind
25.7. nm - list symbols from object files
25.8. objdump - display information from object files.
25.9. readelf - Displays information about ELF files.

25.1. lsof - list open files

neo@netkiller:~/workspace/Document$ lsof -p $$
COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF   NODE NAME
zsh     4536  neo  cwd    DIR    8,6     4096     30 /home/neo/workspace/Document
zsh     4536  neo  rtd    DIR    8,1     4096      2 /
zsh     4536  neo  txt    REG    8,1   675792   6907 /bin/zsh4
zsh     4536  neo  mem    REG    8,1    68824  56594 /usr/lib/zsh/4.3.10/zsh/computil.so
zsh     4536  neo  mem    REG    8,1    41000  30570 /usr/lib/zsh/4.3.10/zsh/parameter.so
zsh     4536  neo  mem    REG    8,1    31512  53350 /usr/lib/zsh/4.3.10/zsh/zutil.so
zsh     4536  neo  mem    REG    8,1   153096  53354 /usr/lib/zsh/4.3.10/zsh/complete.so
zsh     4536  neo  mem    REG    8,1   290888  56596 /usr/lib/zsh/4.3.10/zsh/zle.so
zsh     4536  neo  mem    REG    8,1    10544  30579 /usr/lib/zsh/4.3.10/zsh/terminfo.so
zsh     4536  neo  mem    REG    8,1    51712  19594 /lib/libnss_files-2.11.1.so
zsh     4536  neo  mem    REG    8,1    43552  23798 /lib/libnss_nis-2.11.1.so
zsh     4536  neo  mem    REG    8,1    97256  15503 /lib/libnsl-2.11.1.so
zsh     4536  neo  mem    REG    8,1    35712  16431 /lib/libnss_compat-2.11.1.so
zsh     4536  neo  mem    REG    8,1    18704   1902 /lib/libattr.so.1.1.0
zsh     4536  neo  mem    REG    8,1  1568136   7583 /lib/libc-2.11.1.so
zsh     4536  neo  mem    REG    8,1   534832  11379 /lib/libm-2.11.1.so
zsh     4536  neo  mem    REG    8,1   323640   7295 /lib/libncursesw.so.5.7
zsh     4536  neo  mem    REG    8,1    14696  11378 /lib/libdl-2.11.1.so
zsh     4536  neo  mem    REG    8,1    18888   5099 /lib/libcap.so.2.17
zsh     4536  neo  mem    REG    8,1   136936   7487 /lib/ld-2.11.1.so
zsh     4536  neo  mem    REG    8,1   256324 145156 /usr/lib/locale/en_US.utf8/LC_CTYPE
zsh     4536  neo  mem    REG    8,1       54 131099 /usr/lib/locale/en_US.utf8/LC_NUMERIC
zsh     4536  neo  mem    REG    8,1     2454 145158 /usr/lib/locale/en_US.utf8/LC_TIME
zsh     4536  neo  mem    REG    8,1  1170770 145157 /usr/lib/locale/en_US.utf8/LC_COLLATE
zsh     4536  neo  mem    REG    8,1      286 145159 /usr/lib/locale/en_US.utf8/LC_MONETARY
zsh     4536  neo  mem    REG    8,1       57 145160 /usr/lib/locale/en_US.utf8/LC_MESSAGES/SYS_LC_MESSAGES
zsh     4536  neo  mem    REG    8,1    26048  73711 /usr/lib/gconv/gconv-modules.cache
zsh     4536  neo  mem    REG    8,1       34 131105 /usr/lib/locale/en_US.utf8/LC_PAPER
zsh     4536  neo  mem    REG    8,1       77 131106 /usr/lib/locale/en_US.utf8/LC_NAME
zsh     4536  neo  mem    REG    8,1      155 145161 /usr/lib/locale/en_US.utf8/LC_ADDRESS
zsh     4536  neo  mem    REG    8,1       59 145162 /usr/lib/locale/en_US.utf8/LC_TELEPHONE
zsh     4536  neo  mem    REG    8,1       23 131109 /usr/lib/locale/en_US.utf8/LC_MEASUREMENT
zsh     4536  neo  mem    REG    8,1      373 145163 /usr/lib/locale/en_US.utf8/LC_IDENTIFICATION
zsh     4536  neo    0u   CHR  136,0      0t0      3 /dev/pts/0
zsh     4536  neo    1u   CHR  136,0      0t0      3 /dev/pts/0
zsh     4536  neo    2u   CHR  136,0      0t0      3 /dev/pts/0
zsh     4536  neo   10u   CHR  136,0      0t0      3 /dev/pts/0