Open tripleCC opened 5 years ago
@tripleCC 代码看了下是处理的, 看一下这个的实现 :
static dyld_image_info app_image_info = {0}; // Infos of all app images including embeded frameworks
凡是二进制的路径包含了 app 包名,默认都是 app 里的二进制,然后 app_image_info 的起始地址和结束地址拿这几个库的地址范围取 MIN 和 MAX。
@tripleCC 代码看了下是处理的, 看一下这个的实现 :
static dyld_image_info app_image_info = {0}; // Infos of all app images including embeded frameworks
凡是二进制的路径包含了 app 包名,默认都是 app 里的二进制,然后 app_image_info 的起始地址和结束地址拿这几个库的地址范围取 MIN 和 MAX。
嗯,看到了,不过部分系统库的地址可能会出现在 app_image_info 的起始地址和结束地址之间,如果这样处理,是否会把系统库的 mmap 也算进去。
MatrixDemo 0x10a39a000 主 image
libBacktraceRecording.dylib 0x10a673000 系统的
ynamic.framework/Dynamic 0x10a8df000 自定义动态库
@tripleCC 代码看了下是处理的, 看一下这个的实现 : https://github.com/Tencent/matrix/blob/8e80e452d7100be9e67d4f6d9678aa4bcf88b73c/matrix/matrix-iOS/Matrix/WCMemoryStat/MemoryLogger/StackFrames/dyld_image_info.cpp#L80
static dyld_image_info app_image_info = {0}; // Infos of all app images including embeded frameworks 凡是二进制的路径包含了 app 包名,默认都是 app 里的二进制,然后 app_image_info 的起始地址和结束地址拿这几个库的地址范围取 MIN 和 MAX。
嗯,看到了,不过部分系统库的地址可能会出现在 app_image_info 的起始地址和结束地址之间,如果这样处理,是否会把系统库的 mmap 也算进去。
MatrixDemo 0x10a39a000 主 image libBacktraceRecording.dylib 0x10a673000 系统的 ynamic.framework/Dynamic 0x10a8df000 自定义动态库
确实简单处理了,得想想有没有更好的做法。
is_stack_frames_should_skip 判断逻辑有个疑问
判断用的 app_image_info 结构记录的是主 image 的,主 image 依赖的所以动态库在下面这个语句中会返回 true :
这个是否应该把 is_app_image 为 true 的 这些动态库也一并计入?