gdb调试:资料http://dsec.pku.edu.cn/~yuhj/wiki/gdb.html
一般来说gdb主要调试的是c/c++的程序。要调试c/c++的程序,首先
在编译时,我们必须要把调试信息加到可执行文件中。使用编译器(
cc/gcc/g++)的 -g 参数可以做到这一点.
> cc -g hello.c -o hello
> g++ -g hello.cpp -o hello
list set listsize search forward-search reverse-search
r break n c p finish q step
break if -- condition
backtrace bt 栈
watch rwatch - awatch info watchpoints
clear delete disable enable
info threads -- break frik.c:13 thread 28 if bartab > lim
内存
info line tst.c:func
disassemble func -- dump
p 地址@长度