Android GDB 调试.
Signed-off-by: rick.chan <chenyang@autoai.com>
This commit is contained in:
parent
0223601d04
commit
3cd25d518c
|
@ -7,7 +7,7 @@ GDBServer 用于与 GDB 配合工作,以实现远程调试。在 Host 上开
|
|||
gdbserver 的使用非常简单,只要在某个端口上开启监听就可以:
|
||||
|
||||
```bash
|
||||
gdbserver [listen ip]:<listen port> <program>
|
||||
gdbserver [listen ip]:<listen port> <program> [--args <arglist>]
|
||||
```
|
||||
|
||||
## Host 端
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
# GDB 的使用
|
||||
|
||||
## 伪图形窗口
|
||||
|
||||
```bash
|
||||
(gdb)tui enable
|
||||
```
|
||||
|
||||
## 断点
|
||||
|
||||
```bash
|
||||
# location 可以为:linenum,filename:linenum,+offset,-offset,function,filename:function
|
||||
(gdb) break <location>
|
||||
(gdb) b <location>
|
||||
# 查看当前设置的断点信息
|
||||
(gdb) info breakpoints
|
||||
# 删除断点
|
||||
(gdb) delete [breakpoints num] [range...]
|
||||
(gdb) d [breakpoints num] [range...]
|
||||
# 清除全部断点
|
||||
(gdb) clear
|
||||
# 删除所选定的环境中所有的断点
|
||||
(gdb) clear <location>
|
||||
```
|
||||
|
||||
## 变量查看
|
||||
|
||||
```bash
|
||||
(gdb) p <variable>
|
||||
(gdb) p <file::variable>
|
||||
(gdb) p <function::variable>
|
||||
```
|
|
@ -0,0 +1,3 @@
|
|||
# 使用 GDB 调试 Native 程序
|
||||
|
||||
TODO: <https://source.android.google.cn/devices/tech/debug/gdb?hl=zh-cn>
|
Loading…
Reference in New Issue