Skip to content

Instantly share code, notes, and snippets.

@upbit
Created March 30, 2015 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save upbit/7d00368a3a51761080f8 to your computer and use it in GitHub Desktop.
Save upbit/7d00368a3a51761080f8 to your computer and use it in GitHub Desktop.
lldb远程调试
on iOS:
/Developer/usr/bin/debugserver *:1234 -a "RankingLog"
on Mac:
lldb
(lldb) platform select remote-ios
(lldb) process connect connect://192.168.1.100:1234
【lldb命令】
http://lldb.llvm.org/lldb-gdb.html
查看基址
(lldb) image list -o -f RankingLog
[ 0] 0x000e3000 /private/var/mobile/Containers/Bundle/Application/02E08E10-7692-4877-A23F-E6B10A2921E3/RankingLog.app/RankingLog(0x00000000000e7000)
下断点在代码 0x00012958
00012958 mov r6, r0
0001295a cbz r6, 0x1298a
(lldb) br s -a 0xf5958
Breakpoint 1: where = RankingLog`RankingLog[0x00012958], address = 0x000f5958
显示内存数据
(lldb) memory read --size 1 --format x --count 16 0xf5958
(lldb) x -s1 -fx -c16 0xf5958
(lldb) x/16xb 0xf5958
(lldb) x -s4 -fx -c4 0xf5958
(lldb) x/4xw 0xf5958
反汇编(指令集问题)
(lldb) disassemble --start-address 0xf5958 --count 10
(lldb) dis -s 0xf5958 -c 10
查看寄存器
(lldb) register read
(lldb) register read r0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment