GDB guide
(gdb) r // run
(gdb) c // continue
(gdb) q // quit gdb
(gdb) h // help
(gdb) kill // kill process
(gdb) next // not into function
(gdb) step // into function
1. Breakpoint.
(gdb) b linenum|function // set breakpoint at the line number or function
(gdb) b filename: linenum|function // set breakpoint at line number or function of filename
(gdb) b // set breakpoint at next instruction of stack, run one instruction at least
(gdb) info b // list all break infomation
(gdb) info b n // list breakpoint infomation by breaknum
(gdb) b ... if condition // set breakpoint if conditon is true
(gdb) disable|enable|delete breaknum // disable or enable or delete breakpoint by breaknum
(gdb) del // delete all breakpoint
(gdb) clear linnum // clear line number of breakpoint
2 print
(gdb) p variable // print variable value
(gdb) p variable = value // set and print variable value
3 List codes
(gdb) list // 显示目前执行程序代码前后各五行的程序代码;或是显示从上次 list 之后的程序代码
(gdb) list linenum
(gdb) list function //显示该程序开始处前后五行的程序代码。
(gdb) list - //上次显示程序代码的前面的十行
阅读(1063) | 评论(0) | 转发(0) |