如何知道block是被哪里调用的?

以下是打印的函数调用栈,我想知道,怎么才能找出,是哪里调用了这个block?也就是哪里调用的:RCTNetwork!__38-[RCTNetworking sendRequest:callback:]_block_invoke这个。

    0x104affa68 RCTNetwork!-[RCTHTTPRequestHandler sendRequest:withDelegate:]
    0x104b06c94 RCTNetwork!-[RCTNetworkTask start]
    0x104b03acc RCTNetwork!-[RCTNetworking sendRequest:responseType:incrementalUpdates:responseSender:]
    0x104b0520c RCTNetwork!__38-[RCTNetworking sendRequest:callback:]_block_invoke
    0x1ad994298 libdispatch.dylib!_dispatch_call_block_and_release
    0x1ad995280 libdispatch.dylib!_dispatch_client_callout
    0x1ad93dfa8 libdispatch.dylib!_dispatch_lane_serial_drain$VARIANT$mp
    0x1ad93ea84 libdispatch.dylib!_dispatch_lane_invoke$VARIANT$mp
    0x1ad948518 libdispatch.dylib!_dispatch_workloop_worker_thread
    0x1f36045a4 libsystem_pthread.dylib!_pthread_wqthread

去反汇编代码找到这个block 的引用位置就是他的调用位置, block 是先声明再使用

本质是定位多线程的最初调用点。先找到block的函数地址,接着根据堆栈确定应用起始了哪一类的多线程函数,一般dispatch最常用。最后hook dispatch的api组,捕获block地址。这种方法几乎是通杀。