dwarfdump --arch=arm64 --lookup

解析友盟错误信息重要指令:
dwarfdump --arch=arm64 --lookup 0x1001edbc4 /Users/zhoujunbo/Library/Developer/Xcode/Archives/2016-06-21/SSPendi 16-6-21 下午2.23.xcarchive/dSYMs/SSPendi.app.dSYM/Contents/Resources/DWARF/SSPendi

0x1001edbc4是友盟报错的地址,我们只需要把地址换为自己app的地址即可,然后敲回车,终端就会显示这样一串信息

0x003ab47e: Compile Unit: length = 0x000026ba  version = 0x0002  abbr_offset = 0x00000000  addr_size = 0x08  (next CU at 0x003adb3c)

0x003ab489: TAG_compile_unit [1] *
             AT_producer( "Apple LLVM version 7.3.0 (clang-703.0.31)" )
             AT_language( DW_LANG_ObjC )
             AT_name( "/Users/zhoujunbo/Documents/SVN/SSPendi/ECSDKDemo_OC/Custom/DB/IMCommon.m" )
             AT_stmt_list( 0x00121122 )
             AT_comp_dir( "/Users/zhoujunbo/Documents/SVN/SSPendi" )
             AT_APPLE_optimized( 0x01 )
             AT_APPLE_major_runtime_vers( 0x02 )
             AT_low_pc( 0x00000001001ed7a0 )
             AT_high_pc( 0x00000001001ee82c )

0x003ac6f2:     TAG_subprogram [35] *
                 AT_low_pc( 0x00000001001edb14 )
                 AT_high_pc( 0x00000001001edc44 )
                 AT_frame_base( reg29 )
                 AT_object_pointer( {0x003ac711} )
                 AT_name( "-[IMMessageObj dealloc]" )
                 AT_decl_file( "/Users/zhoujunbo/Documents/SVN/SSPendi/ECSDKDemo_OC/Custom/DB/IMCommon.m" )
                 AT_decl_line( 64 )
                 AT_prototyped( 0x01 )
                 AT_APPLE_optimized( 0x01 )
Line table dir : '/Users/zhoujunbo/Documents/SVN/SSPendi/ECSDKDemo_OC/Custom/DB'
Line table file: 'IMCommon.m' line 74, column 10 with start address 0x00000001001edbc4

然后,我们可以分析得到是在IMCommon.m文件中的第74行第10列崩溃的,就可以直接定位到错误的地方,然后分析出错的代码,fix掉就可以了。


原文地址:https://www.cnblogs.com/feng9exe/p/7987146.html