update
many, many chore
This commit is contained in:
@@ -4,57 +4,61 @@
|
||||
|
||||

|
||||
|
||||
# GDB 是什么?
|
||||
## GDB 是什么?
|
||||
|
||||
调试器,简单来说就是当你代码跑不通时候修正错误用的
|
||||
|
||||
[GDB's Mascot?](https://sourceware.org/gdb/mascot/)
|
||||
|
||||
可搭配插件 gef pwndbg pwngdb peda
|
||||
|
||||
# 基本操作
|
||||
## 基本操作
|
||||
|
||||
[GDB 快速入门教程](https://www.bilibili.com/video/BV1EK411g7Li/)
|
||||
|
||||
### <strong>GDB 使用表</strong>
|
||||
|
||||
<em>run (r)</em>运行程序
|
||||
`run (r)`运行程序
|
||||
|
||||
<em>b</em>打断点,可以在函数和位置打断点
|
||||
`b`打断点,可以在函数和位置打断点
|
||||
|
||||
<em>info b</em>查看打断点的位置
|
||||
`info b`查看打断点的位置
|
||||
|
||||
<em>n</em>下一步,跳过函数的
|
||||
`n`下一步,跳过函数的
|
||||
|
||||
<em>list</em>查看源代码
|
||||
`list`查看源代码
|
||||
|
||||
<em>-p</em>走 PID 路线
|
||||
`-p`走 PID 路线
|
||||
|
||||
edit [file:]function 看现在停下的函数位置
|
||||
`edit [file:]function` 看现在停下的函数位置
|
||||
|
||||
step 进入任何函数
|
||||
`step` 进入任何函数
|
||||
|
||||
<em>p</em>打印变量
|
||||
`p`打印变量
|
||||
|
||||
<em>shell</em>输入命令
|
||||
`shell`输入命令
|
||||
|
||||
<em>set logging on</em>记录日志
|
||||
`set logging on`记录日志
|
||||
|
||||
<em>watchpoint</em>观察变量是否变化的观察点
|
||||
`watchpoint`观察变量是否变化的观察点
|
||||
|
||||
<em>watch</em>设置观察点位置,watch*(地址)
|
||||
`watch`设置观察点位置,watch*(地址)
|
||||
|
||||
<em>layout split</em>开启 TUI 模式
|
||||
`layout split`开启 TUI 模式
|
||||
|
||||
<em>whatis</em>查看变量类型
|
||||
`whatis`查看变量类型
|
||||
|
||||
<em>ptype</em>查看详细信息
|
||||
`ptype`查看详细信息
|
||||
|
||||
#### <strong>TUI</strong>
|
||||
|
||||
<em>ctrl +x +a</em>开启
|
||||
`ctrl + x + a`开启
|
||||
|
||||
<em>ctrl</em>+<em>p</em>+<em>n</em>往前
|
||||
`ctrl + p + n`往前
|
||||
|
||||
<em>ctrl</em> +<em>l</em>重新整理页面
|
||||
`ctrl + l`重新整理页面
|
||||
|
||||
# 官方手册
|
||||
## 官方手册
|
||||
|
||||
[GDB User Manual](https://sourceware.org/gdb/current/onlinedocs/gdb)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user