Comments (4)
说法是不是反了,以pod形式引入组件相当于引入一个Framework,mth_stack_backtrace_of_thread的偏移理当是在这个Framework里面吧。
from mthawkeye.
有点笔误。
通过pod导入之后,mth_stack_backtrace_of_thread的偏移是在这个Framework中,所以在调用栈回溯的时候是可以正常回溯的。
但是如果是手动导入的话,mth_stack_backtrace_of_thread在主项目MachO文件的Dynamic Load Info中,在调用栈回溯时,当回溯到mth_stack_backtrace_of_thread方法时即停止,无法回溯更上层方法。
具体我写了一个Demo,其中手动引入了与mth_stack_backtrace.hm代码一致的两个文件,并重命名相关内容。之后在同一个位置使用两个文件来回溯调用栈,得到的信息如下:
手动导入:
0x7fff51b5adfa---mach_msg_trap
0x105bdb70b---_ZNK16ImageLoaderMachO24getExportedSymbolAddressEPKN11ImageLoader6SymbolERKNS0_11LinkContextEPKS0_bPKc
0x105bd4b5e---_ZNK11ImageLoader25findExportedSymbolAddressERKNS_11LinkContextEPKcPKS_ibPS6_Pm
0x105bdf8d8---ZN26ImageLoaderMachOCompressed15resolveTwolevelERKN11ImageLoader11LinkContextEPKcPKS0_S7_jbbPS7
0x105bdfb46---_ZN26ImageLoaderMachOCompressed7resolveERKN11ImageLoader11LinkContextEPKchlPPKS0_PNS_10LastLookupEb
0x105c1b86b---GCC_except_table4
Pod导入:
0x7fff51b5adfa---mach_msg_trap
0x7fff51b61ae6---thread_get_state
0x105b933fe---mth_stack_backtrace_of_thread
0x105b86c6d----[ViewController touchesEnded:withEvent:]
0x7fff48cb94e1---forwardTouchMethod
0x7fff48cb95b0----[UIResponder touchesEnded:withEvent:]
0x7fff48cc858b----[UIWindow _sendTouchesForEvent:]
0x7fff48cca310----[UIWindow sendEvent:]
0x7fff48ca4754----[UIApplication sendEvent:]
0x7fff48d2f551---__dispatchPreprocessedEventFromEventQueue
0x7fff48d32715---__handleEventQueueInternal
0x7fff48d28fb8---__handleHIDEventFetcherDrain
0x7fff23da0d30---CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION
0x7fff23da0c5b---__CFRunLoopDoSource0
0x7fff23da0433---__CFRunLoopDoSources0
0x7fff23d9b02d---__CFRunLoopRun
0x7fff23d9a943---CFRunLoopRunSpecific
0x7fff38ba6c19---GSEventRunModal
0x7fff48c8b9eb---UIApplicationMain
0x105b870a1---main
0x7fff51a231fc---start
可以看出如果手动导入mth_stack_backtrace文件时,它的回溯功能是不完全的。
from mthawkeye.
@mademao 我没看太懂,你这个Demo是dyld加载后第一次读取镜像符号显示上面那段把?后面再次点击手动导入跟pod导入显示的堆栈符号是一致的。可以请教一下@euanchan
from mthawkeye.
@hello-david “后面再次点击手动导入跟pod导入显示的堆栈符号是一致的”,这个结论应该是在模拟器上得出的吧。可以尝试连接真机,真机每次点击手动导入显示的堆栈符号都不完整。
另外我目前找到了一个解决方案:调整手动导入所在工程最低编译版本低于iOS13.0即可解决问题。这也应该是pod导入不存在堆栈显示不完整问题的原因。
至于为什么最低编译版本在iOS13之上时候会出现这个问题,可能是苹果对编译过程做了调整,具体原因还需要抽空调研一下。
from mthawkeye.
Related Issues (20)
- 真机崩 HOT 4
- 需要指定依赖 CocoaLumberjack 的版本 HOT 1
- FLEX版本依赖升级为4.0.0,uiwebview改为了wkwebview
- 动态库问题 HOT 1
- 项目中使用的AFNetworking的网络库,没有hook到项目中的任何请求 HOT 2
- Ability to use MTHawkeye on jailbroken phones without app modifications HOT 1
- FBRetainCycleDetector array has incomplete element type struct rec_rebinding
- MTHNetworkObserver类ReceiveData里面appendData的时候,会报NSMallocException内存错误 HOT 3
- 0.12.2 找不到,还没推么? HOT 1
- 'FLEX/FLEXImagePreviewViewController.h' file not found HOT 3
- 开启 Allocation 之后启动就崩 HOT 1
- 崩溃:-[NSURLResponse statusCode]: unrecognized selector sent to instance HOT 1
- Swift方法调用的耗时监测
- 在不使用cocoapods的前提下,如何集成MTHawkeye? HOT 2
- Where is release? HOT 2
- 内存监控使用__syscall_logger是否 能够审核通过
- 开启大块内存监控有问题啊,开启不了啊
- 大块内存阈值设置成 0 ,界面会卡死
- 0.12.8卡主线程
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mthawkeye.