GDB 初探索(编程可阅览)
请在开始进行 C 语言编程之后查阅使用
GDB 是什么?
调试器,简单来说就是当你代码跑不通时候修正错误用的
可搭配插件 gef pwndbg pwngdb peda
基本操作
GDB 使用表
run (r)运行程序
b打断点,可以在函数和位置打断点
info b查看打断点的位置
n下一步,跳过函数的
list查看源代码
-p走 PID 路线
edit [file:] function 看现在停下的函数位置
step 进入任何函数
p打印变量
shell输入命令
set logging on记录日志
watchpoint观察变量是否变化的观察点
watch设置观察点位置,watch*(地址)
layout split开启 TUI 模式
whatis查看变量类型
ptype查看详细信息
TUI
ctrl +x +a开启
ctrl+p+n往前
ctrl +l重新整理页面
官方手册
有非常多高级用法,可以在必要的时候进行查阅,受益无穷