普通断点
- 加断点的方式- 通过函数名- 举例- C语言函数- objc_alloc_init
- UIApplicationMain
- awemeMain
 
- iOS的OjbC函数- +[NSString stringWithUTF8String:]
- -[AppDelegate application:didFinishLaunchingWithOptions:]
- -[AWEUserRecommendFollowButton updateWithFollowStatus:followerStatus:preferredTitle:]
- -[AAUISignInController _performAuthenticationForAccount:serviceType:inViewController:completion:]
 
 
- C语言函数
 
- 举例
- 通过地址- 举例- 0x0000000100d5bbb0
- 0x1830c6a80
 
 
- 举例
 
- 通过函数名
- 如何加断点 - Xcode图形界面- 通过函数名加断点- Xcode->- Breakpoint Navigator->点击- 左下角的加号➕=- Create a breakpoint->- Symbolic Breakpoint
- 出现符号断点的弹框页面
- 在Symbol中输入对应的函数名,比如objc_alloc_init,即可添加完毕普通的函数名的断点
 
- 给 某函数地址=某行汇编代码 加断点- 对于调试期间,左键点击Xcode调试界面中,汇编代码的所在行的左边,即可新增断点
- 另外,如果需要编辑或删除,右键断点即可操作
 
- 对于调试期间,左键点击Xcode调试界面中,汇编代码的所在行的左边,即可新增断点
 
- 通过函数名加断点
- lldb命令行 - 快捷方式添加b FunctionName b SomeAddress- 举例b objc_alloc_init b 0x1830c6a80(lldb) b 0x10104F698 Breakpoint 4: where = mobileactivationd`getPcrt_1000075C0 + 216, address = 0x000000010104f698
 
- 举例
- 完整命令添加 - breakpoint set --name FunctionName breakpoint set --address SomeAddress- 常用命令的缩写 - br s -n FunctionName br s -a SomeAddress breakpoint set -a {二进制库的实际ASLR基地址} + {二进制内偏移量地址}
- 举例breakpoint set --name objc_alloc_init breakpoint set --name "-[NSString stringByAppendingString:]" breakpoint set --address 0x1830c6a80- 输出效果(lldb) breakpoint set -a 0x0000000103400010 Breakpoint 12: where = AppleStoreCore`static AppleStoreCore.User.initialize() -> (), address = 0x0000000103400010- 加上断点后list查看确认(lldb) breakpoint set -a 0x1102d3348 Breakpoint 54: where = AwemeCore`___lldb_unnamed_symbol1462804$$AwemeCore + 480, address = 0x00000001102d3348 (lldb) breakpoint list Current breakpoints: … 54: address = AwemeCore[0x000000000ee2b348], locations = 1, resolved = 1, hit count = 0 54.1: where = AwemeCore`___lldb_unnamed_symbol1462804$$AwemeCore + 480, address = 0x00000001102d3348, resolved, hit count = 0
 
- 加上断点后list查看确认
 
- 输出效果
 
- 语法详见:breakpoint的help语法
 
- 快捷方式添加
 
- Xcode图形界面




