让crash文件中的内存地址变成函数名称

来源:互联网 发布:阿里云解析域名过程 编辑:程序博客网 时间:2024/06/05 04:39

http://blog.chukong-inc.com/index.php/2012/07/05/让crash文件中的内存地址变成函数名称/




formats

让crash文件中的内存地址变成函数名称

Published on 2012 年 7 月 5 日, by wang cunkai in iOS技术, 游戏相关.

假如程序员编译了inhouse给测试。

如果在测试过程中出现奔溃现象,我想程序员一般会来看Device Log 也就是 crash文件

如果crash文件遇到如下的情况,在重要的地方看不到函数名称。我想是一件很奔溃的事情。

Source code   
Exception Type:  EXC_BAD_ACCESS (SIGSEGV)Exception Codes: KERN_INVALID_ADDRESS at 0x00000000Crashed Thread:  0 Thread 0 name:  Dispatch queue: com.apple.main-threadThread 0 Crashed:0   libsystem_c.dylib             0x37c0fe54 strlen + 121   libstdc++.6.dylib             0x38202410 std::string::operator=(char const*) + 82   FishingJoy                    0x003423a0 0x1000 + 34128963   FishingJoy                    0x00342b90 0x1000 + 34149284   FishingJoy                    0x002fb3e0 0x1000 + 31221445   FishingJoy                    0x002fae3c 0x1000 + 31207006   CoreFoundation                0x380b4224 -[NSObject performSelector:withObject:] + 367   FishingJoy                    0x002d5614 0x1000 + 29670608   CoreFoundation                0x380b4224 -[NSObject performSelector:withObject:] + 369   Foundation                    0x3548e750 __NSThreadPerformPerform + 34410  CoreFoundation                0x38129afc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 811  CoreFoundation                0x3812935e __CFRunLoopDoSources0 + 35812  CoreFoundation                0x3812806e __CFRunLoopRun + 64613  CoreFoundation                0x380ab4d6 CFRunLoopRunSpecific + 29414  CoreFoundation                0x380ab39e CFRunLoopRunInMode + 9815  GraphicsServices              0x37e82fc6 GSEventRunModal + 15016  UIKit                         0x31c2b73c UIApplicationMain + 108417  FishingJoy                    0x0000389c 0x1000 + 1039618  FishingJoy                    0x0000383c 0x1000 + 10300

其实我们可以还原出函数名称,现在需要软件“symbolicatecrash”(点击下载)和编译这台inhouse的电脑。

1、先下载symbolicatecrash,放入一个干净的目录下。顺便把crash文件也拖入此目录。

2、先把app文件给弄出来,步骤Xcode -> Window -> Organizer -> Archives -> 右击给测试的包->“Show in Finder”->“显示包内容”->复制目录“Products/Applications/”下面的.app到symbolicatecrash同级目录下。

3、打开终端(terminal)首先把symbolicatecrash拖入终端,现在终端会显示symbolicatecrash的地址并在末尾加入空格,不要回车然后依次把crash和app都拖入终端。

现在终端应该是(我在这里因为举例,先去掉绝对目录地址。大家看到的应该是一堆):

symbolicatecrash  a.crash  a.app

在末尾加入输出地址:

symbolicatecrash  a.crash  a.app  >  b.crash  回车。

现在去输出地址看 b.crash,应该已经成功显示函数名称了。呵呵~

Source code   
Exception Type:  EXC_BAD_ACCESS (SIGSEGV)Exception Codes: KERN_INVALID_ADDRESS at 0x00000000Crashed Thread:  0 Thread 0 name:  Dispatch queue: com.apple.main-threadThread 0 Crashed:0   libsystem_c.dylib             0x37c0fe54 strlen + 121   libstdc++.6.dylib             0x38202410 std::string::operator=(char const*) + 82   FishingJoy                    0x003423a0 FishNetCollideHandler::JSONLoaderDidLoad(char const*) + 19363   FishingJoy                    0x00342b90 non-virtual thunk to FishNetCollideHandler::JSONLoaderDidLoad(char const*) + 324   FishingJoy                    0x002fb3e0 -[JSONLoaderDelegateEx JSONLoaderDidLoad:withResult:] + 1445   FishingJoy                    0x002fae3c -[JSONLoader requestFinished:] + 3526   CoreFoundation                0x380b4224 -[NSObject performSelector:withObject:] + 367   FishingJoy                    0x002d5614 -[ASIHTTPRequest reportFinished] + 1648   CoreFoundation                0x380b4224 -[NSObject performSelector:withObject:] + 369   Foundation                    0x3548e750 __NSThreadPerformPerform + 34410  CoreFoundation                0x38129afc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 811  CoreFoundation                0x3812935e __CFRunLoopDoSources0 + 35812  CoreFoundation                0x3812806e __CFRunLoopRun + 64613  CoreFoundation                0x380ab4d6 CFRunLoopRunSpecific + 29414  CoreFoundation                0x380ab39e CFRunLoopRunInMode + 9815  GraphicsServices              0x37e82fc6 GSEventRunModal + 15016  UIKit                         0x31c2b73c UIApplicationMain + 108417  FishingJoy                    0x0000389c main + 8418  FishingJoy                    0x0000383c start + 32

formats

让crash文件中的内存地址变成函数名称

Published on 2012 年 7 月 5 日, by wang cunkai in iOS技术, 游戏相关.

假如程序员编译了inhouse给测试。

如果在测试过程中出现奔溃现象,我想程序员一般会来看Device Log 也就是 crash文件

如果crash文件遇到如下的情况,在重要的地方看不到函数名称。我想是一件很奔溃的事情。

Source code   
Exception Type:  EXC_BAD_ACCESS (SIGSEGV)Exception Codes: KERN_INVALID_ADDRESS at 0x00000000Crashed Thread:  0 Thread 0 name:  Dispatch queue: com.apple.main-threadThread 0 Crashed:0   libsystem_c.dylib             0x37c0fe54 strlen + 121   libstdc++.6.dylib             0x38202410 std::string::operator=(char const*) + 82   FishingJoy                    0x003423a0 0x1000 + 34128963   FishingJoy                    0x00342b90 0x1000 + 34149284   FishingJoy                    0x002fb3e0 0x1000 + 31221445   FishingJoy                    0x002fae3c 0x1000 + 31207006   CoreFoundation                0x380b4224 -[NSObject performSelector:withObject:] + 367   FishingJoy                    0x002d5614 0x1000 + 29670608   CoreFoundation                0x380b4224 -[NSObject performSelector:withObject:] + 369   Foundation                    0x3548e750 __NSThreadPerformPerform + 34410  CoreFoundation                0x38129afc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 811  CoreFoundation                0x3812935e __CFRunLoopDoSources0 + 35812  CoreFoundation                0x3812806e __CFRunLoopRun + 64613  CoreFoundation                0x380ab4d6 CFRunLoopRunSpecific + 29414  CoreFoundation                0x380ab39e CFRunLoopRunInMode + 9815  GraphicsServices              0x37e82fc6 GSEventRunModal + 15016  UIKit                         0x31c2b73c UIApplicationMain + 108417  FishingJoy                    0x0000389c 0x1000 + 1039618  FishingJoy                    0x0000383c 0x1000 + 10300

其实我们可以还原出函数名称,现在需要软件“symbolicatecrash”(点击下载)和编译这台inhouse的电脑。

1、先下载symbolicatecrash,放入一个干净的目录下。顺便把crash文件也拖入此目录。

2、先把app文件给弄出来,步骤Xcode -> Window -> Organizer -> Archives -> 右击给测试的包->“Show in Finder”->“显示包内容”->复制目录“Products/Applications/”下面的.app到symbolicatecrash同级目录下。

3、打开终端(terminal)首先把symbolicatecrash拖入终端,现在终端会显示symbolicatecrash的地址并在末尾加入空格,不要回车然后依次把crash和app都拖入终端。

现在终端应该是(我在这里因为举例,先去掉绝对目录地址。大家看到的应该是一堆):

symbolicatecrash  a.crash  a.app

在末尾加入输出地址:

symbolicatecrash  a.crash  a.app  >  b.crash  回车。

现在去输出地址看 b.crash,应该已经成功显示函数名称了。呵呵~

Source code   
Exception Type:  EXC_BAD_ACCESS (SIGSEGV)Exception Codes: KERN_INVALID_ADDRESS at 0x00000000Crashed Thread:  0 Thread 0 name:  Dispatch queue: com.apple.main-threadThread 0 Crashed:0   libsystem_c.dylib             0x37c0fe54 strlen + 121   libstdc++.6.dylib             0x38202410 std::string::operator=(char const*) + 82   FishingJoy                    0x003423a0 FishNetCollideHandler::JSONLoaderDidLoad(char const*) + 19363   FishingJoy                    0x00342b90 non-virtual thunk to FishNetCollideHandler::JSONLoaderDidLoad(char const*) + 324   FishingJoy                    0x002fb3e0 -[JSONLoaderDelegateEx JSONLoaderDidLoad:withResult:] + 1445   FishingJoy                    0x002fae3c -[JSONLoader requestFinished:] + 3526   CoreFoundation                0x380b4224 -[NSObject performSelector:withObject:] + 367   FishingJoy                    0x002d5614 -[ASIHTTPRequest reportFinished] + 1648   CoreFoundation                0x380b4224 -[NSObject performSelector:withObject:] + 369   Foundation                    0x3548e750 __NSThreadPerformPerform + 34410  CoreFoundation                0x38129afc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 811  CoreFoundation                0x3812935e __CFRunLoopDoSources0 + 35812  CoreFoundation                0x3812806e __CFRunLoopRun + 64613  CoreFoundation                0x380ab4d6 CFRunLoopRunSpecific + 29414  CoreFoundation                0x380ab39e CFRunLoopRunInMode + 9815  GraphicsServices              0x37e82fc6 GSEventRunModal + 15016  UIKit                         0x31c2b73c UIApplicationMain + 108417  FishingJoy                    0x0000389c main + 8418  FishingJoy                    0x0000383c start + 32
原创粉丝点击