环境变量:
MALLOC_CHECK_ can set to 0,1,2,3
0 不产生错误信息,也不中止程序
1 产生错误信息,但不中止程序
2 不产生错误信息,但中止程序
3 产生错误信息,并且中止程序
命令:
gdb -- The GNU debuger
strace -- trace system calls and signals
nm -- list symbols from object files
lsof -- list open files
ld -- The GNU linker
ldconfig -- configure dynamic linker run time bindings
工具:
library & system call trace:
> ltrace , strace
memcheck:
valgrind --tool=memcheck ./prog
MEMWATCH
YAMD(Yet Another Malloc Debugger)
debuggers:
gdb , ddd
kgdb
kdb
Dump Facility:
linux kernel crash dump - lkcd
Linux Trace Toolkit:
ltt
Custom Kernel Instrumentation:
dprobes
Special Console functions:
Magic SysReq key
Error/Debug Messages
System error logs:
/var/log/*
dmesg
Syslog
Console
application debug level
reference:
1. Mastering Linux debugging techniques
http://www.ibm.com/developerworks/linux/library/l-debug/
2. Ten Commands Every Linux Developer Should Know
3. ~ygz/378-03S/IBM-debug.pdf
4. GNU GDB Debugger Command Cheat Sheet
阅读(1345) | 评论(0) | 转发(0) |