Track all ObjC method calls?

后端 未结 5 1410
一整个雨季
一整个雨季 2020-11-28 11:31

Sometimes when looking at someone else\'s large Objective-C program, it is hard to know where to begin.

In such situations, I think it would be helpful to log every

5条回答
  •  情话喂你
    2020-11-28 12:01

    That's an interesting question. The answer would be more interesting if the solution supported multiple execution threads and there were some sort of call timeline that could report the activity over time (maybe especially with user events plotted in somehow).

    I usually fire up the debugger, set a breakpoint at the main entry point (e.g. - applicationDidFinishLaunching:withOptions:) and walk it in the debugger.

    On OSX, there are also some command-line tools (e.g. sample and heap) that can provide some insight.

    It seems like some kind of integration with instruments could be really cool, but I am not aware of something that does exactly what you're wanting (and I want it now too after thinking about it).

    If one were to log a thread number, and call address, and some frame details, it seems like the pieces would be there to plot the call timeline. The logic for figuring out the appropriate library (Apple-provided or third party) should exist in Apple's symbolicatecrash script.

提交回复
热议问题