Xcode - 查看内存数据 | lldb指令

如何查看内存数据

1 - 断点配置:Debug\Debug Workflow\View Memory

复制代码
 1 #import <Foundation/Foundation.h>
 2 @interface Student : NSObject{
 3     @public
 4     int _no;
 5     int _age;
 6 }
 7 
 8 @end
 9 
10 @implementation Student
11 
12 @end
13 
14 int main(int argc, const char * argv[]) {
15     
16     Student *stu = [[Student alloc] init];
17     stu->_no = 4;
18     stu->_age = 5;
19 
20     NSLog(@"%@",stu);
21     return 0;
22     
23 }
复制代码

在第 20 行打上断点,stu 内分布状况如图所示:获取前 16个字节,从右至左读取

2 - 使用 lldb 指令,同样要打上断点

① 常用指令

② 如何使用:将 _no = 4 修改成了 _no = 8

 

posted on   低头捡石頭  阅读(810)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· DeepSeek “源神”启动!「GitHub 热点速览」
· 我与微信审核的“相爱相杀”看个人小程序副业
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库
· 上周热点回顾(2.17-2.23)
< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8

导航

统计

点击右上角即可分享
微信分享提示