By @sskaje
Link: https://sskaje.me/2018/03/lldb-%e6%96%ad%e7%82%b9%e8%87%aa%e5%8a%a8%e6%89%a7%e8%a1%8c%e5%91%bd%e4%bb%a4/
Link: https://sskaje.me/2018/03/lldb-%e6%96%ad%e7%82%b9%e8%87%aa%e5%8a%a8%e6%89%a7%e8%a1%8c%e5%91%bd%e4%bb%a4/
调试某软件,需要取到断点时候的内存数据。
之前是每次到断点,一个地址一个地址地 p 或者 memory read,后来看到 breakpoint command 命令,于是有了:
添加断点
1 2 |
(lldb) breakpoint set -a 0x100110000 Breakpoint 1: where = someapp`___lldb_unnamed_symbol10122$$global, address = 0x0000000100110000 |
添加命令
1 2 |
(lldb) breakpoint command add 1.1 Enter your debugger command(s). Type 'DONE' to end. |
输入命令
1 2 3 |
> memory read -f Y -c 0x100 $x1 > memory read -f Y -c 0x100 $x2 > DONE |
这样,每次运行到断点的时候,就会执行这两条命令。
lldb 断点自动执行命令 by @sskaje: https://sskaje.me/2018/03/lldb-%e6%96%ad%e7%82%b9%e8%87%aa%e5%8a%a8%e6%89%a7%e8%a1%8c%e5%91%bd%e4%bb%a4/
Incoming search terms:
Link to this post!